Compressed Template Decoder

A build pipeline stores component labels as compressed templates so its asset manifest stays small. A template is made of lowercase letters and repeated sections written as k[t], where k is a positive integer and t is any template. The section k[t] stands for the expansion of t repeated k times in a row. Sections nest freely: the innermost section always expands first, and its result becomes part of the template that contains it.

Given a valid compressed template s, return the fully expanded string.

Examples
Input: "3[a]"
Output: "aaa"
Hints

Compressed Template Decoder

A build pipeline stores component labels as compressed templates so its asset manifest stays small. A template is made of lowercase letters and repeated sections written as `k[t]`, where `k` is a positive integer and `t` is any template. The section `k[t]` stands for the expansion of `t` repeated `k` times in a row. Sections nest freely: the innermost section always expands first, and its result becomes part of the template that contains it.