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 passes all tests, but goes into endless recursion when arguments are not integer.
I think we should extend tests like it is done in Ruby version
perfect code
lol man, 7 years ago :D
added to JS, closing as this does not specify languages
Non issue without more elements. Please give some arguments (and of course, language).
Language?
Raised as an issue
Added random test cases. See if your solution still works.
:|
This comment is hidden because it contains spoiler information about the solution
@Mackay: If I had known that there would be only three entries, I would have changed the
for
intoif
and replacedi
by a constant. Both versions aren't that different. However, you could spice it up by using sequences with different lengths (most solutions usingfor
won't be invalidated).That's a good question - I have no idea to be honest! 3 would of been plenty.
I guess people may have used a simpler method to check if the sequence was non-linear with only 3 numbers from the sequence though?
Probably because OP thought that three would be to boring. Three inputs would be enough to show "Non-linear sequence".
By the way, shouldn't you solve the kata first before you discuss it? I guess both questions would have been answered that way. ;)
okay i got it mixed.
Another question: why five inputs ?
Were_Cat, did you read both katas? Arithmetic list is about "mx+b -> sequence", whereas this one is about "sequence -> mx+b". They are more or less inverse of each other.
Loading more items...