feat(content): more test cases
This commit is contained in:
@@ -10,6 +10,24 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def word_break(s: str, word_dict: list[str]) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { s: "leetcode", word_dict: ["leet", "code"] }
|
||||
expected: true
|
||||
- input: { s: "applepenapple", word_dict: ["apple", "pen"] }
|
||||
expected: true
|
||||
- input: { s: "catsandog", word_dict: ["cats", "dog", "sand", "and", "cat"] }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { s: "a", word_dict: ["a"] }
|
||||
expected: true
|
||||
- input: { s: "aaaaaaa", word_dict: ["aaaa", "aaa"] }
|
||||
expected: true
|
||||
- input: { s: "cars", word_dict: ["car", "ca", "rs"] }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
Given a string `s` and a dictionary of strings `wordDict`, return `true` if `s` can be segmented into a space-separated sequence of one or more dictionary words.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user