Search⌘ K
AI Features

Word Ladder

Discover how to solve the Word Ladder problem by using breadth-first search to find the shortest transformation sequence between two words. This lesson helps you understand the problem constraints and develop an efficient BFS approach to traverse word sequences where each pair differs by one character.

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 00.

A transformation sequence is a sequence of words ((src \to word1word_1 \to ...