Domanda di colloquio di Google

problem that involved matrix manipulation