BBox·DSASDE-2Onsite – Coding 1
Word Ladder (BFS)
Problem
Length of the shortest transformation sequence from beginWord to endWord, changing one letter at a time within a word list.
Example
hit -> cog via [hot,dot,dog,lot,log,cog] -> 5
Constraints
- 1 ≤ wordList ≤ 5000
Approach
BFS over the word graph. Reported Box onsite question.
added 6 days ago