public Set<String> getPermutations(String prefix, String s){
        Set<String> stringSet = new HashSet<String>();
        if(s.equals("")){
            stringSet.add(prefix);
            return stringSet;
        }
        for(int i=0; i<s.length(); i++){
            Set<String> subSets;
            if(i==0){
                subSets = getPermutations(prefix+s.charAt(i), s.substring(1, s.length()));
            }
            else if(i==s.length()-1){
                subSets = getPermutations(prefix+s.charAt(i), s.substring(0, i));
            }
            else{
                subSets = getPermutations(prefix+s.charAt(i), s.substring(0, i)+s.substring(i+1, s.length()));
            }
            stringSet.addAll(subSets);
        }
        return stringSet;
    }