Python one-liner beats 93%


  • 1
    M
    def singleNumber(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        from operator import xor
        return reduce(xor, nums)
    
    

Log in to reply
 

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