Problem - Max Len Biotonic Array

Ques: https://hack.codingblocks.com/practice/p/369/1289
My solution: https://ide.codingblocks.com/#/s/15341

I’m not able to pass the test case. What is wrong with my solution?
TIA!

Heyy ! Your code is not working for same nos. like if you give input to it as
2
6
12 4 78 90 45 23
4
40 40 40 40
it will work for different nos bt for second test case ur code is giving only 1 which is wrong
So you just need to take care of these case as well
If you still feel difficulty then you can go through this -->>
https://ide.codingblocks.com/#/s/15377
:blush:

Thanks! But I corrected my code. Basically I have modified arr[i]>arr[j] to arr[i]>=arr[j]. This passes the second test you gave. But it still gives me incorrect submission. :confused:

Did you use mine ?
It will pass all the test case for sure !

Yes. Your code does pass the test case. I was hoping you could tell me what is the test case that I’m failing so that I could debug my code.

You can debug your code using this testt case
1
4
4 3 3 1

1 Like