An encoded string uses the rule k[text]. It means the text inside the brackets is repeated exactly k times. The number k is always a positive integer.
Given an encoded string s, return the decoded string.
The given string is well formed: it has no extra spaces and its brackets match. The original text has no digits, so digits appear only as repeat counts. You will never see 3a or 2[4].
The test cases are built so that the decoded string is never longer than 10^5 characters.
Examples
Example 1:
Input: s = "2[x]3[yz]"
Output: "xxyzyzyz"
Explanation: "x" twice, then "yz" three times.
Example 2:
Input: s = "2[a2[b]]"
Output: "abbabb"
Explanation: The inside part 2[b] gives "bb". Then "abb" is repeated 2 times.
Example 3:
Input: s = "ab3[c]d"
Output: "abcccd"
Explanation: "ab" and "d" are plain text. 3[c] gives "ccc".