Help with Creating Array List of permutations
I have created this code to generate all the permutations of a string that is passed into the method.
Each result I would like to add to an arraylist, this is where I am having difficulty placing the loop that I need.
Here is what I have, but it's not producing the result I would like,
public static void permutation(String prefix, String s)
ArrayList<String> candidates= new ArrayList<String>();
permutation(prefix + s.charAt(i), s.substring(0,i) + s.substring(i+1, n));