Meta Interview Question

Leetcode matrix problem, pretty hard