Ad
  • Custom User Avatar

    Nice use of the the XOR Operator!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Could you please tell what kill and live methods should do? It's not clear to me.

  • Default User Avatar

    Modified.

  • Custom User Avatar

    @g964 maybe change the description? You see I got up voted 4 times...

  • Default User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution