Reverse Bits
<-E 190> Reverse Bits
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t ret = 0;
for(int i = 31; i >= 0; i--) {
ret |= ((1 & n) << i);
n = n >> 1;
}
return ret;
}
};