Google Interview Question

Leet code hard question on 2 dimensional arrays