Skip to content

Commit

Permalink
feat: reverse-bits
Browse files Browse the repository at this point in the history
  • Loading branch information
HodaeSsi committed Dec 28, 2024
1 parent c032266 commit e48ec46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reverse-bits/HodaeSsi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 시간복잡도: O(1) (32bit)
class Solution:
def reverseBits(self, n: int) -> int:
return int(bin(n)[2:].zfill(32)[::-1], 2)

0 comments on commit e48ec46

Please sign in to comment.