Maximum length bitonic array

Please check the code. I am unable to pass the testcases where is the problem please tell.
this is my code link