I have unlocked the test cases and checked the input separately. It’s working individually but not while submitting.
Code:
n = int(input())
list_input = []
for i in range(1,n+1,1):
a = int(input())
list_input.append(a)
difflist = []
for i in range(len(list_input)-1):
ele = list_input[i+1] - list_input[i]
if ele > 0 :
ele = 1
elif ele < 0 :
ele = -1
else:
ele = 0
difflist.append(ele)
sorted_difflist = sorted(difflist)
if difflist == sorted_difflist:
print(“true”)
else:
print(“false”)