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.
This comment is hidden because it contains spoiler information about the solution
The Elixir version passes the
numtest
variable into the function, when it should not.[].index(nil)
returns nil.nil || 0
would give you 0.[].delete_at(0)
is a no-op where as[].delete_at(nil)
throws an exception.Although there is no test for this, this would mutate numbers. The requirements explicitly require you to not mutate the input.
Hopefully Ruby 2.4 will be added soon, because
digits
would make this a lot cleaner.No example tests in the Ruby version
The final
.sort!
is unecessary.