反转二进制
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t ans = ;
for (int i = ; i<; ++i,n >>=){
ans = (ans<< )|(n & );
}
return ans;
}
};
2024-04-05 16:28:24
反转二进制
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t ans = ;
for (int i = ; i<; ++i,n >>=){
ans = (ans<< )|(n & );
}
return ans;
}
};