import java.util.*;
public class Solution {
static ArrayList<String> list = new ArrayList<String>();
static int count = 0;
public ArrayList<String> Permutation(String str) {
//特殊情况1:
if(str.equals("")){return list;}
//特殊情况2:
if(str.length() == 1){
list.add(str);
return list;
}
addList(str, "");
return list;
}
//str可以互换的数组,cur固定数组
public static void addList(String str, String cur){
if(str.equals("") && !list.contains(cur)){
list.add(cur);
}
for(int i = 0; i < str.length(); i++){
addList(str.substring(0,i) + str.substring(i + 1,str.length()),cur + str.charAt(i));
}
}
}