<qiyuangong>041_First_Missing_Positive_1.py
def firstMissingPositive( nums):
    ls = len(nums)
    index = 0
    while index < ls:
        if nums[index] <= 0 or nums[index] > ls or nums[nums[index] - 1] == nums[index]:
            index += 1
        else:
            pos = nums[index] - 1
            nums[index], nums[pos] = nums[pos], nums[index]
    res = 0
    while res < ls and nums[res] == res + 1:
        res += 1
    return res + 1
def sample_funcname ( var_0 ) :
    var_2 = len ( var_0 )
    var_4 = 0
    while var_4 < var_2 :
        if var_0 [ var_4 ] <= 0 or var_0 [ var_4 ] > var_2 or var_0 [ var_0 [ var_4 ] - 1 ] == var_0 [ var_4 ] :
            var_4 += 1
        else :
            var_6 = var_0 [ var_4 ] - 1
            var_0 [ var_4 ] , var_0 [ var_6 ] = var_0 [ var_6 ] , var_0 [ var_4 ]
    var_7 = 0
    while var_7 < var_2 and var_0 [ var_7 ] == var_7 + 1 :
        var_7 += 1
    return var_7 + 1
