Skip to content

Commit 3a2066b

Browse files
committed
todo: word-ladder-ii
1 parent f3e2128 commit 3a2066b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

bfs.word-ladder-ii.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from typing import List
2+
3+
class Solution:
4+
"""
5+
TODO
6+
126. 单词接龙 II
7+
https://leetcode-cn.com/problems/word-ladder-ii/description/
8+
给定两个单词(beginWord 和 endWord)和一个字典 wordList,找出所有从 beginWord 到 endWord 的最短转换序列。转换需遵循如下规则:
9+
每次转换只能改变一个字母。
10+
转换后得到的单词必须是字典中的单词。
11+
"""
12+
def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]:
13+
pass
14+
15+
16+
so = Solution()
17+
print(so.findLadders('hit', 'cog', ["hot","dot","dog","lot","log","cog"]))

0 commit comments

Comments
 (0)