Pregunta de entrevista de JPMorganChase

Stack-based question, and complex array.