Problem: you are given 2 words with equal number of characters. Find an algorithm to go from first word to second word, changing one character at each step, in such a way that each intermediate word exist in a given dictionary.
Example:
Words are pit, map. A possible solution:
Example:
Words are pit, map. A possible solution:
pit, pot, pet, met, mat, map.