Archive
Try to Solve
Remove unbalanced parentheses in a given expression.
Example
Input
((abc)((de))
Output
((abc)(de))
Input
(a(b)))(cd)
Output
(a(b))(cd)
Input
(a(b)))(c(d)
Output
(a(b))(cd)
Input
(ab))(c(d))))
Output
(ab)(c(d))