Python--i don't know what's the ''constant space"


  • -1
    M

    '''
    class Solution(object):
    def firstMissingPositive(self, nums):
    """
    :type nums: List[int]
    :rtype: int
    """
    goal=1
    while True:
    if goal not in nums:
    return goal
    break
    else:
    goal+=1

        '''

Log in to reply
 

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