#389. Find the DifferenceYou are given two strings s and t.

#String t is generated by random shuffling string s and then add one more
#letter at a random position.

#Return the letter that was added to t.

 

#Example 1:

#Input: s = "abcd", t = "abcde"
#Output: "e"
#Explanation: 'e' is the letter that was added.

class Solution:
    def findTheDifference(self, s: str, t: str) -> str:
        ##hash table
        dic= {}
        for i in s:
            if i in dic:
                dic[i]+=1
            else:
                dic[i]=1
        
        for i in t:
            if i not in dic:
                return i
            else:
                dic[i]-=1
        return [key for key, value in dic.items() if value==-1][0]



