Find the Difference

2017/12/8 posted in  leetcode

class Solution {
public:
    char findTheDifference(string s, string t) {
        char sum = 0;
        for (char c: s) {
            sum^=c;
        }
        for (char c: t) {
            sum^=c;
        }
        return sum;
    }
};