Given an encoded string
s. Return its decoded string. Rule: k[encoded_string] means that encoded_string is repeated k times.Example 1
Input: s = "3[a]2[bc]"
Output: aaabcbc
Explanation: `a` is repeated 3 times and `bc` is repeated 2 times.
Output: aaabcbc
Explanation: `a` is repeated 3 times and `bc` is repeated 2 times.
Example 2
Input: s = "3[a2[c]]"
Output: accaccacc
Explanation: Inside: `2[c] -> cc`, then `a + cc -> acc`, and the whole thing is repeated 3 times.
Output: accaccacc
Explanation: Inside: `2[c] -> cc`, then `a + cc -> acc`, and the whole thing is repeated 3 times.
Example 3
Input: s = "2[abc]3[cd]ef"
Output: abcabccdcdcdef
Explanation: `abc` is repeated 2 times, `cd` 3 times, then `ef` is appended.
Output: abcabccdcdcdef
Explanation: `abc` is repeated 2 times, `cd` 3 times, then `ef` is appended.