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.
same, but mine solution includes default case
The reason it's used here is because
+
has a higher precedence than&
, but+
has a lower precedence than%
, so it saves a pair of parens.That's pretty rad.
Bitwise magic.
Apparently someValue & 1 gives the same result as someValue % 2
This comment is hidden because it contains spoiler information about the solution
I am not able to get the approach. Can somebody guide me?