public static boolean compare(String a,String b){
byte[] b1 = a.getBytes();
byte[] b2 = b.getBytes();
int[] bCount = new int[256];
for(int i=0;i<256;i++){
bCount[i] = 0;
}
for(int i=0;i<b1.length;i++)
bCount[b1[i]-'0']++;
for(int i=0;i<b2.length;i++)
bCount[b2[i]-'0']--;
for(int i=0;i<256;i++){
if(bCount[i]!=0)
return false;
}
return true;
}
https://blog.csdn.net/wutongyu0123wutongyu/article/details/51702271