feat(content): more test cases
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user