Pergunta de entrevista da empresa RBC

the second question was 2D array matrix analysis