Domanda di colloquio di MathWorks

Stack based interview question - from leetcode