Test case failed in Increasing Decreasing Sequence

My TestCase#2 is always showing the wrong answer, I’ve tried many approaches, maybe I couldn’t understand the problem completely. My code is not handling that one specific test case. Can anyone help me what’s the catch in testcase2?
Link to my code - https://ide.codingblocks.com/s/79251

the test case is having some output issue
your code and logic is passing all test cases
the test case is : 5 1 2 3 4 5

1 Like

Thank you for your response. :slight_smile: