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.
Nice use of the the XOR Operator!
This comment is hidden because it contains spoiler information about the solution
Could you please tell what kill and live methods should do? It's not clear to me.
Modified.
@g964 maybe change the description? You see I got up voted 4 times...
I took one of the test cases and mapped it out (breaking out the numbers I knew from the sample). This is what I determined. The first part of the code is a number of zeroes, in sequence, one less than the number of digits used to represent the original decimal integer in binary, then followed by the digit 1. The second half of the code is the original integer in binary. eg. 4 in binary is 100. This is 3 digits. k-2 gives you 2 Zeroes, then followed by a 1. then followed by the number in binary. thus, 4 => 001100. Hope this helps.
This comment is hidden because it contains spoiler information about the solution