Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- uint32_t reverseBits(uint32_t n) {
- uint32_t k=0;
- uint32_t a=1;
- for(int i=0;i<31;i++){
- if(n&a==0)
- k=k<<1;
- else
- {
- k=k<<1;
- k=k|1;
- }
- n=n>>1;
- }
- return k;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement