Error in the cde

please tell me what is the error in the code as it is not passing all the test cases
n=int(input())
l=[]
for x in range(n):
a=int(input())
l.append(a)
low_count=0
up_count=0

for i in range(0,len(l)-1):
if len(l)<3:
break;
if l[i]>l[i+1]:
if low_count>0:
break;
up_count=up_count+1
if l[i]<l[i+1]:
low_count=low_count+1
if low_count>0 and up_count>0:
print(“true”)
else :
print(“false”)

Please save your code https://ide.codingblocks.com/ and share the link of the same ,since indentation is not clear in the above code that you have shared.

About the input, you need not to take array, one can also perform the question without using array. As every time we just check two consecutive numbers to tell whether the seqeunce is increasing or decreasing, so why should we store all of the numbers.

A sequence is true if you can split it into two sub sequence such that first sequence is strictly increasing and second sequence is strictly decreasing.
For e.g.,
1 2 3 4 5
This sequence is also true as we can split it into two sequence like., sequence one is empty and sequence two is 1 2 3 4 5.
Let’s take another example.,
5 4 3 2 1
This is also true as we can split it such that sequence one is5 4 3 2 1 and sequence two is empty.
According to the problem statement, we can say the if the sequence decreases then it should not increase, if this is the case one can directly print false else print true.

@playboychirag400
https://ide.codingblocks.com/s/107461 refer to this code for the solution

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.