Medium · Strings
Minimum Remove to Make Valid Parentheses
Given a string s of lowercase letters, '(' and ')', remove the minimum number of parentheses so that the result is a valid parentheses string, and return any such result.
Examples
Example 1
{
"s": "a)b(c)d"
}Output: "ab(c)d"
Example 2
{
"s": "lee(t(c)o)"
}Output: "lee(t(c)o)"
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.