Stash interview question

On site (virtual) Coding exam. Data structure heavy