Which route uses the fewest edges? Which costs least?
What assumption makes first FIFO discovery a shortest-path proof?
1 / 7
Word Ladder — predict before coding
Words are vertices; changing one position is an unweighted edge. Wildcard buckets are an adjacency index, not an alternative distance metric. The answer counts words, so the start has distance 1.
Decision: For hit->hot->dot->dog->cog, what is the returned length? Why must cog be in the dictionary even though hit need not be?
2 / 7
Snakes and Ladders — predict before coding
Choose the state after the mandatory jump, so one BFS edge is exactly one die roll followed by at most one snake or ladder. Board drawing coordinates are only an encoding of labels.
Decision: On a 3x3 board, where are labels 1, 4, 6, and 9? If landing on 2 jumps to 8 and 8 contains a jump, do you chain it?
3 / 7
Minimum Genetic Mutation — predict before coding
Generate neighbors by changing one character to one of the other three bases. The bank is an admissibility filter; being one mutation away is not enough unless the resulting gene is allowed.
Decision: Why is start=end answered with 0 even for an empty bank, while a different absent target is answered with -1?
4 / 7
Rotting Oranges — predict before coding
All initially rotten oranges are simultaneous sources at minute zero. A fresh orange rots at the minimum distance from any source, not after the sum of separate source traversals.
Decision: For row [2,1,1,1,2], when does each fresh orange rot? Why does processing the two sources one after another with separate clocks fail?
5 / 7
Shortest Path in Binary Matrix — predict before coding
The graph uses eight directions, and the path length counts cells. A clear 1x1 board therefore has length 1. These choices differ deliberately from the island and rotting-orange problems.
Decision: For [[0,1],[1,0]], is there a path? What length would four-direction code incorrectly return?
6 / 7
Add one reversible resource
A grid permits one wall removal. Two routes reach the same cell: one has used the removal and one has not.
Can visited[row][col] safely merge these states? Construct the missing state and describe the transition.
7 / 7
←/→ or click edges to navigate · ? help · N notes · F fullscreen