Each row of matrix is sorted in increasing order, and each column is sorted in increasing order too (but a row does not have to start after the previous one ends). Return True if target is in the matrix.
Example 1
Input:
search_matrix_ii([[1, 4, 7, 11], [2, 5, 8, 12], [3, 6, 9, 16], [10, 13, 14, 17]], 5)
Output:
True
Example 2
Input:
search_matrix_ii([[1, 4, 7, 11], [2, 5, 8, 12], [3, 6, 9, 16], [10, 13, 14, 17]], 15)
Output:
False
0 <= rows, cols, and rows * cols <= 2 * 10**5-10**9 <= matrix[i][j], target <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.