LC 74
Search a 2D Matrix
Medium · LC 1–100
Candidate solution routes
Primary
FreeBinary Search on a Sorted Domain
Invariant: At loop entry, an existing target lies inside closed interval [lo,hi]; every outside index has been disproved by sorted comparisons.
candidate confidence: 0.537 · metadata_only
Alternate 1
FreeBinary-Search Boundary / First True
Invariant: The first True always lies in [lo,hi]; indexes left of lo are proven False, while hi remains a feasible candidate.
candidate confidence: 0.476 · metadata_only
Alternate 2
FreeBinary Search on the Answer
Invariant: The closed interval [lo,hi] contains the optimum boundary; for first True, values left of lo are excluded and hi remains a feasible candidate.
candidate confidence: 0.452 · metadata_only
How to use this page
Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.