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.
No, it is not. Check in my other solutions. There is a faster one.
5572ms when I submit, test cases work fine
This comment is hidden because it contains spoiler information about the solution
Strictly speaking, since there are only two unique values (guaranteed by the description), set will have len 2, thus O(1) memory consumption.
In description:
This comment is hidden because it contains spoiler information about the solution
See the comments below, this implementation is correct as far as A is a list of unique integers.
Unique is an important detail. The devil is in the details.
The example you provided doesn't fit this requirement as 3 is not unique...
You're not to test whether the input is a mersenne prime
This comment is hidden because it contains spoiler information about the solution
You're welcome.
I think the 21 is added two times in your code. I had the same problem ;-)
You are wrong, the first order breaker is 0 of [1, 2, 0, 3, 4]. 2 is not even an order breaker.
As i described in details, Breaker is the item, when removed from sequence, sequence becomes ordered by ascending.
I am not following what you wrote. Can you provide a test case which fails my code?
We can add it into the test suite as well.