Interview problems never say "use a stack". You have to recognise the shape of the problem. The good news is that stack problems give themselves away with a handful of signals.
[ and ] in an encoded string — anything where the latest opening must close first. (Valid Parentheses, Decode String)Free account
Sign up to read the rest of this lesson: 4 more sections, 2 drawings, a dry-run simulator and code in JavaScript, Python, Java and C++.
Still to come