Increasing decreasing -sequence

https://ide.codingblocks.com/s/55761

it is not producing correct output for all test cases… how to rectify the error ?

Hi Yukti, work on your logic. Your code is giving true for all testcases. You can also do this question without using arrays.