Simple python linear


#1
    c = 0
    max_so_far = -1
    
    for (i, n) in enumerate(A):
        max_so_far = max(max_so_far, n)
        if (i == max_so_far):
            c += 1
            
    return c