Google interview question

Recursive Matrix question and a two pointer question