solution.py
⌘↵ runLoading...
Word Ladder
hardYou've got this! Start small, think out loud.
Given two words `beginWord` and `endWord` and a word list, return the length of the shortest transformation sequence from beginWord to endWord where each step changes exactly one letter and all intermediate words are in the word list.
Time:O(m^2 * n)
Space:O(m^2 * n)
bfshard-patterngoogle-favorite
OUTPUT
Run your code to see output