Nested run-length decoder

Write codeMedium25 minGoogle style

Your task

Decode a nested run-length encoded string. The encoding rule is k[encoded] where the bracketed substring is repeated k times; k is a positive integer (possibly multi-digit) and brackets may nest, e.g. '3[a2[bc]]' -> 'abcbcabcbcabcbc'. Plain letters appear as themselves. The input contains only lowercase letters, digits, and the brackets, and is guaranteed valid. Return the fully expanded string.

Examples

decode_string(s: str) -> str
Example 1
Inputdecode_string("3[a2[bc]]")
Output"abcbcabcbcabcbc"