0389.cpp (246B)
1 class Solution { 2 public: 3 char findTheDifference(const string &s, const string &t) { 4 int sum = 0; 5 for (const char c : t) 6 sum += c; 7 for (const char c : s) 8 sum -= c; 9 return sum; 10 } 11 };