RBC Interview Question

the second question was 2D array matrix analysis