my code is working elsewhere however not working here
Maximum bitonic sequence
@abhiuday102 hey you are creating an array of only size 1000 when the given size range is upto 10^6.
Second you are seeing decreasing in a strictly increasing manner, use greater than equal to.
Also you not taking proper consideration of increasing decreasing sequence.
To solve this problem create two array of the same size of given array , in one count the maximum possible non ascending length and in other take count of maximum possible non descending array for ever position.
Finally for each position you can get the bittonic array size using these two arrays…
If this resolves your doubt mark it as resolved.
sir the code works fine for all the cases
and the error it raises doesn’t seem to come from above problems
if you could dry run it for some cases
I am not exactly looking increasing decreasing but till it reaches a pivot
please help
sir i have done an alternate approach as well but i am not able to figure out in which case it is not helping please help
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.
@abhiuday102 hey sorry, i forgot your doubt,you are not returning anything from your return_zero function , when key!=0.
Second take greater than equal to.
Third, your array size is only 1000 when input can be 1000000 .
Also their is counting error.