package margusmartseppcode.From_20_to_29;
import java.util.HashSet;
import java.util.Set;
public class Problem_29 {
public static void main(String[] args) {
int max = 101;
Set<double> set = new HashSet<double>();
for (Long i = 2L; i < max; i++)
for (Long j = 2L; j < max; j++)
set.add(Math.pow(i, j));
System.out.println(set.size());
}
}
Showing posts with label unique elements. Show all posts
Showing posts with label unique elements. Show all posts
Tuesday, September 8, 2009
Euler Problem 29 solution
Time (s): ~0.025
Labels:
Euler Problem 20-29,
HashSet,
unique elements
Subscribe to:
Posts (Atom)