Pregunta de entrevista de Mobility Quest

Matrix problem which is much confusing