Pergunta de entrevista da empresa IMC Trading

First is a hard leetcode Q, the second one is implementing a stack.