Search in row and column wise sorted matrix