1
class Solution {
2
public:
3
uint32_t reverseBits(uint32_t n) {
4
int ans = 0;
5
int i = 1;
6
int bit = 0;
7
while (i < 32) {
8
bit = n & 1;
9
ans = ans | bit;
10
n = n >> 1;
11
ans = ans << 1;
12
i++;
13
}
14
if (i == 32) {
15
bit = n & 1;
16
ans = ans | bit;
17
}
18
return ans;
19
}
20
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0