Pergunta de entrevista da empresa Upper Lake Processing Services

coding question based on for loop