Timeline
Timeline
2026-03-21
init
Dynamic Programming, Stack
Problem:
- Simulate with a stack, mark all positions of unmatched parentheses as 1,
- For example:
()(()the mark is [0, 0, 1, 0, 0] - Another example:
)()((())the mark is [1, 0, 0, 1, 0, 0, 0, 0]
- For example:
- After such processing, this problem becomesfinding the length of the longest consecutive zeros
1 |
|
