Exploring a possible solution
Now that we understand how time-consuming it is to scan a large 2D table cell by cell, we need a smarter way to search for a score like 85. The key to improving performance lies in understanding how the table is structured.
Each row is sorted from left to right, and every row starts with a score that is greater than the last score of the previous row. This means the entire table behaves like a single, continuous, increasing sequence, just laid out in two dimensions.
2D binary search
Liking the course? Check our discounted plans to continue learning.