feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -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*.