LeetCode Problem 67. Add Binary || Java Solution Walkthrough

preview_player
Показать описание
LeetCode is a great platform for people who want general coding practice, whether that be for interviews or just wanting to practice their problem solving. I will be taking you through all the steps of finding the optimal solution to each problem on the site following a logical ordering setout by LeetCode themselves.

In this video, we are going over the problem 67. Add Binary and the goal is to parse out the numbers stored inside the strings, and add them together using binary math, returning the new string of the added numbers.

To solve this problem, we must loop through both the of strings adding the current values together, while keeping track of any carry bits for the next addition. At the end of the solution, if there is a carry bit we will have to obviously add it to the most significant bit. Because typically, the least significant bit will come at the end of the string of binary, we will start adding the numbers from the end of both strings, and carry any bits towards the beginning.

~~~ Stay Up To Date With My Social Media ~~~

#unknownkoder #leetcode #algorithms
Рекомендации по теме
Комментарии
Автор

can you create a list of video for videos like this.

phamcongtoan
join shbcf.ru