Add Binary
Problem
Given two binary strings, return their sum (also a binary string).
Example
a = 11
, b = 1
.
Return 100
.
Solution
Reverse the string so they are aligned; remember the carry
for each digit.
Given two binary strings, return their sum (also a binary string).
a = 11
, b = 1
.
Return 100
.
Reverse the string so they are aligned; remember the carry
for each digit.