Pregunta de entrevista de Amazon

Matrix Question with a list within a list