k times in a row is written as k[fragment]. A fragment may itself contain such groups, nested to any depth.
Given the compressed string code, return the original string.
The notation is always well-formed: brackets are balanced, every [ is preceded by a repeat count, and there are no other digits in the string (the letters themselves never include digits).code="2[x3[y]]z" → 'xyyyxyyyz'
The inner group 3[y] gives yyy, the whole 2[...] repeats xyyy twice, and z is appended at the end.
code="ab4[c]" → 'abcccc'
Letters outside brackets stay as they are, and c is repeated 4 times.
code="3[2[o]k]" → 'ookookook'
code consists of lowercase English letters, digits and the brackets [ ]code="2[x3[y]]z"
'xyyyxyyyz'
Run checks the first 3 tests in your browser. Submit checks all 128 tests on the server, hidden ones included.