原题:
Given two strings s and t which consist of only lowercase letters.
String t is generated by random shuffling string s and then add one more letter at a random position.
Find the letter that was added in t.
C++解法:
char findTheDifference(string s, string t) {
if(s.empty())
return t[0];
string a = s+t;
char res = a[0];;
for(string::size_type i = 1; i!=a.size();++i)
res = res^a[i];
return res;
}