feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,32 @@ patterns:
|
||||
- sliding-window
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def max_turbulence_size(arr: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { arr: [9, 4, 2, 10, 7, 8, 8, 1, 9] }
|
||||
expected: 5
|
||||
- input: { arr: [4, 8, 12, 16] }
|
||||
expected: 2
|
||||
- input: { arr: [100] }
|
||||
expected: 1
|
||||
hidden:
|
||||
- input: { arr: [1, 2] }
|
||||
expected: 2
|
||||
- input: { arr: [2, 1] }
|
||||
expected: 2
|
||||
- input: { arr: [5, 5, 5, 5] }
|
||||
expected: 1
|
||||
- input: { arr: [1, 3, 2, 4, 3, 5, 4] }
|
||||
expected: 7
|
||||
- input: { arr: [9, 9] }
|
||||
expected: 1
|
||||
- input: { arr: [1, 2, 1, 2, 1, 2, 1] }
|
||||
expected: 7
|
||||
- input: { arr: [10, 5, 10, 5, 10] }
|
||||
expected: 5
|
||||
|
||||
description: |
|
||||
Given an integer array `arr`, return *the length of a maximum size turbulent subarray of* `arr`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user