Google Interview Question

Matrix and algorithms manipulation question