Back
Add Binary
Given two binary strings a and b, return their sum as a binary string.
Java
Description
Solution
My Code
Add Binary
Given two binary strings a and b, return their sum as a binary string.
Example 1:
Input:
{"a":"11","b":"1"}
Output:
100
Viz
Tests
Run
Input
"11" + "1"
"1010" + "1011"
Custom
{"a":"11","b":"1"}
arr =
{"a":"11","b":"1"}
Add binary strings
s
L
R
1
0
1
1
t
1
0
Carry:
0
Variables
Variable
Value
a
11
b
1
Depth
Function Call
Stack empty
0/4
0.5x
1x
2x
4x