Skip to content

Commit 62c4486

Browse files
aQuaaQua
aQua
authored and
aQua
committed
74 finish
1 parent 65e4256 commit 62c4486

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ func searchMatrix(mat [][]int, target int) bool {
1515
return false
1616
}
1717

18+
// 寻找行
1819
r := 0
1920
for r < m && mat[r][0] <= target {
2021
r++
2122
}
2223
r--
2324

25+
// 二分法寻找 target
2426
i, j := 0, n-1
2527
for i <= j {
2628
med := (i + j) / 2

0 commit comments

Comments
 (0)