• Leetcode 127. Word Solitaire 126. Word Solitaire II


    127. Word Solitaire126. Word Solitaire II Preprocessing + breadth first traversal This code does not time out, but it is very slow. The official explanation can use two-way search to improve the speed. I don’t write two-way code here 127 questions class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: if beginWord […]