Correct bracket sequence stack python [duplicate]
📁 Conditions, Advanced Python Topics, question
Hello everyone, who can help with implementing a check for correct bracket sequence using a stack in Python. I know the essence of the check and implemented it simply with conditions, but I can't figure it out with a stack, please help.
def brackets_check(s):meetings = 0for c in s: if c == '(': meetings += 1 elif c == ')': meetings -=