Increasing decreasing sequence

what should be the output for the following
input :
6
3
2
1
1
2
3

output : true or false ?

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

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

For input:
6
3
2
1
1
2
3

Output: true

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.