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.
Nice improvement with reduce. Even the
0
could be removed, as reduce picks the first element as the initializer if it is not provided.This comment is hidden because it contains spoiler information about the solution
Thank you :)
The problem wasn't with the submission tests, but even with the small test cases.
Anybody else getting timeout errors with Go? The answer runs fine in play.golang
Wouldn't sorted be slower than reverse/max for larger inputs? Both reverse and max run in O(n), while sorted runs on O(n log n).
Instead of reject, you could use trim: true in String.split to remove the empty results.
This comment is hidden because it contains spoiler information about the solution
You could use the integer div/2 instead of "/" + round.
It's due the Elixir version used to run the tests (1.2.4). The commit that changed from 'to_char_list' to 'to_charlist' happened on the 1.3 release.
Wouldn't this give a false positive for lists of different lengths? Like a=[3,4], b=[25].