Pergunta de entrevista da empresa PNC Financial Services Group

Technical question, essentially boiled down to the use of a simple For Loop