63. Add Binary

EasyMath

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

Examples

Input: 1010 1011

Output: 10101

Explanation: 10 + 11 = 21, which is 10101 in binary.

Constraints

  • 1 <= a.length, b.length <= 10^4
  • a and b consist only of '0' or '1' characters.
  • Each string does not contain leading zeros except for the zero itself.
Loading...

Run checks all cases above. Submit evaluates all test cases.