feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,28 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def max_profit(k: int, prices: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { k: 2, prices: [2, 4, 1] }
|
||||
expected: 2
|
||||
- input: { k: 2, prices: [3, 2, 6, 5, 0, 3] }
|
||||
expected: 7
|
||||
hidden:
|
||||
- input: { k: 1, prices: [1, 2, 3, 4, 5] }
|
||||
expected: 4
|
||||
- input: { k: 0, prices: [1, 2, 3] }
|
||||
expected: 0
|
||||
- input: { k: 2, prices: [1] }
|
||||
expected: 0
|
||||
- input: { k: 100, prices: [1, 2, 3, 4, 5] }
|
||||
expected: 4
|
||||
- input: { k: 2, prices: [5, 4, 3, 2, 1] }
|
||||
expected: 0
|
||||
- input: { k: 3, prices: [1, 2, 4, 2, 5, 7, 2, 4, 9, 0] }
|
||||
expected: 15
|
||||
|
||||
description: |
|
||||
You are given an integer array `prices` where `prices[i]` is the price of a given stock on the i<sup>th</sup> day, and an integer `k`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user