Two line python with set


  • 0
    L

    Two line python with set

    def findDisappearedNumbers(nums):
        """
        :type nums: List[int]
        :rtype: List[int]
        """    
        a = list(range(1,len(nums)+1))
        return list(set(a)-set(nums))
    

Log in to reply
 

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