Test cases failing

Hi,
I have corrected ur code https://ide.codingblocks.com/s/623824

yeah thank you, but can you provide some test cases where my code is failing so that I can debug it because its passing sample test cases?

basically what ur code is missing is >= u are just checking for > or < while u have to check for equal case also… ie >= and <=

can you debug that please ?

sry but i am unable to understand ur logic using so many if else statements what u are doing… refer my code… its very simple and clear implementation…

yeah your code is simple I understood that, actually I am using the concept of increasing decreasing sequence from Fundamentals Challenge, i have commented some parts, if you can provide some test cases, I can debug it :sweat_smile:

1
6
1 1 2 3 1 1
consider this test case… ans should be 6 while ur code is giving 0… try to dry run and check for same…

yeah man, thanks a lot! you can close this thread.

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.