- Graph problem
- Convert it to a shortest path problem
find words that differ by 1 edit
do a bfs from start to endword
get all paths that can reach : A cute trick is involved here . Find the distance of each node between source and destination. Do a DFS from goal such that you visit nodes which will lead you to the source faster than the current one!
Note: average word lengths are typically around 10. but the number of words can be very high. speed up your adjacency list calculation if you havent taken this into consideration