Skip to content

Instantly share code, notes, and snippets.

@rethab
Created March 21, 2013 07:52
Show Gist options
  • Save rethab/5211374 to your computer and use it in GitHub Desktop.
Save rethab/5211374 to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
int n = 3;
int elems = (int) Math.pow(Math.pow(n, n), n);
Set<String> perms = new HashSet<String>(elems);
for(int perm = 0; perm < elems; perm++) {
String num = "";
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
num = SmartMapper.lookup(x, y, perm, n) + num;
}
}
if (!perms.add(num)) {
System.out.println(num + " was already in there oO");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment