Given two words of the same length, A and B, and a dictionary of valid words, finds a shortest transformation from A to B, such that only one letter is changed at a time and all intermediate words in the transformation exist in the dictionary.