feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def is_prefix_string(s: str, words: list[str]) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { s: "iloveleetcode", words: ["i", "love", "leetcode", "apples"] }
|
||||
expected: true
|
||||
- input: { s: "iloveleetcode", words: ["apples", "i", "love", "leetcode"] }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { s: "a", words: ["a", "b"] }
|
||||
expected: true
|
||||
- input: { s: "abc", words: ["abc"] }
|
||||
expected: true
|
||||
- input: { s: "ab", words: ["a", "bc"] }
|
||||
expected: false
|
||||
- input: { s: "abc", words: ["ab", "c", "d"] }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
Given a string `s` and an array of strings `words`, determine whether `s` is a **prefix string** of `words`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user