feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,28 @@ categories:
|
||||
patterns:
|
||||
- sliding-window
|
||||
|
||||
function_signature: "def query_string(s: str, n: int) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { s: "0110", n: 3 }
|
||||
expected: true
|
||||
- input: { s: "0110", n: 4 }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { s: "1", n: 1 }
|
||||
expected: true
|
||||
- input: { s: "0", n: 1 }
|
||||
expected: false
|
||||
- input: { s: "110101011011000011011111000000", n: 15 }
|
||||
expected: false
|
||||
- input: { s: "1111000110110111011100011", n: 12 }
|
||||
expected: true
|
||||
- input: { s: "10101010101010", n: 7 }
|
||||
expected: false
|
||||
- input: { s: "1010110001010100111010011110100101110", n: 20 }
|
||||
expected: false
|
||||
|
||||
description: |
|
||||
Given a binary string `s` and a positive integer `n`, return `true` *if the binary representation of all the integers in the range* `[1, n]` *are **substrings** of* `s`*, or* `false` *otherwise*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user