Add Binary
Try to solve the Add Binary problem.
We'll cover the following
1 of 3
2 of 3
3 of 3
Understand the problem#
Let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Add Binary
What is the output if the following strings are given as input?
str1 = “1”
str2 = “1”
“1”
“11”
“101”
“10”
Figure it out!#
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Try it yourself#
Implement your solution in the following coding playground.
The optimal solution to this problem runs in O(max(n, m)) time and takes O(max(n, m)) space.
You might want to review the way we learned to add numbers in elementary school, and apply the same method using binary arithmetic.
Getting Started
Solution: Add Binary