Clever, but a little bit tricky to get your head around ;)
This comment is hidden because it contains spoiler information about the solution
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. :)
I have changed it to -1.
Thank you, I have changed this.
I have changed the number of test cases and the changed the failed assertion message to also include the input.
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 in test.describe:
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.