Solvarch
DSA ProblemsProgressPlanRoadmapsReviewCheat SheetsCompaniesSystem DesignCS FundamentalsQuestion Bank
Theme
Problems

Add Binary

Easy
bit-manipulationstringmath

Given two binary strings a and b, return their sum as a binary string.

Input

  • Line 1: binary string a
  • Line 2: binary string b

Output: the binary sum.

Example 1
Input:
11
1
Output:
100
Example 2
Input:
1010
1011
Output:
10101

Constraints

  • 1 ≤ lengths ≤ 10^4
  • No leading zeros except the string "0".
Watch a video walkthrough

Run your code against the sample tests, or Submit to run the full suite.