leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

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 };