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 first saw this way to save the options on web form(many many "yes" and "no" options on admin form) was the VBB(vBulletin BBS in PHP https://www.vbulletin.com/), that's the way how they compress and save various options in just one int columen in mysql table.
10101010111 is same as many "yes" "no" checbox on web forms.
What an interesting approach and formula used
What an elegant solution! I tried to simplify mine without much success.
I think my solution is worst of all lol
I'm very new to coding in general and understanding this solution took me quite a bit (mine was a totally different and overly complicated approach) but now I am absolutely amazed by the beauty of it
Interesting, what were the times?
i'm new on timing code but this one seems to be the fastest
thoughtful! just could use the power of python >> built-in functions
Huge thanks for those few who came up with this (double dabble) algorithm. Today I learned something new.
I think the best way to get your head around it is to look at it as a reverse of decimal to binary process.
Decimal to binary (https://www.cuemath.com/numbers/decimal-to-binary/):
To convert 13 to binary you need to:
So if we get remainders from bottom to top we end up with 1101, which is a binary representation of 13
If we use double dabble method, then we just put the above process in reverse.
One note: when using double dabble method we always start wit 0 * 2 (as there is no previous digit to the left-most digit of the binary number)
Hope this helps...
there are other katas for this. this one is less trivial as it demands more than just calling a library function
LEGIT.
When solving this problem, it was pretty much engraved in my mind that I had to start from the 2^0 digit and work my way up, so the first thing I did was to invert the array. I'm pleasantly surprised and impressed to find out that it's very well possible (and elegant) to start at the other end, without even knowing which digit it is, at that!
Wow, beautiful solution
This comment is hidden because it contains spoiler information about the solution
I based this off this solution for "Twice Linear": https://www.codewars.com/kata/reviews/5672692ee3659e3f8a00000c/groups/584704443b2dea171f000178
Loading more items...