Baseline Strings · Easy O(n) · O(n)
A message broker chops a transmission stream into primitive frames, and every frame is wrapped in exactly one outer pair of framing markers. Before payloads are forwarded downstream, that outermost wrapper must be peeled off each frame so only the inner content is shipped. Given the raw marker stream, emit it with every frame's outermost pair removed.
Input: A string s consisting of '(' and ')' characters that forms a valid, balanced parentheses sequence.
Output: The string s with the outermost parentheses of every primitive component deleted; content that sat deeper inside is preserved in order.
2 <= s.length <= 10^5s is a valid (balanced) parentheses stringInput: {"s":"(()())(())"}
Output: "()()()"
Two primitive frames sit back to back; peeling each outer wrapper leaves their inner contents concatenated.
Input: {"s":"(()())(())(()(()))"}
Output: "()()()()(())"
The final frame carries a nested inner pair that survives, while only its outermost wrapper is stripped.