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.
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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
XXC is not a proper roman numeral. I'm assuming you are trying to represent the number 80? 80 is LXXX.
https://en.wikipedia.org/wiki/Roman_numerals#Basic_decimal_pattern
Great kata! I had fun!
Ah, coercion. Thanks for pointing it out - I refactored it.
Care to explain your reasoning?
My function returns 1 for [-1, 1] - unless I'm missing something that is the correct answer.
The function will never return the first number. The first number starts the sequence, it can't be non-consecutive in that case. The second number should be 0 but it's -1 so that is the first non-consectuive number.
I was able to solve it without manually having to sum the Xbonacci seq each iteration!
Great kata! I had fun!
The other solutions use slice().reduce() which copies the values into a new array and then reduces the new array into a single value. A second loop like this is most likely faster.
This comment is hidden because it contains spoiler information about the solution
What formula is this?
Awesome kata. Really made me rack my brains to figure out how to reorganize the data in to the 3x3 grids. Thanks !
Hey GonArrivi - I am kind of stumped on doing it with a math approach - I recgonize patterns but I'm not sure how to go about it. Do you have any tips? Thanks!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...