LeetCode 67, Easy. Topics: Math, String, Bit Manipulation, Simulation. View on LeetCode.
Generate this problem as a practice environment: tested reference solution, 11 parametrized pytest cases, and a playground notebook:
Problem
Given two binary strings a and b, return their sum as a binary string.
Examples
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.
Solution
Reference implementation from solution.py on GitHub, full suite in test_solution.py:
Complexity
Grind 75, Grind, NeetCode 250, NeetCode All. Last modified on September 7, 2026