Python one-line functional programing solution


  • 0
    J
    class Solution(object):
        def findTheDifference(self, s, t):
            """
            :type s: str
            :type t: str
            :rtype: str
            """
            return chr(reduce(lambda a,b:a^b,[ord(x) for x in s+t]))
    

Log in to reply
 

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