zoukankan      html  css  js  c++  java
  • 14.leetcode67_add_binary

    1.题目描述

    Given two binary strings, return their sum (also a binary string).

    做二进制加法

    2.题目分析

    这个题偷懒了,直接进行了进制转换

    3.解题思路

     1 class Solution(object):
     2     def addBinary(self, a, b):
     3         """
     4         :type a: str
     5         :type b: str
     6         :rtype: str
     7         """
     8         a1=int(a,2)
     9         b1=int(b,2)
    10         s=a1+b1
    11         s='{0:b}'.format(s)
    12         return s
  • 相关阅读:
    【POJ
    【POJ
    【POJ
    【POJ
    【POJ
    【POJ
    【POJ
    【POJ
    NAT
    OSPF与ACL综合实验
  • 原文地址:https://www.cnblogs.com/19991201xiao/p/8424676.html
Copyright © 2011-2022 走看看