Five line to solute problem using python


  • -1
    W
    class Solution(object):
    def firstMissingPositive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        if not nums:
            return 1
        temp = set(range(1,len(nums)+2))
        temp1 = set(nums)
        return min(temp -temp1)

Log in to reply
 

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