Leetcode 74. Search a 2D Matrix
Given an m×n matrix where each row is sorted and the first element of each row is greater than the last of the previous row, determine whether a target exists in the matrix. Exploit the matrix's global sorted order to perform an O(log(m*n)) binary search (treating it as a flattened 1D sorted array).
Asked at:
Amazon
Meta
M
Motive
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early June, 2026
Amazon
Senior
Late May, 2025
Meta
Senior
Late April, 2025
M
Motive
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.