Pergunta de entrevista da empresa JPMorganChase

Stack-based question, and complex array.