604. Design Compressed String Iterator

Design an iterator for a compressed string in the format like "L3M2" meaning "LLLMM", or "3[a2[b]]" meaning "abbbabbbabbb". The compressed string uses a simple format: a number followed by a character, e.g., "3a" means "aaa".

Note: This description is for a simpler format. If your input uses run-length encoding with brackets like "3[a]", handle accordingly.

Examples
Input: [["StringIterator","next","next","next","next","next","next","hasNext","next","hasNext"],[["L1e2t1C1o1d1e1"],[],[],[],[],[],[],[],[],[]]]
Output: [null,"L","e","e","t","C","o",true,"d",true]
Hints
Related Problems

604. Design Compressed String Iterator

Design an iterator for a compressed string in the format like "L3M2" meaning "LLLMM", or "3[a2[b]]" meaning "abbbabbbabbb". The compressed string uses a simple format: a number followed by a character, e.g., "3a" means "aaa".