Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid. Return all possible results.
30:00
Java
Remove Invalid Parentheses
hard
Topics
Companies
Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid. Return all possible results.
Example 1:
Input: {"s":"()())()"}
Output: ["(())()","()()()"]
Constraints:
1≤s.length≤25
s consists of lowercase English letters and parentheses '(' and ')'.