Reversing an n-bit number in O(log n)
medium.com