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 c2224fc commit f548cf4Copy full SHA for f548cf4
โreverse-bits/Seoya0512.pyโ
@@ -0,0 +1,10 @@
1
+'''
2
+ํ์ด์ฌ ๋ด์ฅ ํจ์ ์ฌ์ฉ
3
+- format ํจ์๋ก ์ ์ n์ 32๋นํธ ์ด์ง์๋ก ๋ณํํ ๋ค, ์ญ์๋ก ๋ค์ง์ด ๋ค์ ์ ์๋ก ๋ณํ
4
+
5
+Time Complexity: O(1)
6
+Space Complexity: O(1)
7
8
+class Solution:
9
+ def reverseBits(self, n: int) -> int:
10
+ return int(format(n,'032b')[::-1], 2)
0 commit comments