Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Brackets by Albert.Nowak
def match(n,m):
if n=="{" and m=="}":
return True;
if n=="(" and m==")":
return True;
if n=="[" and m=="]":
return True;
return False
def checkio(ex):
stos=[]
for z in ex:
if z in ("{","(","["):
stos.append(z)
if z in ("}",")","]"):
if len(stos)==0:
return False
if match(stos[len(stos)-1],z):
stos.pop()
else:
return False
if len(stos)==0:
return True
else:
return False
# Stos i kolejka
Jan. 17, 2016