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 are correct, nice catch. That was actually part of prior leftover code I didn't realize wasn't necessary anymore (and actually would mess up some odd cases like l=1, r = 513). Also, since the problem we are given is limits the size of r to <= 1000, we can remove the last bitshift /bitwise or operation and still get valid results for this problem.
(Edit: Code was here, now updated in original comment)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximizing XOR
You are viewing a single comment's thread. Return to all comments →
You are correct, nice catch. That was actually part of prior leftover code I didn't realize wasn't necessary anymore (and actually would mess up some odd cases like l=1, r = 513). Also, since the problem we are given is limits the size of r to <= 1000, we can remove the last bitshift /bitwise or operation and still get valid results for this problem.
(Edit: Code was here, now updated in original comment)