feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,28 @@ patterns:
|
||||
- greedy
|
||||
- binary-search
|
||||
|
||||
function_signature: "def avoid_flood(rains: list[int]) -> list[int]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { rains: [1, 2, 3, 4] }
|
||||
expected: [-1, -1, -1, -1]
|
||||
- input: { rains: [1, 2, 0, 0, 2, 1] }
|
||||
expected: [-1, -1, 2, 1, -1, -1]
|
||||
- input: { rains: [1, 2, 0, 1, 2] }
|
||||
expected: []
|
||||
hidden:
|
||||
- input: { rains: [1, 0, 1] }
|
||||
expected: [-1, 1, -1]
|
||||
- input: { rains: [0, 1, 1] }
|
||||
expected: []
|
||||
- input: { rains: [1, 1] }
|
||||
expected: []
|
||||
- input: { rains: [0] }
|
||||
expected: [1]
|
||||
- input: { rains: [1] }
|
||||
expected: [-1]
|
||||
|
||||
description: |
|
||||
Your country has an infinite number of lakes. Initially, all the lakes are empty, but when it rains over the n<sup>th</sup> lake, that lake becomes full of water. If it rains over a lake that is **full of water**, there will be a **flood**.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user