Pergunta de entrevista da empresa Microsoft

Question on Stack and Dynamic Programming