feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- prefix-sum
|
||||
|
||||
function_signature: "def subarray_sum(nums: list[int], k: int) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 1, 1], k: 2 }
|
||||
expected: 2
|
||||
- input: { nums: [1, 2, 3], k: 3 }
|
||||
expected: 2
|
||||
hidden:
|
||||
- input: { nums: [1], k: 1 }
|
||||
expected: 1
|
||||
- input: { nums: [1], k: 0 }
|
||||
expected: 0
|
||||
- input: { nums: [-1, -1, 1], k: 0 }
|
||||
expected: 1
|
||||
- input: { nums: [1, -1, 0], k: 0 }
|
||||
expected: 3
|
||||
|
||||
description: |
|
||||
Given an array of integers `nums` and an integer `k`, return *the total number of subarrays whose sum equals to* `k`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user