This is link for my code .
Please check this code and help me to find out the problem in this code to pass all the test cases.
Increasing Deccreasing Sequence
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.
Consider test case:
For input:
6
3
2
1
1
2
3
Now this splits into 2 sequences-- 3 2 1(decreasing) and 1 2 3(increasing)
So Expected Output:
true
Your Ouput:
false
Also for case:
5
5
5
5
5
5
Expected Output:
false
Check and dry run your code with these cases.
After dry run with these cases,for first cases it show correct output but for second case it show wrong output.
Please share the code.
Dry run and check.
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.