A subarray A[i … j] is bitonic if there is a k with i <= k <= j such that A[i] <= A[i + 1] … <= A[k] >= A[k + 1] >= .. A[j – 1] > = A[j] i.e subarray is first increasing and then decreasing or entirely increasing or decreasing

You are provided n numbers of array. You need to find the maximum length of bitonic subarray. A subarray A[i … j] is bitonic if there is a k with i <= k <= j such that A[i] <= A[i + 1] … <= A[k] >= A[k + 1] >= … A[j – 1] > = A[j] i.e subarray is first increasing and then decreasing or entirely increasing or decreasing.

hi @rachitpd1999_12754ab8dd26f52e
first of all give a new line after every test case…
secondly make array of size n instead of fixing it to of size n…
corrected code -->


It’s working fine and passing all test cases now…

its not passing any test case


try refreshing the page…

1 Like

yes,its working now thanks

1 Like

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.