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

@@ -11,6 +11,28 @@ patterns:
- heap
- greedy
function_signature: "def find_maximized_capital(k: int, w: int, profits: list[int], capital: list[int]) -> int:"
test_cases:
visible:
- input: { k: 2, w: 0, profits: [1, 2, 3], capital: [0, 1, 1] }
expected: 4
- input: { k: 3, w: 0, profits: [1, 2, 3], capital: [0, 1, 2] }
expected: 6
hidden:
- input: { k: 1, w: 0, profits: [1, 2, 3], capital: [1, 1, 2] }
expected: 0
- input: { k: 1, w: 2, profits: [1, 2, 3], capital: [1, 1, 2] }
expected: 5
- input: { k: 10, w: 0, profits: [1, 2, 3], capital: [0, 1, 1] }
expected: 6
- input: { k: 1, w: 0, profits: [10], capital: [0] }
expected: 10
- input: { k: 2, w: 5, profits: [1, 1, 1, 1], capital: [0, 0, 0, 0] }
expected: 7
- input: { k: 3, w: 0, profits: [4, 5, 6], capital: [0, 0, 0] }
expected: 15
description: |
Suppose LeetCode will start its **IPO** soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the **IPO**. Since it has limited resources, it can only finish at most `k` distinct projects before the **IPO**. Help LeetCode design the best way to maximize its total capital after finishing at most `k` distinct projects.