Python one line


  • 0
    L

    class Solution(object):
    def singleNumber(self, nums):
    """
    :type nums: List[int]
    :rtype: int
    """
    return reduce(lambda x, y: x^y, nums)


Log in to reply
 

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