feat(content): function signatures + test cases
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user