Given an m x n matrix of integers where:
And a target integer, return true if target exists in the matrix, or false otherwise.
You must write a solution with O(log(m * n)) time complexity.
matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3truematrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13falsematrix = [[1]], target = 1true1 <= m, n <= 100-10^4 <= matrix[i][j], target <= 10^4Each row is sorted in ascending orderThe first element of each row is greater than the last element of the previous rowRun your code to see results
Use Cmd+Enter to run