Max length biotonic subarray

needed help in logic that how can we find length for paricular array the conditions are fine i get them i am just putting my code pls check;
https://ide.codingblocks.com/s/52675

Hi ankush,

Logic is simple : just create two arrays let say left and right
left[i] : it store length of continuous increasing array starting from i in left/ backward direction.
right[i] : it store length of continuous increasing array starting from i in right/ forward direction.

Now find the max(left[i]+right[i]-1) for all i

this will give us the ans.

Hit like if you get it!
Cheers :smiley:

1 Like

how you think about this logic??