I am looking for a algorithm for below riddle:
Write a program that transforms the word "cat" into "dog" by changing 1 character at a time, and while doing that, all the interim words that are generated are also valid words. You are given a method, which tells you whether a word is valid or not when you pass the word as an input to it.
Any Idea?