Find first missing number in a strictly increasing array. (where X > A[0])
def find_first_gap_linear(lst): for i in xrange(len(r)-1): if r[i] + 1 != r[i+1]: return r[i] + 1 return -1