Code is correct for Max length of bitonic array but test cases are not passed

Hello @rajharsh865 your codes complexity is large because the logic you are using is brute force approach and you can optimise it.
i have given you the optimised code you have to understand that logic.
its good you have designed the brute force logic but you should now think now in a optimized way.
Happy Learning!!

you should use this logic:
https://ide.codingblocks.com/s/389356
Explanation of the code:
in this question you will need two extra arrays in which you will store the maximum element till any point and the in the second array smalles till the point.
then you intitalise your any variable with the sum of the 0th elements and subtract from it and then you will see in both the arrays if the same operation will give you any answer greater then this, that will be the answer.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.