Reverse Bits Solutions in C++Number 190Difficulty EasyAcceptance 39.9%Link LeetCodeOther languages GoSolutionsC++ solution by haoel/leetcode// Source : https://leetcode.com/problems/reverse-bits/// Author : Hao Chen// Date : 2015-03-30 class Solution {public: uint32_t reverseBits(uint32_t n) { uint32_t ret=0; for(int i=0; i<32; i++) { ret = (ret*2) + (n & 0x1); n /=2 ; } return ret; }};// Source : https://leetcode.com/problems/reverse-bits/ // Author : Hao Chen // Date : 2015-03-30 class Solution { public: uint32_t reverseBits(uint32_t n) { uint32_t ret=0; for(int i=0; i<32; i++) { ret = (ret*2) + (n & 0x1); n /=2 ; } return ret; } };