Word Ladder几个test case 没看明白# JobHunting - 待字闺中
p*2
1 楼
"hot", "hot", ["hot"] 0
"hot", "hot", ["hot","dot"] 3
"dog", "dog", ["din","dog","dig","don","tag"] 3
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]
As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog",
return its length 5.
按照题目中的例子来说,由于start已经等于end了,因此长度不是为一才对吗?也就是
根本不需要转换。
"hot", "hot", ["hot","dot"] 3
"dog", "dog", ["din","dog","dig","don","tag"] 3
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]
As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog",
return its length 5.
按照题目中的例子来说,由于start已经等于end了,因此长度不是为一才对吗?也就是
根本不需要转换。