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

@@ -8,6 +8,30 @@ categories:
patterns:
- greedy
function_signature: "def bulb_switch(n: int) -> int:"
test_cases:
visible:
- input: { n: 3 }
expected: 1
- input: { n: 0 }
expected: 0
- input: { n: 1 }
expected: 1
hidden:
- input: { n: 4 }
expected: 2
- input: { n: 9 }
expected: 3
- input: { n: 16 }
expected: 4
- input: { n: 25 }
expected: 5
- input: { n: 100 }
expected: 10
- input: { n: 99999999 }
expected: 9999
description: |
There are `n` bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.