Easy python solution using push and pop


#1

class Solution:
# @param A : string
# @param B : string
# @return a strings
def addBinary(self, A, B):
a=list(A)
b=list(B)
cnt=0
res=’’
while a or b or cnt:
if a:
cnt+=int(a.pop())
if b:
cnt+=int(b.pop())
res+=str(cnt%2)
cnt//=2
return res[::-1]