Python string only


  • 0
    D

    Ugly but I'm tired

    class Solution(object):
        def findTheDifference(self, s, t):
            for c in s:
                i = t.find(c)
                t = t[:i] + t[i+1:]
            return t[0]
    

Log in to reply
 

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