Problem 240: Search a 2D Matrix II

https://leetcode.com/problems/search-a-2d-matrix-ii/

思路

首先要想清楚出发点。为什么我们从左下角一路出发?

因为这个点十分关键,他起到了四分法的作用。相当于他在角落里,进可攻退可守。比他大,只能往右走,比他小,只能往左走。

易错点

  1. 找好定位点

Last updated

Was this helpful?