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