Word Ladder

Hard

📝 Description

Find the length of shortest transformation sequence from beginWord to endWord

Input Format

beginWord, endWord, and wordList

Output Format

Length of shortest transformation sequence

Constraints

1 ≤ beginWord.length ≤ 10

🔍 Sample Input

"hit"
"cog"
["hot","dot","dog","lot","log","cog"]
            

✅ Sample Output

5
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run