题目链接:https://leetcode-cn.com/problems/find-the-difference/
题目如下:
class Solution {
public:
char findTheDifference(string s, string t) {
int temp=0;
//在异或运算中,所有偶数次出现的数字都可以抵消,只留下奇数次出现的数
for(auto e:s) temp^=e;
for(auto e:t) temp^=e;
return temp;
}
};