https://programmers.co.kr/learn/courses/30/lessons/12973
def solution(s):
while(s!=""):
for i in range(len(s)-1):
if(s[i]==s[i+1]):
if(i+1 == len(s)-1):
s=s[:i]
else:
s=s[:i]+s[i+2:]
break
else:
return 0
return 1
def solution(s):
stack =[]
for i in s:
if(stack == [] or stack[-1]!=i):
stack.append(i)
else:
stack.pop()
if(stack == []):
return 1
else:
return 0