Tap here to switch tabs
Problem
Ask
Submissions

Problem: Add Binary

easy
15 min
Understand how to add two binary strings and return the sum as a binary string. Practice implementing the solution efficiently with time and space complexity of O(max(n, m)) while developing problem-solving skills relevant to coding interviews.

Statement

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

Constraints:

  • 11\leq str1.length , str2.length \leq 500500

  • str1 and str2 consist of 0 or 1 characters only.

  • Any string must not contain leading zeros except the string representing the binary form of 00.

Tap here to switch tabs
Problem
Ask
Submissions

Problem: Add Binary

easy
15 min
Understand how to add two binary strings and return the sum as a binary string. Practice implementing the solution efficiently with time and space complexity of O(max(n, m)) while developing problem-solving skills relevant to coding interviews.

Statement

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

Constraints:

  • 11\leq str1.length , str2.length \leq 500500

  • str1 and str2 consist of 0 or 1 characters only.

  • Any string must not contain leading zeros except the string representing the binary form of 00.