feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent 98ebb1600f
commit 16b02451d0
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,28 @@ categories:
patterns:
- bfs
function_signature: "def ladder_length(begin_word: str, end_word: str, word_list: list[str]) -> int:"
test_cases:
visible:
- input: { begin_word: "hit", end_word: "cog", word_list: ["hot", "dot", "dog", "lot", "log", "cog"] }
expected: 5
- input: { begin_word: "hit", end_word: "cog", word_list: ["hot", "dot", "dog", "lot", "log"] }
expected: 0
hidden:
- input: { begin_word: "a", end_word: "c", word_list: ["a", "b", "c"] }
expected: 2
- input: { begin_word: "hot", end_word: "dog", word_list: ["hot", "dog"] }
expected: 0
- input: { begin_word: "hot", end_word: "dog", word_list: ["hot", "dog", "dot"] }
expected: 3
- input: { begin_word: "leet", end_word: "code", word_list: ["lest", "leet", "lose", "code", "lode", "robe", "lost"] }
expected: 0
- input: { begin_word: "cat", end_word: "dog", word_list: ["cat", "bat", "bet", "bot", "dot", "dog"] }
expected: 6
- input: { begin_word: "red", end_word: "tax", word_list: ["ted", "tex", "red", "tax", "tad", "den", "rex", "pee"] }
expected: 4
description: |
A **transformation sequence** from word `beginWord` to word `endWord` using a dictionary `wordList` is a sequence of words `beginWord -> s1 -> s2 -> ... -> sk` such that: