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
is it common to mutate function arguments in ruby?
I'm coming from the JS world where immmutability is the key to sanity
EDIT: think i got it - we can sort and reverse in place since chars returns a new array. No args are being mutated
This kinda defeats the purpose, but still the right call nonetheless
Dupe issue.
155+ general obviouses.
This comment is hidden because it contains spoiler information about the solution
Language?
Did you ever figure out what was happening with this? Why was it blowing up with large numbers?
Ruby lets you specify default values for a method's arguments---values that will be used if the caller doesn't pass them explicitly. This is done using the assignment operator
=
.because name of method is 'always'
could somebody explain to me why did the author assign n to nil when he passed it to the method always?
random tests need more precision
I benchmarked it and found it to be at least twice as slow as the ternary implemenatation. It looks nice though.
wow. great job on this.
This cracked me up.
Loading more items...