LeetCode 1249. Minimum Remove to Make Valid Parentheses
stack
Input: s = "lee(t(c)o)de)"
Output: "lee(t(c)o)de"
Explanation: "lee(t(co)de)" , "lee(t(c)ode)" would also be accepted.Input: s = "a)b(c)d"
Output: "ab(c)d"Input: s = "))(("
Output: ""
Explanation: An empty string is also valid.Input: s = "(a(b(c)d)"
Output: "a(b(c)d)"Solution
PreviousLeetCode 973. K Closest Points to OriginNextLeetCode 1428. Leftmost Column with at Least a One
Last updated