Answer:
solution for b)
A = [11, 10, 7, 13, 14, 12, 9, 15, 8]
Out = []
for i in range(len(A)):
if i == len(A) - 1:
if A[i] < A[0]:
Out.append(A[0] - A[i])
else:
Out.append(-1)
else:
if A[i] < A[i + 1]:
Out.append(A[i + 1] - A[i])
else:
Out.append(-1)
print(Out)