Комментарии:
return (1 << int(log2(l ^ r) + 1)) - 1; use this and explain how its working!
ОтветитьBad Explanation Brother.............
Ответитьcorrect answer but incorrect logic
ОтветитьWhat if my L=10 and R=12 ? The answer should be 6 in that case, isn't it ? Your code still gives 7. Is that correct ?
ОтветитьNeed to shift your window to right ... when you give example of numbers 10 to 15 For all the number, first bit is not visible in the screen. And as this problem is specific to bits/1's/0's this is making difficult to follow
Ответить