解題說明
C++ 解法
複雜度分析
虛擬碼
1. Initialize empty stack
2. For each char c in s:
a. If c is opening bracket: push c
b. Else (closing bracket):
- If stack empty: return false
- If top doesn't match: return false
- Pop from stack
3. Return stack.empty()