feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

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