feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -8,6 +8,26 @@ categories:
patterns:
- greedy
function_signature: "def can_complete_circuit(gas: list[int], cost: list[int]) -> int:"
test_cases:
visible:
- input: { gas: [1, 2, 3, 4, 5], cost: [3, 4, 5, 1, 2] }
expected: 3
- input: { gas: [2, 3, 4], cost: [3, 4, 3] }
expected: -1
hidden:
- input: { gas: [5, 1, 2, 3, 4], cost: [4, 4, 1, 5, 1] }
expected: 4
- input: { gas: [3], cost: [3] }
expected: 0
- input: { gas: [1, 2], cost: [2, 1] }
expected: 1
- input: { gas: [5, 8, 2, 8], cost: [6, 5, 6, 6] }
expected: 3
- input: { gas: [3, 3, 4], cost: [3, 4, 4] }
expected: -1
description: |
There are `n` gas stations along a circular route, where the amount of gas at the i<sup>th</sup> station is `gas[i]`.