My C# solution accepted


  • 0
    K
    public class Solution {
        public uint reverseBits(uint n) {
            uint total = 2147483648;
            uint result = 0;
            for(uint i = total; i > 0; i/=2){
                if(n >= i){
                    n -= i;
                    result+= total / i;
                }
            }
            return result;
        }
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.