Find the shortest transformation sequence length from beginWord to endWord, changing exactly one letter per step. All intermediate words must be in the word list.
BFS on an implicit graph. Use wildcard patterns (h*t, *ot) to find neighbors efficiently.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
ladderLength('hit', 'cog', ['hot','dot','dog','lot','log','cog'])
5