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.
If you figure out whether to add/divide based on powers of -1, aren't you wasting a lot of compute power when i gets large? Wouldn't it be more efficient to simply store this in a flag?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Can someone explain this solution for me? I dont get that bitwise stuff
While short and mostly correct, this gives a false positive when n = 0
sign("") -> 0
Is it correct?
PS. Math.sign() have the same result. I think it's best solution.