Google interview question

Working with matrices