You are viewing a single comment's thread. Return to all comments →
Better to replace
bracket != s.peek()
with
bracket != s.pop()
so you dont need to .pop() it later
Stacks: Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
Better to replace
with
so you dont need to .pop() it later