Meta interview question

They asked a 2D Matrix related question