【leetcode❤python】 67. Add Binary

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:]

上一篇:LeetCode刷题笔录Add Binary


下一篇:python3.4.3将汉字转换为大写拼音首字母