RBC interview question

the second question was 2D array matrix analysis