Increasing Decreasing Sequence

My last test case is going wrong.

@kabirsachin1999 Please save your code on ide.codingblocks.com and share its link.