Zillow Interview Question

It involved traversing a 2d matrix in a specific way