Pinterest interview question

some algorithm question using matrix