Max len biotonic array help

MY CODE:
https://ide.codingblocks.com/#/s/20105

I tried to solve this using cumulative sum method since this problem of finding max length biotonic array is similar to the optimized method of finding minimum sum of subarray, but somehow it is giving the wrong answer.

Kindly help me out.

check this
https://ide.codingblocks.com/#/s/20109

unable to understand this code

What about this code?

https://ide.codingblocks.com/#/s/20203