mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 02:41:42 +08:00
更新国内版力扣题目描述变更
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
<p>Given two words of equal length that are in a dictionary, write a method to transform one word into another word by changing only one letter at a time. The new word you get in each step must be in the dictionary.</p>
|
||||
|
||||
<p>Write code to return a possible transforming sequence. If there is more than one sequence, return any of them.</p>
|
||||
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong>
|
||||
beginWord = "hit",
|
||||
endWord = "cog",
|
||||
wordList = ["hot","dot","dog","lot","log","cog"]
|
||||
|
||||
<strong>Output:</strong>
|
||||
["hit","hot","dot","lot","log","cog"]
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong>
|
||||
beginWord = "hit"
|
||||
endWord = "cog"
|
||||
wordList = ["hot","dot","dog","lot","log"]
|
||||
|
||||
<strong>Output: </strong>[]
|
||||
|
||||
<strong>Explanation:</strong> <em>endWord</em> "cog" is not in the dictionary, so there's no possible transforming sequence.</pre>
|
||||
<p>Given two words of equal length that are in a dictionary, write a method to transform one word into another word by changing only one letter at a time. The new word you get in each step must be in the dictionary.</p>
|
||||
|
||||
|
||||
|
||||
<p>Write code to return a possible transforming sequence. If there is more than one sequence, return any of them.</p>
|
||||
|
||||
|
||||
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
|
||||
|
||||
<pre>
|
||||
|
||||
<strong>Input:</strong>
|
||||
|
||||
beginWord = "hit",
|
||||
|
||||
endWord = "cog",
|
||||
|
||||
wordList = ["hot","dot","dog","lot","log","cog"]
|
||||
|
||||
|
||||
|
||||
<strong>Output:</strong>
|
||||
|
||||
["hit","hot","dot","lot","log","cog"]
|
||||
|
Reference in New Issue
Block a user