We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Xor
You are viewing a single comment's thread. Return to all 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.