BFS from "hit".
Level 1: "hit". Find neighbors differing by one letter in dictionary: "hot".
Level 2: "hot". Neighbors: "dot", "lot".
Level 3: "dot", "lot". Neighbors: "dog", "log".
Level 4: "dog", "log". Neighbors: "cog" found!
Level 5: Return 5.
For each word, generate 26 × L variations (L = word length). Check against dictionary set. where is dictionary size. Space: .