What technique would you use to unravel a string with nested brackets such as “2[a3[b]c]”?

Free for the first 3 answer contributors

Interview question asked to Machine Learning Engineers interviewing at Twitch, Electronic Arts, Apple and others: What technique would you use to unravel a string with nested brackets such as “2[a3[b]c]”?.