Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
time complexicity is more for this code
time complexicity is more for this code
Anyone found the code which runs on all testcases?
Anyone found the code which runs on all testcases?
I won't search, sorry. Some things to do right now that are more interesting to me. ;)
Looking at your test, the problem looks like my code is greedy and ends up in a local maximum. So it would require a way to make it "absolute" rather than "greedy".
what changes you do to make this code run for this testcase??
it's possible, I just did something that passed the tests, nothing more. ;) (that's why we want random tests...)
this code not give correct output for testcase- 3 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Output should be 3 but it gives 2