feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,30 @@ categories:
|
||||
patterns:
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def can_make_arithmetic_progression(arr: list[int]) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { arr: [3, 5, 1] }
|
||||
expected: true
|
||||
- input: { arr: [1, 2, 4] }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { arr: [1, 2] }
|
||||
expected: true
|
||||
- input: { arr: [5, 5, 5, 5] }
|
||||
expected: true
|
||||
- input: { arr: [0, 0] }
|
||||
expected: true
|
||||
- input: { arr: [-1, -5, -3] }
|
||||
expected: true
|
||||
- input: { arr: [1, 100] }
|
||||
expected: true
|
||||
- input: { arr: [1, 2, 3, 4, 6] }
|
||||
expected: false
|
||||
- input: { arr: [10, 5, 0, -5, -10] }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
A sequence of numbers is called an **arithmetic progression** if the difference between any two consecutive elements is the same.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user