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.
JS Translation
This is a smart one.
Should be same result, but wouldn't it be slightly faster to shortcut the extra operation?
This comment is hidden because it contains spoiler information about the solution
No but tests guarantee that there is ever only two different numbers, one of them unique.
It would indeed.
That's what I've done.
I put
if arr == None or len(arr) <= 1:
instead of
if arr == None or len(arr) < 3:
Guys will that work if there is two different uniq numbers?
This comment is hidden because it contains spoiler information about the solution
Very good solution, the '<' operator simplifies a lot.
Yes, but the tests that the author coded are requesting a return zero from a list with two itens, despite this is not explained in the details session.
true, there should be a test case for that
What about if null is passed?
This comment is hidden because it contains spoiler information about the solution
Loading more items...