This wiki to show my solution for LeetCode problem Find the Difference
char findTheDifference(string s, string t) { sort(s.begin(), s.end()); sort(t.begin(), t.end()); for (int i = 0; i < s.size(); i++) { if (s[i] != t[i]) return t[i]; } return t[t.size() - 1]; }
There was an error while loading. Please reload this page.