题解 | #缺失数字#
缺失数字
http://www.nowcoder.com/practice/9ce534c8132b4e189fd3130519420cde
class Solution:
def solve(self , a ):
# write code here
if a[0]!=0:
return 0
for i in range(1,len(a)):
if a[i]-a[i-1]!=1:
return a[i]-1
return a[-1]+1