Approach hintTry it first, then revealHide
Run a BFS from the begin word. Generate neighbours by changing each position to every other letter and checking a hash set of unused words; the layer at which the end word appears gives the answer.
Run a BFS from the begin word. Generate neighbours by changing each position to every other letter and checking a hash set of unused words; the layer at which the end word appears gives the answer.