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

@@ -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*.