Microsoft interview question

algorithm questions base on stack