标签:for ever app pop += parent tps tco ems
1 class Solution: 2 def reverseParentheses(self, s: str) -> str: 3 stack = [‘‘] 4 for c in s: 5 if c == ‘(‘: 6 stack.append(‘‘) 7 elif c == ‘)‘: 8 add = stack.pop()[::-1] 9 stack[-1] += add 10 else: 11 stack[-1] += c 12 return stack.pop()
标签:for ever app pop += parent tps tco ems
原文地址:https://www.cnblogs.com/asenyang/p/11524940.html