To minimize payload sizes over constrained networks, mobile APIs sometimes compress redundant JSON data structures. A payload encoded as "3[msg]" needs to be expanded into "msgmsgmsg". Nested compression like "2[b3[a]]" requires evaluating structures from the inside out.
Given an encoded string, return its decoded string. The encoding rule is: `k[encoded_string]`, where the encoded_string inside the square brackets is being repeated exactly `k` times. Note that `k` is guaranteed to be a positive integer.
βΆ Run Code to test against examples Β· Submit to judge all 5 test cases