feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,32 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def max_product(nums: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [2, 3, -2, 4] }
|
||||
expected: 6
|
||||
- input: { nums: [-2, 0, -1] }
|
||||
expected: 0
|
||||
- input: { nums: [2, -5, -2, -4, 3] }
|
||||
expected: 24
|
||||
hidden:
|
||||
- input: { nums: [0] }
|
||||
expected: 0
|
||||
- input: { nums: [-2] }
|
||||
expected: -2
|
||||
- input: { nums: [1, 2, 3, 4] }
|
||||
expected: 24
|
||||
- input: { nums: [-1, -2, -3] }
|
||||
expected: 6
|
||||
- input: { nums: [0, 2] }
|
||||
expected: 2
|
||||
- input: { nums: [-2, 3, -4] }
|
||||
expected: 24
|
||||
- input: { nums: [2, -1, 1, 1] }
|
||||
expected: 2
|
||||
|
||||
description: |
|
||||
Given an integer array `nums`, find a subarray that has the largest product, and return *the product*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user