Longest bitonic subarray


this is the code that i am using …it is in O(n*n)
and hencee giving tle …but how this code can be converted to O(n)

Hello @dakshi,

Refer to this video. It explains the required approach:

Code:

Hope, this would help.
Give a like if you are satisfied.