[LeetCode/Python] 67. Add Binary
·
Algorithm/LeetCode
문제 링크: https://leetcode.com/problems/add-binary/description/?envType=study-plan-v2&envId=top-interview-150 숫자로 쉽게 치환해서 패키지를 써서 이진법 덧셈을 할 생각이었는데, string 자체로 풀어보고 싶다고 생각했다. [내 풀이]class Solution: def addBinary(self, a: str, b: str) -> str: # without converting string to int carry = 0 i, j = len(a) - 1, len(b) - 1 result = [] while i >= 0 or j >= 0 or carry: ..