Nested String Decompression
Asked at Google
Reported by the problem's creator, not verified
A compressed string is built from lowercase letters and groups written (text){k}. A group stands for text repeated k times, and text may itself contain more groups.
Examples
Example 1
Input: s =
a(abc){3}Output:
aabcabcabcExplanation: The group
(abc)repeats three times after the leadinga.Example 2
Input: s =
a(b(c){2}){3}dOutput:
abccbccbccdExplanation: The inner group
(c){2}makescc, so the outer group expands tobccrepeated three times betweenaandd.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.