1021. Remove Outermost Parentheses
Description
**Input:** s = "(()())(())"
**Output:** "()()()"
**Explanation:**
The input string is "(()())(())", with primitive decomposition "(()())" + "(())".
After removing outer parentheses of each part, this is "()()" + "()" = "()()()".**Input:** s = "(()())(())(()(()))"
**Output:** "()()()()(())"
**Explanation:**
The input string is "(()())(())(()(()))", with primitive decomposition "(()())" + "(())" + "(()(()))".
After removing outer parentheses of each part, this is "()()" + "()" + "()(())" = "()()()()(())".ac
Last updated