Https://ide.codingblocks.com/s/242025

this is the correct and updated code for increasing-decreasing sequence problem and it is failing test case 1,3 and 8 .

Hey @aakashsharma845, your code is correct. There is something wrong with the test cases. We are looking into the matter and will revert back soon :slight_smile:

Hey @aakashsharma845, I looked into your code and found that it is not able to handle all the cases.
Let me tell you which all cases need to return the answer as true :

  1. When the sequence is only increasing.
  2. When the sequence is only decreasing.
  3. When the sequence is first decreasing and then increasing.

Rest of the cases should return the answer as false i.e.

  1. When the cases are first increasing and then decreasing.
  2. When two consecutive numbers are the same.

Hope this helps :slight_smile:

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.