JPMorganChase interview question

Stack-based question, and complex array.