18.7 Transform one string to another

#1

I am going through chapter 18 problem 7: Transform one string to another and I see that the author finds all the string differing in one character from the source and mark it as visited. Isn’t the idea of the dictionary that we can just use the word which is in the dictionary (valid words) to reach the target?

0 Likes

#2

I think there is one important constraint you are missing. You can only change one character a time. So the word you want to reach may be in the dictionary but you may not reach there by changing one character at a time.

0 Likes