BREAKING DESCRIPTION CHANGE: changed spec to INCLUDE 2**31-1, was previously maximum 2**31-2 which is WEIRD and probably unintentional
added missing fixed test for 0 as per spec, added 2**31-1 as per NEW spec
added 1 10 100 1000 and 9 99 999 .. in case someone's got an off-by-one somehow
picks 10 of each possible length and rolls within that range instead of just randrange(2**31) which is going to pick the same number of digits 90% of the time
(I've got the same thing but in haskell as well once this description-changing fork has made it in)
fix indentation in the initial code and add a space between // and the rest of the comment
please use the test logic in my python fork above instead - because the one you're using and that several other languages are using is poor as it picks the same number of digit 90% of the time. (and the range of numbers you picked or copied is also weird)
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/225.
Please join the discussion to help us identify duplicate kata and retire them.
Haskell translation
Python, JavaScript, Haskell updated
Python changes
2**31-1
, was previously maximum2**31-2
which is WEIRD and probably unintentional2**31-1
as per NEW specrandrange(2**31)
which is going to pick the same number of digits 90% of the time(I've got the same thing but in haskell as well once this description-changing fork has made it in)
Idk java but, thoughts:
Java traduction
updated
merged
Your code only cycles from 1 to 9 (both inclusive) and does not take into account the individual digits of
numbers > 99
I've tested your solution and it passed the tests, closing
python new test framework is required. updated in this fork
Accomplished in c++.
Fixed tests in C# is commented out for no reason
Nice kata!
Approved
Loading more items...