给出两个单词(start和end)和一个字典,找出所有从start到end的最短转换序列。
变换规则如下:
1.每次只能改变一个字母。
2.变换过程中的中间单词必须在字典中出现。
给出数据如下:
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]
返回
[
["hit","hot","dot","dog","cog"],
["hit","hot","lot","log","cog"]
]
原文:https://www.cnblogs.com/phinza/p/9864184.html