CodeMosa
Master LeetCode Patterns
All Patterns
Collections
Sign In
Back
Stack Simulation
Question 1 of 12
8% Complete
Easy
To check if parentheses are balanced, what's the stack-based approach?
A
Push opening brackets, pop and match when encountering closing brackets
B
Count opening and closing brackets
C
Use two pointers from both ends
D
Sort the brackets first
Need a hint?
Think about matching pairs