Search
⌘K

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:

Meta

M

Motive


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late May, 2025

Meta

Senior

Late April, 2025

M

Motive

Mid-level

Early April, 2025

Meta

Senior

Comments

Your account is free and you can post anonymously if you choose.