Word Ladder II
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the dictionary
For example,
Given:
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]
class Solution {
public:
#define rep(i,n) for(int i=0;i<(int)(n);i++)
vector<vector<string>> findLadders(string start, string end, unordered_s......
阅读全文