Try to solve the Word Ladder problem.
We'll cover the following
Statement
Given two words, src
and dest
, and a list, words
, return the number of words in the shortest transformation sequence from src
to dest
. If no such sequence can be formed, return .
A transformation sequence is a sequence of words src
that has the following properties:
-
dest
- Every pair of consecutive words differs by a single character.
- All the words in the sequence are present in the
words
. Thesrc
does not need to be present inwords
.
Constraints:
-
src.length
-
src.length
dest.length
words[i].length
-
src
dest
-
words.length
-
No duplicates in the
words
-
src
,dest
, andwords[i]
consist of lowercase English characters.