Medium
Given an encoded string s following the rule k[encoded] meaning the bracketed part repeats k times, return the decoded string.
s
k[encoded]
Input: s = "3[a]2[bc]" Output: "aaabcbc"
Input: s = "3[a2[c]]" Output: "accaccacc"