Getting TLE in max length biotonic subarray

Getting TLE in max ken biotonic subarray

solution-https://ide.codingblocks.com/s/183511 why tle

please solve this
and
why we are doing -1 in max = inc[0] + dec[0] - 1;