Approach Summary
Start at top-right. If target < current, move left. If target > current, move down. Each step eliminates a row or column.
How to Recognize This Pattern
- Rows and columns sorted independently — start at a corner
- Top-right corner: left decreases, down increases
Complexity Analysis
Time Complexity
O(m + n)
Space Complexity
O(1)
Tags
Array Binary Search Divide and Conquer Matrix