1 class Solution { 2 public: 3 char findTheDifference(string s, string t) { 4 map<char,int>Map_Temp; 5 for(int i=0;i<s.size();i++) 6 Map_Temp[s[i]-'a']++; 7 for(int i=0;i<t.size();i++) 8 Map_Temp[t[i]-'a']--; 9 map<char,int>::iterator iter; 10 for(iter=Map_Temp.begin();iter!=Map_Temp.end();iter++) 11 if(iter->second) 12 return char(iter->first+'a'); 13 return 0; 14 } 15 };