Python Map-Reduce solution - faster than 90%

  • 0
    def findTheDifference(self, s, t):
        if not s:
            return t
        from operator import xor
        x = reduce(xor, map(ord, s))
        y = reduce(xor, map(ord, t))
        return chr(x ^ y)

Log in to reply

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