C++ | Leetcode C++题解之第389题找不同
题目:
题解:
class Solution {
public:
char findTheDifference(string s, string t) {
int ret = 0;
for (char ch: s) {
ret ^= ch;
}
for (char ch: t) {
ret ^= ch;
}
return ret;
}
};