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
Thanks for the answer ctttttttttt.
I have noticed a pattern on codewars that anytime some basic math can solve a problem an overly complicated brute force method tends to win out over the simple and faster mathematical solution.
If you have time I'd love to hear the explanation of how this works.
Intersting. Why does 0 - i produce 0 when i == 0 but -i produces -0?
Solutions like this on codewars are starting to make me kinda like Javascript.
This solution should be voted as the best practice. I feel dumb my first solution used a loop.
What do you mean out of curiousity? Doesn't returning break from the function?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution