Given an encoded string, return its decoded string where the encoding rule is k[encoded_string] and the encoded_string inside the square brackets is repeated exactly k times. Assume the input string is valid, with well-formed brackets, no extra white spaces, and that digits appear only as repeat numbers.
Click Run to execute sample tests.