Word Ladder
Last updated
Last updated
Given two words beginWord
and endWord
, and a dictionary wordList
, return the length of the shortest transformation sequence from beginWord
to endWord
, such that:
Only one letter can be changed at a time.
Each transformed word must exist in the word list.
Return 0
if there is no such transformation sequence.