BlackRock interview question

Find the target value in 2D grid.