Can you please provide me some hint with this question?
Maximum length bitonic sum
hi @abhi18sinha, what you can do is for every element in the array you can consider it as pivot and find the maximum length increasing subarray ending at a[i] and maximum length decreasing subarray and add there value , do this for every index and take maximum, dry run on some example , first try bruteforce and then try to optimize using dp
So is it necessary for the numbers to be consecutive or can it have breaks?
@abhi18sinha, they have to be consecutive as we need to find maximum bitonic subarray not sub sequence
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.