剑指offer python版 数组中数值和下标相等的元素

def aa(nums):
    leng=len(nums)
    for i in range(leng):
        if i==nums[i]:
            print (i)
            
        i+=1
    return None


print(aa([0,1,2,3,4,5]))
原文地址:https://www.cnblogs.com/xzm123/p/9869255.html