166. Decode a Nested String
A string is encoded as k[content], meaning the content repeats k times.
Encodings may be nested, so 2[a3[b]] decodes to abbbabbb.
Read one encoded line and print the decoded string.
The input is always valid, k is at least 1, and the decoded result is at most 100000
characters.
Constraints - The line has between 1 and 10000 characters. - Lowercase letters, digits, `[` and `]` only. - The decoded result fits in 100000 characters.
Input
A single line containing lowercase letters, digits, [ and ]. The encoding is always valid.
Output
Print the fully decoded string on one line, with no quotes around it, no separators between the repeated pieces and no trailing spaces.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.