class Solution(object):
    def findTheDifference(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        chrs = {}
        res = 0
        for w in t:
            if w not in chrs:
                chrs[w] = 1 << (ord(w) - 97)
            res += chrs[w]
        for w in s:
            res -= chrs[w]
        return chr(len(bin(res)) + 94)

class Solution(object):
    def findTheDifference(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        chrs = {}
        res = 0
        for w in t:
            if w not in chrs:
                chrs[w] = 1 << (ord(w) - 97)
            res += chrs[w] # it can be overflow
        for w in s:
            res -= chrs[w]
        return chr(len(bin(res)) + 94)

Comment overflow problem on FindtheDiff_BitHash
Comment overflow problem on FindtheDiff_BitHash
  class Solution(object):
      def findTheDifference(self, s, t):
          """
          :type s: str
          :type t: str
          :rtype: str
          """
          chrs = {}
          res = 0
          for w in t:
              if w not in chrs:
                  chrs[w] = 1 << (ord(w) - 97)
-             res += chrs[w]
+             res += chrs[w] # it can be overflow
          for w in s:
              res -= chrs[w]
          return chr(len(bin(res)) + 94)
  
Comment overflow problem on FindtheDiff_BitHash
## Code Before:
class Solution(object):
    def findTheDifference(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        chrs = {}
        res = 0
        for w in t:
            if w not in chrs:
                chrs[w] = 1 << (ord(w) - 97)
            res += chrs[w]
        for w in s:
            res -= chrs[w]
        return chr(len(bin(res)) + 94)

## Instruction:
Comment overflow problem on FindtheDiff_BitHash
## Code After:
class Solution(object):
    def findTheDifference(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        chrs = {}
        res = 0
        for w in t:
            if w not in chrs:
                chrs[w] = 1 << (ord(w) - 97)
            res += chrs[w] # it can be overflow
        for w in s:
            res -= chrs[w]
        return chr(len(bin(res)) + 94)
