class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
dic ={}
for it
in s:
dic[it] = dic.get(it,
0)+
1
for it
in t:
if dic.get(it,
0) ==
0:
return it
else:
dic[it] -=
1
转载请注明原文地址: https://www.6miu.com/read-793.html