389 Find the Difference
Input:
s = "abcd"
t = "abcde"
Output:
edef findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
s_list = sorted(s)
t_list = sorted(t)
for s_char, t_char in zip(s_list, t_list):
if s_char is not t_char:
return t_char
return t_list[-1]Last updated