class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t res = 0;
int i = 0;
while(i<32)
{
res<<=1;
res |= (n&1);
n>>=1;
++i;
}
return res;
}
};
190 Reverse Bits
最新推荐文章于 2020-04-06 16:18:28 发布