3 lines python code


  • 0
    S
    class Solution(object):
        def singleNumber(self, nums):
            """
            :type nums: List[int]
            :rtype: int
            """
            s1 = set(nums)
            a2 = sum(s1)*3-sum(nums)
            return a2/2
    

Log in to reply
 

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