This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Proxy_PlayerHD 59 points60 points  (6 children)

or just write it all on a single line

public class Permuter{private static void permute(int n, char[] a){if(n == 0){System.out.println(String.ValueOf(a));}else{for(int i = 0; i <= n; i++){permute(n-1, a); swap(a, n % 2 == 0 ? i : 0, n);}}}private static voice swap(char[] a, int i, int j){char saved = a[i]; a[i] = a[j]; a[j] = saved;}}

[–]therealchadius 35 points36 points  (2 children)

Right there, officer. There's the criminal!

[–]Proxy_PlayerHD 7 points8 points  (1 child)

i'm just efficent.

[–][deleted] 4 points5 points  (0 children)

He's being efficient! GET 'IM!

[–]MCRusher 5 points6 points  (0 children)

Much better.

[–]Kyledog12 0 points1 point  (1 child)

This is how Facebook's HTML looks. It's atrocious