Description
Submission
class Solution { int freq[26]; public: char findTheDifference(string s, string t) { for(char ch: t) { ++freq[ch-'a']; } for(char ch: s) { --freq[ch-'a']; } for(int i = 0; i < 26; ++i) { if(freq[i]) return i + 'a'; } return 'a'; } };