Skip to content

Commit a6d1afd

Browse files
Question 67
1 parent eade54f commit a6d1afd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

67. Add Binary.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
Input: a = "1010", b = "1011"
1313
Output: "10101"
1414
'''
15+
class Solution:
16+
def addBinary(self, a: str, b: str) -> str:
17+
a = int(a,2)
18+
b = int(b,2)
19+
return str(bin(a+b))[2:]

0 commit comments

Comments
 (0)