Open minimanimoh opened 3 years ago
^ my code
def equation_checker(equation):
stack = Stack()
for char in equation:
if char == "(":
stack.push(char)
elif char == ")":
if stack.pop() == None:
return False
if stack.size() == 0:
return True
else:
return False
answer