Loading problem…
You are implementing a compact template decoder. Encoded strings use the form k[encoded], where the content inside brackets should be repeated k times. Encodings may be nested.
Given an encoded string s, return its decoded form.