//Similar to binary search in 1D array, here the search space is from (0,0) to (m-1,n-1) ...
sequentially. And given the conditions, the 1D array will also be sorted. So, binary search can be used to solve this problem with indexes (row, col) rather than one.