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.
In the instructions, there's a duplication of Test case samples.
This needs to clearly communicate what four 5's do, in Test Case form.
Test.assert_equals( score([5, 3, 5, 5, 5]), 550 )
I can pass the final submission test cases even if I return 500 with four 5's but it should be 550.
Same with Ruby,
assertEquals
is used, instead ofassert_equals
.I just finished the Ruby version, the test cases are failing now probably because assertEquals is now assert_equals.
I keep forgetting that nil is false, so I keep using arithmetic operators... D:
TIL gsub could do blocks...
+1 because you didn't need a hash like we did. heh
Mindblowing! The simplicity of this code makes it seem like Array#shift was made for this exact problem.
The simplicity had me laughing. Good one.
No need to assign to x though.