Change a word into another by changing only only one character at a time. All intermediate words should be contained in a dictionary.
This problem is pretty simple if we can choose a proper data structure. Let’s begin with a simple example. Say, we have a dictionary of words, the word to navigate from. and the word we need to navigate into.