We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aedf76f commit c784f39Copy full SHA for c784f39
reverse-bits/hu6r1s.py
@@ -0,0 +1,6 @@
1
+class Solution:
2
+ """
3
+ binary로 변환 후 zfill로 32자리를 맞춰주고 reverse시킨다.
4
5
+ def reverseBits(self, n: int) -> int:
6
+ return int(bin(n)[2:].zfill(32)[::-1], 2)
0 commit comments