Python solution use list build-in function 'count'


  • 0
    D
    class Solution(object):
        def findTheDifference(self, s, t):
            for letter in t:
                if t.count(letter)>s.count(letter):
                    return letter
    

Log in to reply
 

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