feat(content): hidden test cases
This commit is contained in:
@@ -8,6 +8,28 @@ categories:
|
||||
patterns:
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def is_prefix_of_word(sentence: str, search_word: str) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { sentence: "i love eating burger", search_word: "burg" }
|
||||
expected: 4
|
||||
- input: { sentence: "this problem is an easy problem", search_word: "pro" }
|
||||
expected: 2
|
||||
- input: { sentence: "i am tired", search_word: "you" }
|
||||
expected: -1
|
||||
hidden:
|
||||
- input: { sentence: "hello", search_word: "hello" }
|
||||
expected: 1
|
||||
- input: { sentence: "hello world", search_word: "world" }
|
||||
expected: 2
|
||||
- input: { sentence: "a b c", search_word: "a" }
|
||||
expected: 1
|
||||
- input: { sentence: "abc def ghi", search_word: "xyz" }
|
||||
expected: -1
|
||||
- input: { sentence: "hellohello", search_word: "ell" }
|
||||
expected: -1
|
||||
|
||||
description: |
|
||||
Given a `sentence` that consists of some words separated by a **single space**, and a `searchWord`, check if `searchWord` is a prefix of any word in `sentence`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user