Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Commit a31e33c

Browse files
authored
Merge pull request #570 from AditSoni/master
solves #569 closes #569
2 parents 044b1cc + af4c6ee commit a31e33c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

LeetCode/0190_Reverse_bits.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
def reverseBits(self, n: int) -> int:
3+
4+
s='{0:032b}'.format(n)[::-1]
5+
return int(s,2)

LeetCode/0191_Number_of_1_bits.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Solution:
2+
def hammingWeight(self, n: int) -> int:
3+
4+
return '{0:b}'.format(n).count('1')

0 commit comments

Comments
 (0)