Increasing Decreasing Sequence


some test cases are running some are not, plz help me with the code

@akb.tech17 Consider test case:
For input:
6
3
2
1
1
2
3

Expected Output:
true

According to the question, the following possibilities may arise after splitting a sequence into two sequences:

-First Sequence is strictly decreasing , 2nd sequence is strictly increasing–> return true
-First Sequence is strictly increasing, 2nd sequence strictly decreases-------> return false
-If one sequence is empty and the other sequence is strictly increasing/decreasing—>return true.