AddBinary 썸네일형 리스트형 AddBinary Problem Given two binary strings a and b, return their sum as a binary string. 스트링으로 구성된 바이너리 a,b가 input으로 들어오면 두 바이너리의 합을 string값으로 돌려주는 문제 “11”, “1” 이 들어오면 바이너리의 합인 “100” 을 출력하라! Solution class Solution: def add_bianry(self, a: str, b: str) -> str: a_list = list(a) b_list = list(b) carry = 0 result = '' while a_list or b_list or carry: if a_list: carry = carry + int(a_list.pop()) if b_list: ca.. 더보기 이전 1 다음