码迷,mamicode.com
首页 > 编程语言 > 详细

Java for LeetCode 126 Word Ladder II

时间:2015-05-27 11:36:20      阅读:202      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!