not able to clear test case 9
Increasing decreasing seqeunce
Hello @sindhu_21,
You have missed an important part of the question:
The sequences are strict i.e. same values at consecutive places are not allowed.
Example:
5
1
1
3
4
5
Expected Output:
false
Your Output:
true
Hope, this would help.
Give a like if you are satisfied.
sir but if i make “if(c==b); break;” the code is having more errors than before.
Hey @sindhu_21,
-
modify it as:
if(c==b){
cout<<“false”;
return 0;
// continue;
} -
The other logic is wrong.
Solution:
Dry run your code for:
…4 1 2 3 4 : true
…4 4 3 2 1 : true
…4 1 2 3 2 : false
…4 4 3 2 4 : true
…4 1 1 1 2 : false
Try to figure it out and let me know if you don’t find anything.