Microsoft interview question

Solve Min Stack leetcode question