首页 > 编程语言 > 详细

Java for LeetCode 126 Word Ladder II

时间:2015-05-27 11:33:20      阅读:286      评论:0      收藏:0      [点我收藏+]

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"]

Return

  [
    ["hit","hot","dot","dog","cog"],
    ["hit","hot","lot","log","cog"]
  ]
解题思路:

Java for LeetCode 126 Word Ladder II

原文:http://www.cnblogs.com/tonyluis/p/4532803.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!