Skip to content

Commit

Permalink
add links
Browse files Browse the repository at this point in the history
  • Loading branch information
EndlessCheng committed Aug 8, 2023
1 parent 55f90ff commit ea5bc78
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions copypasta/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,13 +1068,15 @@ func _(min, max func(int, int) int) {
- [2146. 价格范围内最高排名的 K 样物品](https://leetcode.cn/problems/k-highest-ranked-items-within-a-price-range/)
- [2258. 逃离火灾](https://leetcode.cn/problems/escape-the-spreading-fire/)
- [2577. 在网格图中访问一个格子的最少时间](https://leetcode.cn/problems/minimum-time-to-visit-a-cell-in-a-grid/)
- [2684. 矩阵中移动的最大次数](https://leetcode.cn/problems/maximum-number-of-moves-in-a-grid/)
#### 综合应用
- [778. 水位上升的泳池中游泳](https://leetcode.cn/problems/swim-in-rising-water/)
- [1631. 最小体力消耗路径](https://leetcode.cn/problems/path-with-minimum-effort/)
- [1263. 推箱子](https://leetcode.cn/problems/minimum-moves-to-move-a-box-to-their-target-location/)
- [LCP 75. 传送卷轴](https://leetcode.cn/problems/rdmXM7/)
- [LCP 13. 寻宝](https://leetcode.cn/problems/xun-bao/)
*/

// 网格/矩阵上的搜索
Expand Down Expand Up @@ -1225,10 +1227,11 @@ func gridCollection() {
}
for i, row := range g {
for j, v := range row {
if v == valid && !vis[i][j] {
cnt++
f(i, j)
if v != valid && !vis[i][j] {
continue
}
cnt++
f(i, j)
}
}
return
Expand Down Expand Up @@ -1265,12 +1268,13 @@ func gridCollection() {
}
for i, row := range g {
for j, v := range row {
if v == validCell && !vis[i][j] {
comp = []pair{}
if f(i, j) {
comps = append(comps, comp)
// do comp ...
}
if v != validCell && !vis[i][j] {
continue
}
comp = []pair{}
if f(i, j) {
comps = append(comps, comp)
// do comp ...
}
}
}
Expand Down

0 comments on commit ea5bc78

Please sign in to comment.