logo
Problems

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.

Online Judge