diff --git a/src/my_project/interviews/google_top_exercises/round_1/25_word_ladder.py b/src/my_project/interviews/google_top_exercises/round_1/25_word_ladder.py index 9cefe154..41147165 100644 --- a/src/my_project/interviews/google_top_exercises/round_1/25_word_ladder.py +++ b/src/my_project/interviews/google_top_exercises/round_1/25_word_ladder.py @@ -39,7 +39,16 @@ def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int if neighbor not in visited: visited.add(neighbor) queue.append((neighbor, level + 1)) + print(pattern,visited) # Clear the bucket so it is not scanned again by another word. patterns[pattern] = [] return 0 + +print('hello world') +solution = Solution() + +print(solution.ladderLength(beginWord='hat',endWord='hut', wordList=['het', + 'hit', + 'hot', + 'hut'])) \ No newline at end of file