/**
* 返回相同字母组成
* @param strs ['aeb','abe','rty','asd']
* @return
* [
* ['aeb','abe'],
* ['rty'],
* ['asd']
* ]
*/
public static List<List<String>> ArraysToSameListGroup(String[] strs){
String[] strarr = new String[strs.length];
for (int i=0;i<strs.length;i++){
//单词转化成数组
char[] chars = strs[i].toCharArray();
//对字符数组按字母排序 不同的符号的ASCII码是不一样的
Arrays.sort(chars);
String str = new String(chars);
strarr[i] = str;
}
List<List<String>> listLList = Lists.newArrayList();
for (int j=0;j<strarr.length;j++){
List<String> list = Lists.newArrayList();
System.out.println(Arrays.toString(strarr));
String temp = strarr[j];
for(int n=j;n<strarr.length;n++){
System.out.println(n+"="+strarr[n]);
if("".equalsIgnoreCase(strarr[n])){
continue;
}else{
if(temp.hashCode() == strarr[n].hashCode()){
list.add(strs[n]);
strarr[n] = "";
}
}
}
if(list.size()>0){
listLList.add(list);
}
}
System.out.println(listLList.toString());
return listLList;
}