▸1effort[*] = ∞; effort[0][0] = 02pq = {(0, (0,0))}3while pq not empty:4 (e, cell) = pop min effort5 if cell settled: skip; mark settled6 if cell == target: return e7 for each neighbour:8 cand = max(e, |Δheight|)9 if cand < effort[nbr]: update; push
- size3 × 3
- start(0,0)
- target(2,2)