Algorithm · Apple · Easy
You receive an m x n integer grid named matrix that satisfies both of these conditions: Values within every row appear in non-decreasing order. The opening value in any row is strictly larger than the ending value of the row directly above it. For an integer target, return true when the target occurs in matrix; return false when it does not. Your algorithm must run in O(log(m * n)) time. Examples Example 1: Input: matrix = [[2,4,8],[12,15,19],[24,31,40]], target = 15 Output:…
Checking your access…