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
Something broke in random Ruby tests. Some tests say that I have wrong answers, but when I check them through puts, it gives the correct values, those - my solution returns the correct answers, but the tests perceive them with different values
For example
def champernowe_digit(n)
...
p res #=> 6
res
end
#=> Random digit tested: 8563414405108046 - Expected: 6, instead got: 5
Can one get it to run in constant time?
Everybody is doing it in
O(log n)
, which is plenty good enough really.