栈
Data Structures & Algorithms · 5 notes
- Longest Valid Parentheseshistorical
Given a string containing only '(' and ')', find the length of the longest valid (well-formed and consecutive) parentheses substring.
- Remove Invalid Parentheseshistorical
Given a string s containing parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.
- Generate Parentheseshistorical
The number n represents the number of pairs of parentheses. Design a function that can generate all possible valid combinations of parentheses.
- Valid Parentheseshistorical
Given a string containing only the characters '(', ')', '{', '}', '[' and ']', determine whether the string is a valid parentheses sequence. Parentheses must close in the correct order.