Simple python solution


  • 0
    F
    class Solution(object):
        def findTheDifference(self, s, t):
               s=''.join(sorted(s))
               t=''.join(sorted(t))
           
               for x,y in zip(t, s):   
                    if x!=y:
                       return x
               return t[-1]
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.