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