Find the Difference
思路一: xor 两个字符串
public char findTheDifference(String s, String t) {
char result = 0;
for (int i = 0; i < s.length(); i++) {
result ^= s.charAt(i);
}
for (int j = 0; j < t.length(); j++) {
result ^= t.charAt(j);
}
return result;
}
标签:String,int,char,++,length,result,easy,389,leetcode
From: https://www.cnblogs.com/iyiluo/p/16804878.html