class Solution:
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
"""
T = []
for i in t:
T.append(i)
for j in s:
T.remove(j)
return T[0]
"""
for i in range(len(t)):
if t.count(t[i]) != s.count(t[i]):
return t[i]
分别对同一字符计数,不同则返回