给出两个用字符串表示的二进制数,返回他们的和(也用字符串表示) 例如: a ="11" b ="1" 返回"100".
示例1
输入
"11","1"
输出
"100"
加载中...
import java.util.*; public class Solution { /** * * @param a string字符串 * @param b string字符串 * @return string字符串 */ public String addBinary (String a, String b) { // write code here } }
class Solution { public: /** * * @param a string字符串 * @param b string字符串 * @return string字符串 */ string addBinary(string a, string b) { // write code here } };
# # # @param a string字符串 # @param b string字符串 # @return string字符串 # class Solution: def addBinary(self , a , b ): # write code here
/** * * @param a string字符串 * @param b string字符串 * @return string字符串 */ function addBinary( a , b ) { // write code here } module.exports = { addBinary : addBinary };
# # # @param a string字符串 # @param b string字符串 # @return string字符串 # class Solution: def addBinary(self , a , b ): # write code here
package main /** * * @param a string字符串 * @param b string字符串 * @return string字符串 */ func addBinary( a string , b string ) string { // write code here }
"11","1"
"100"