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.
i didn't understand why we ceil the result , why can't we just floor it
Oh sorry,
next time I will do it :D
Please use spoiler flag next time. Otherwise your post is visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
This should be solve with O(1) and it is not 5kyu consider the complex Math you have to make here.
This comment is hidden because it contains spoiler information about the solution
6666
膜拜大佬。。。
Why is the "Math.ceil()" method used here?
This comment is hidden because it contains spoiler information about the solution
The Math.ceil() function in JavaScript is used to round the number passed as parameter to its nearest integer in Upward direction of rounding i.e towards the greater value.
if r=15,return undefined
I'm just learning, but it seems to me that my last solution has O (1) complexity. Or am I wrong ?
Failed at the edge case:
Test.assertEquals(whoIsNext(["Sheldon", "Leonard", "Penny", "Rajesh", "Howard"], 5), "Howard") // Expected: 'Howard', instead got: undefined
and it will passed if replaced
while (r >= l) { r -= l; l *= 2; }
with
while (r > l) { r -= l; l *= 2; }
how does this work!?!
Loading more items...