Stash interview question

A Leetcode Hard, won't give the specific question