You are viewing a single comment's thread. Return to all comments →
Is there any other solution with less time complexity.
static int maxXor(int l, int r) { int xor = l ^ r; int a = 0; while(Math.pow(2,a)< xor)a++; return (int)Math.pow(2,a) - 1 ; }
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 →
Is there any other solution with less time complexity.