i A[i] 0 1 1 0 2 -1 3 -2