Search a matrix sorted in row-major order

Write codeMedium20 minAmazon and Microsoft style

Your task

Given an m x n matrix where each row is sorted ascending left-to-right and the first integer of each row is greater than the last integer of the previous row (i.e. the matrix is fully sorted in row-major order), determine whether a target value exists. Return True or False. Do it in O(log(m*n)). Dimensions up to 100 x 100.

Examples

search_matrix(matrix: list[list[int]], target: int) -> bool
Example 1
Inputsearch_matrix([[1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 60]], 3)
OutputTrue