Maximum length biotonic subarray

question = https://hack.codingblocks.com/contests/c/452/1289
answer = https://ide.codingblocks.com/#/s/20691

Take care of case when all elements are equal .
https://ide.codingblocks.com/#/s/20735

it’s still showing wrong answer

Look , i think there are some logical error
because there are many counterexample for ur code . You can check for
2
6
12 4 78 90 45 23
5
3 2 2 1 5
Try to maintain 2 extra array one increasing array and the other one is decresing array which will store the length of incresing and decreasing subarray till i th index .and your answer will be max(inc[i]+dec[i]-1).

Question link is not opening ? Can you again send the question.

Why the doubt has been reopened?

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.

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.

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.

Can u please tell where are u facing problem??

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.

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.