Exercises/#46 Word Ladder
#46

Word Ladder

Hard🕸️ Graphs
120 XP

Problem

Given beginWord, endWord, and a wordList, find the length of the shortest transformation sequence where each step changes exactly one letter.

Examples

Input: beginWord='hit', endWord='cog', wordList=['hot','dot','dog','lot','log','cog']
Output: 5 (hit→hot→dot→dog→cog)
graphbfsstring
AI Assistant— powered by AI

Unlock hints progressively — start gentle, go deeper only if needed.

💡

Level 1: Gentle Nudge

A subtle direction

🗺️

Level 2: Approach

The algorithm to use

🔍

Level 3: Detailed

Step-by-step guidance

46 / 150

Your Solution

⚡ JavaScript

to save progress and use AI features