Increasing decreasing sequence doubt 2

can you give one more example or its pseudo code

@vikashkmr519
You have to check if it is possible to split an array into 2 sequences such that first is strictly decreasing and the other is strictly increasing. A test case like : 5 4 3 2 should also give true because you can say that the sequences can have one element also. So, 5 4 3 2 is strictly decreasing.
More e.g:
1 2 3 4 Valid
3 2 1 Valid
3 4 5 2 1 Invalid

HINT: you need not store the numbers, so it can be done without using arrays.
You can check condition while taking input and thus conclude whether it is valid or not.
The sequence can be valid even in the corner cases when the sequence is either completely increasing or completely decreasing also.
Hit like if i gave a satisfactorily explanation to the problem else please ask your doubts here.

1 Like

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.