feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,26 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def number_of_arithmetic_slices(nums: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 2, 3, 4] }
|
||||
expected: 3
|
||||
- input: { nums: [1] }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { nums: [1, 2] }
|
||||
expected: 0
|
||||
- input: { nums: [1, 2, 3] }
|
||||
expected: 1
|
||||
- input: { nums: [1, 2, 3, 4, 5] }
|
||||
expected: 6
|
||||
- input: { nums: [7, 7, 7, 7] }
|
||||
expected: 3
|
||||
- input: { nums: [1, 2, 3, 5, 7] }
|
||||
expected: 1
|
||||
|
||||
description: |
|
||||
An integer array is called *arithmetic* if it consists of **at least three elements** and if the difference between any two consecutive elements is the same.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user