easy python with set


  • -1
    L

    easy python with set:
    '''
    def findDisappearedNumbers(self, nums):
    """
    :type nums: List[int]
    :rtype: List[int]
    """
    set1 = set(nums)
    set2 = set([i+1 for i in range(len(nums))])
    return list(set2-set1)
    '''


Log in to reply
 

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