class Solution(object):
def addBinary(self, a, b):
"""
:type a: str
:type b: str
:rtype: str
"""
resA=int(a,base=2)
resB=int(b,base=2)
sumAB=bin(resA+resB)
return sumAB[2:]
相关文章
- 01-05【LeetCode】297. Serialize and Deserialize Binary Tree 解题报告(Python)
- 01-05【LeetCode】109. Convert Sorted List to Binary Search Tree 解题报告(Python)
- 01-05[LeetCode]题解(python):111 Minimum Depth of Binary Tree
- 01-05【leetcode❤python】110. Balanced Binary Tree
- 01-05[LeetCode&Python] Problem 606. Construct String from Binary Tree
- 01-05【LeetCode】107. Binary Tree Level Order Traversal II 解题报告 (Python&C++)
- 01-05【LeetCode】331. Verify Preorder Serialization of a Binary Tree 解题报告(Python)
- 01-05Leetcode 104 Maximum Depth of Binary Tree python
- 01-05[LeetCode]题解(python):094 Binary Tree Inorder Traversal
- 01-05leetcode Minimum Depth of Binary Tree python