Maximum Length Biotonic Subarray

Sharing the link to my code:

I’ve tried my code with all the test cases that came to my mind and it is giving correct ans but is not able to pass the test case uploaded on coding blocks. It is showing wrong answer. What is wrong with my code?

Hello @priyanshi.agarwal3405,

You must have missed few cases:
2
8
5 4 4 3 2 2 1 1
15
5 4 1 2 2 3 4 5 6 3 3 2 1 3 4
Expected Output:
8
11
Your Output:
4
8

Hope, this would help.
Give a like if you are satisfied.

I’ve modified my code to include these test cases also but it is still giving me wrong answer

Hey @priyanshi.agarwal3405,

Can you share your code?

here is the link to my code:

Hey @priyanshi.agarwal3405,

Now your code is failing for following testcases:
2
9
1 1 1 1 2 3 4 5 5
5
1 1 1 1 2

Correct it.

ok… got it… thank you :slight_smile:

Anytime @priyanshi.agarwal3405,

Please, mark it as resolved.