finish 67

This commit is contained in:
sangge 2024-03-12 15:13:12 +08:00
parent ca45976f26
commit 89e23e7654

9
leetcode/67.py Normal file
View File

@ -0,0 +1,9 @@
# Given two binary strings a and b, return their sum as a binary string.
class Solution:
def addBinary(self, a: str, b: str) -> str:
int_a = int("0b" + a, 2)
int_b = int("0b" + b, 2)
int_c = int_a + int_b
return bin(int_c)[2:]