Use a stack to expand a run-length encoded string with nested patterns.
Constraints
Example
>>> decode_string('3[a]2[bc]')
'aaabcbc'
>>> decode_string('3[a2[c]]')
'accaccacc'
>>> decode_string('2[abc]3[cd]ef')
'abcabccdcdcdef'
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints