How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters.
Any l
import java.util.*;
public class all_subsets {
public static void main(String[] args) {
String a = "abcd";
for(String s: all_perm(a)) {
System.out.println(s);
}
}
public static Set concat(String c, Set lst) {
HashSet ret_set = new HashSet();
for(String s: lst) {
ret_set.add(c+s);
}
return ret_set;
}
public static HashSet all_perm(String a) {
HashSet set = new HashSet();
if(a.length() == 1) {
set.add(a);
} else {
for(int i=0; i