Question d’entretien chez MathWorks

Stack based interview question - from leetcode