feat(content): function signatures + test cases

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

View File

@@ -8,6 +8,28 @@ categories:
patterns:
- greedy
function_signature: "def flip_lights(n: int, presses: int) -> int:"
test_cases:
visible:
- input: { n: 1, presses: 1 }
expected: 2
- input: { n: 2, presses: 1 }
expected: 3
- input: { n: 3, presses: 1 }
expected: 4
hidden:
- input: { n: 1, presses: 0 }
expected: 1
- input: { n: 3, presses: 2 }
expected: 7
- input: { n: 3, presses: 3 }
expected: 8
- input: { n: 10, presses: 5 }
expected: 8
- input: { n: 2, presses: 2 }
expected: 4
description: |
There is a room with `n` bulbs labelled from `1` to `n` that all are turned on initially, and **four buttons** on the wall. Each of the four buttons has a different functionality: