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

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