LinkedIn interview question

Technical round - Max stack leetcode question