I am quite stuck in this problem for a long. I am not able to approach this problem and make progress. However, based on my progress what I understood regarding the problem is:
- We are given a dictionary of words in which all words have the same length.
- We are given a beginWord and endWord and we have to convert beginWord into endWord with one transformation(one letter change) and the next obtained word must be present in the given wordlist.
- So we can consider a word as a node in the graph and all next node( 1 letter change ) as it’s an adjacent node in the graph.
- Now I think we have to find the shortest distance between the node i.e, beginWord and endWord.
I am facing difficulty in doing these things programmatically.
Thanks in advance