135101113233034target=13Found?O(log(mร—n)) time
mediumGrind 75

Search a 2D Matrix

Binary search is the tool here, but the real test is whether your invariant stays crisp. Interviewers love it because it reveals your boundary precision and your edge-case discipline. Interviewers care more about airtight boundaries than speed here.

Arrays & HashingBinary Search
๐Ÿ‘ฉโ€๐Ÿซ
๐Ÿ‘จโ€๐Ÿ’ผ

Meet Allison & Tim

Your AI coaches

Practice coding interviews out loud with real-time voice coaching. Your code actually runs.

Free ยท No sign up ยท Early access
1Search Sorted 2D Matrixmedium
Based onLeetCode

Get this problem sent to your inbox