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.
TIL
String#end_with?
returns true if the argument is an empty string.One minor improvement: You're referencing names.length 5 times. That's a smell it should be a variable, would be a great use of a case statement.
yeah man, gutted lol
This looks cool, but Array#length adds overhead for longer arrays
Can we store it somewhere and use that variable ?
I am not sure how much impact it does tho
Using the #sum method from Array is many, many times faster than using the alternative, inject or reduce.
this is the party pooper
can be done in linear time
but with more code "noise"
'Fixed, see comments above'
a little bit long line but good anyway!
funny but nice ........
This comment is hidden because it contains spoiler information about the solution
wait wait? is it legal?!
Added.
very clean code. more ruby like.
I have added tests.
Loading more items...