Pregunta de entrevista de Google

dp question involving matrix was asked