题解 | #缺失数字#
缺失数字
http://www.nowcoder.com/practice/9ce534c8132b4e189fd3130519420cde
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 找缺失数字 # @param a int整型一维数组 给定的数字串 # @return int整型 # class Solution: def solve(self , a ): if a[0]!=0: return 0 # write code here for i in range(1,len(a)): if a[i]-a[i-1]==2: return i break else: continue return i+1