Unable to think of solution to this problem using kadane method
Maximum lenghth bitonic subarray
Hi @sattyrajpoot39, in this question what you can do is make 2 arrays: left and right.
In left array store the length of non-decreasing subarray ending at arr[i]. Create it while traversing on array from left to right.
Similarlry, in right array store the length of non-decreasing subarray ending at arr[i]. This time traverse on array from right to left.
Now find maximum value of (left[i] + right[i] - 1 ). This is your 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.