Given a string s consisting of lowercase English letters and parentheses, repeatedly reverse the characters inside each matching pair of parentheses, starting from the innermost pair and working outward. After all reversals are applied, return the resulting string with all parentheses removed.
Note: The parentheses in
sare guaranteed to be balanced.
Constraints:
s.length
s contains only lowercase English letters and parentheses
All parentheses in s are balanced
Given a string s consisting of lowercase English letters and parentheses, repeatedly reverse the characters inside each matching pair of parentheses, starting from the innermost pair and working outward. After all reversals are applied, return the resulting string with all parentheses removed.
Note: The parentheses in
sare guaranteed to be balanced.
Constraints:
s.length
s contains only lowercase English letters and parentheses
All parentheses in s are balanced