Do you like it?


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

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.