Decode an encoded string where patterns like "3[ab]" expand to "ababab", supporting nested patterns.
Asked in frontend interviews at Google, Amazon, Microsoft and 1 more