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.
It seems to me that this solution is incorrect, since it assumes that the unique element is positioned at index 0 of arr?
awsum
Of course, thanks for looking into it!
Let me know if I can be of any help by providing more details.
This comment is hidden because it contains spoiler information about the solution
First of all: I absolutely love this kata. On the surface it seems so simple... but its surface conceals many, hidden complexities. Thank you @zappa78!
Unfortunately I also feel something is wrong with the Javascript variant, just like @zhirnov-d and @Iluxmas remarked 4 days and 17 days ago. Perhaps due to an update, as @Iluxmas suggested?
I have written quite a performant algorithm (tests complete in 733ms, that's even about 16 times faster than @Iluxmas), but still I get remote timeouts. While remotely all '10000 big numbers' and all '100000 big numbers' pass, the final category '1000000 big numbers' times out.
I came to believe that something is wrong because of three reasons:
What do you think of this, @zappa78?
I will try to share my solution in a comment to myself, so that I can set a spoiler flag.
Should rather say that the horizon is the limit, eh?
being able to understand this probably makes the author very apt at refactoring code bases...
hahaha you really wanted a "one-liner" huh?
jesus
thanks!
How does the .reduce({}) work?
If I try
str = "a=1, b=2, c=3, d=4"
str.split(', ').reduce({})
I get an error:
main.rb:5:in `reduce': {} is not a symbol nor a string (TypeError)