Maximum Xor

  • + 0 comments

    You can shave 2 levels off your tree given that the maximum value as stated in the problem is 10^9 which is 111011100110101100101000000000. That's only 30 bits.

    In other words, you should be able to use "{:030b}" and get a slightly faster answer.