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.
Clever, but a little bit tricky to get your head around ;)
This comment is hidden because it contains spoiler information about the solution
impressive!
This comment is hidden because it contains spoiler information about the solution
true!
index is indeed slower, there aren't many calls each time but it adds up.
After testing, using index increases the time from ~800ms to ~1s.
I don't like looking for the same thing multiple time when I'm not constrained by memory space. :)
This comment is hidden because it contains spoiler information about the solution
I have changed it to -1.
Thank you, I have changed this.
SOLVED
I have changed the number of test cases and the changed the failed assertion message to also include the input.
This comment is hidden because it contains spoiler information about the solution
Well, if we want to get technical about duplicates, then no other kata is exactly like this one ;)
I agree with you though. It's kind of like optimization kata. Like what, we can only have 1 knapsack problem on all of CW? The wording and the story behind kata is what makes this site so great.
Assertions should be done in a scope of
test.it
, never intest.describe
:https://docs.codewars.com/languages/python/codewars-test/#test-group
I do not quite agree with FArekkusu about 'not a novel idea', because you need to get to this conclusion somehow. Unless there already exists a kata about all possible pairs, or something like this.
Loading more items...