Project Euler – Problem 62

Problem 62:
The cube, 41063625 (345^3), can be permuted to produce two other cubes: 56623104 (384^3) and 66430125 (405^3).

In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube.

Find the smallest cube for which exactly five permutations of its digits are cube.

package runner;

import java.math.BigInteger;
import java.util.HashSet;
import java.util.List;
import java.util.Vector;

class runner
	private static void setup(HashSet> store, int max, int limit){
		int len = 1;
		List storeDigits = new Vector(20);
		for(int i=1;i= max) store.add(storeDigits);
				len = current.toString().length();
				storeDigits = new Vector(10);
		if(storeDigits.size() >= max) store.add(storeDigits);
	public static boolean isPermutationOf(String strI, String strJ){
		int[] count = new int[48+10];
		for(int i=0;i> store = new HashSet>(10);
		setup(store, 5, 10000);
		for(List set : store){
			boolean[] tried = new boolean[set.size()];
			for(int i=0;i