feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent 98ebb1600f
commit 16b02451d0
94 changed files with 1840 additions and 0 deletions

View File

@@ -8,6 +8,24 @@ categories:
patterns:
- prefix-sum
function_signature: "def product_except_self(nums: list[int]) -> list[int]:"
test_cases:
visible:
- input: { nums: [1, 2, 3, 4] }
expected: [24, 12, 8, 6]
- input: { nums: [-1, 1, 0, -3, 3] }
expected: [0, 0, 9, 0, 0]
hidden:
- input: { nums: [2, 3] }
expected: [3, 2]
- input: { nums: [1, 1, 1, 1] }
expected: [1, 1, 1, 1]
- input: { nums: [0, 0] }
expected: [0, 0]
- input: { nums: [5, -2, 4] }
expected: [-8, 20, -10]
description: |
Given an integer array `nums`, return an array `answer` such that `answer[i]` is equal to the product of all the elements of `nums` except `nums[i]`.