1
class Solution:
2
def removeOuterParentheses(self, s: str) -> str:
3
c = 0
4
res = ""
5
for i in s:
6
if i == ")" and c == 1:
7
c = c - 1
8
elif i == "(" and c == 0:
9
c = c + 1
10
elif i == "(":
11
res = res + "("
12
c = c + 1
13
elif i == ")":
14
res = res + ")"
15
c = c - 1
16
return res

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0