feat(content): more test cases
This commit is contained in:
@@ -11,6 +11,30 @@ patterns:
|
||||
- sliding-window
|
||||
- monotonic-stack
|
||||
|
||||
function_signature: "def max_sliding_window(nums: list[int], k: int) -> list[int]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 3, -1, -3, 5, 3, 6, 7], k: 3 }
|
||||
expected: [3, 3, 5, 5, 6, 7]
|
||||
- input: { nums: [1], k: 1 }
|
||||
expected: [1]
|
||||
- input: { nums: [1, -1], k: 1 }
|
||||
expected: [1, -1]
|
||||
hidden:
|
||||
- input: { nums: [9, 11], k: 2 }
|
||||
expected: [11]
|
||||
- input: { nums: [4, 3, 2, 1], k: 2 }
|
||||
expected: [4, 3, 2]
|
||||
- input: { nums: [1, 2, 3, 4], k: 2 }
|
||||
expected: [2, 3, 4]
|
||||
- input: { nums: [7, 7, 7, 7], k: 3 }
|
||||
expected: [7, 7]
|
||||
- input: { nums: [1, 3, 1, 2, 0, 5], k: 3 }
|
||||
expected: [3, 3, 2, 5]
|
||||
- input: { nums: [-7, -8, 7, 5, 7, 1, 6, 0], k: 4 }
|
||||
expected: [7, 7, 7, 7, 7]
|
||||
|
||||
description: |
|
||||
You are given an array of integers `nums`, there is a sliding window of size `k` which is moving from the very left of the array to the very right. You can only see the `k` numbers in the window. Each time the sliding window moves right by one position.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user