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.
Simple and clean solution!
1 remark though: if n is rather big, it's not unthinkable that you hit the double min or max value.
In such cases this code will continue it's calculation and keep outputting infinity.
It might be cheaper for such situations to just fill the remainder of the array, although you could expect a small performance penalty from checking if your last calculated index contains such value.
almost a good guy
It's here. Still not approved, seven years later. :-( And now of course there will be merge conflicts...
Added random tests with Random class. At first I wanted to do RandomNumberGenerator stuff, but not to overcomplify the comparing and to speed up the process, I stopped at Random :)
lol
reraised as issue
Why you changed the name "signature" to "s"?
Isn't something like this literally a bad practice? hahaha
I don't think it must be specified, because math defines this quite unambiguously. To help people not be wrong, it could be specified though.
The original kata did not even test this; some translator invented this on his own. Coffeescript is affected; I can't read the C++ translation enough to know if that is.
I try to interpret as little as possible and look at the original for author's apparent intentions. This has limitations, of course.
Specifying that inputs consist of unique values only would be a good thing actually. ( But may not be correct for existing translations. :/ )
Well, I'm not sure if it will fail in future JS version updates. But
it
block on top doesn't work in the current Python and Ruby versions now, they should be nested underdescribe
. You can stick to that, but if it can't be updated automatically in future, then it will be a part of that gigantic list... ~~Yeaaa, default message also works I guess, but if someone's gonna complain about unclear / confusing default message once the translation is approved, someone's still gonna enter kata editor and make the changes in the end of the day :) ~~
I'm afraid each translation will be the personal interpretation of missing specs of the author of that translation. I'll take my translation down.
In the current framework,
describe
is optional, and in this case just adds clutter.Test failures have a default message. If people want to see the inputs, they can print them.
Fine, I'll do the same for my translation then. Then only the legacy translations and originally kata remain in bad shape. The kata should not keep such edge cases ill-defined.
The original doesn't do that, so if the description is ever expanded to clarify this, it will ( should ) be with unique items only.
This seemed to be something where I could not in good faith invent my own expansions.
It's unspecified ( and there are no comments about it either ), so I took the correct option.
Loading more items...