Leetcode 67: Add Binary

Similar to the previous problem (Leetcode 66 – Plus One). Loop around both input strings from last char to first char. Add each digit and remember carries if needed.

Source code for above solution:
https://gist.github.com/adamkorg/7f7cc67a39fe8198ccdf1974c4eb7961
And below is code for a slightly more concise solution:

This entry was posted in programming and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.