class Solution:
    def reversedBits(self, X):
        # code here 
        s=""
        while(X>0):
            s+=str(X%2)
            X//=2
        res=0
        c=31
        for i in s:
            if i=="1":
                res+=2**c
            c-=1
        return res
9e091c62c0f36363cda888881f40f41751dc47e5
<mask token>

class Solution:
    <mask token>

class Solution:

    def reversedBits(self, X):
        s = ''
        while X > 0:
            s += str(X % 2)
            X //= 2
        res = 0
        c = 31
        for i in s:
            if i == '1':
                res += 2 ** c
            c -= 1
        return res

class Solution:
    def reversedBits(self, X):
        # code here 
        s=""
        while(X>0):
            s+=str(X%2)
            X//=2
        res=0
        c=31
        for i in s:
            if i=="1":
                res+=2**c
            c-=1
        return res