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 feel exited every time I'm able to look at other people solutions on here, sometimes I spend hours testing other people code and mession around with it, such a grate opportunity.
I felt the exact same way! After submitting my solution (which had taken several hours) triumphantly, I stared in disbelief at the one-liner at the top. And as well as scrolling through all of the other simpler solutions.
Hah, every time I solve a kata I feel totally embarrassed when looking at the other solutions, especially in this case :) Man, I suck at these kind of problems...
Yeah, U are right
This code may work incorrectlly on some inputs.
For example:
This happens because bitwise operations convert it arguments to 32-bit integers. In this example binary representation of number in str is more than 32 bit, therefore it is truncated.
So you should use this code only, if you are sure, that all numbers that you pass in your function fit 32-bit.
You're welcome.
Nice kata, I enjoyed, thank you :) Please more "Design Pattern" katas!