Google interview question

Matrix question and something with loops