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.
Fixed! Thank you! ;)
Fixed!
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.@jhoffner
Just a reminder to review and approve the R Translation If you recall, I used the exact python test suite, but asked if you wanted random tests added. You said you did, so I added them. I've made the comments to the reference solution at the top of the test suite more explicit so you can see what's happening in the code if you're unfamiliar with R.
Cheers!
Nice problem because one has to think about trailing zeros.
[].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.