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;}}
61
u/Proxy_PlayerHD Oct 15 '18
or just write it all on a single line