Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: