O06
Dense Window Maximum
Problem Statement & Objective
Given an array of server transaction metrics and an integer window size k, compute the maximum sum of any contiguous window of size k.
Function Signature (Python)
busiest_window(timestamps: list[int], window: int) -> intInput & Output Contract
Output Rule:Maximum sum integer among all sliding windows of size k.
System Constraints
1 <= k <= dizi.length <= 10^5
-10^4 <= dizi[i] <= 10^4Example Execution Walkthrough
dizi = [2, 1, 5, 1, 3, 2], k = 3
windows: [2,1,5]=8, [1,5,1]=7, [5,1,3]=9, [1,3,2]=6 -> max is 9Example Test Scenarios (3)
Example 1
Input:
[[1,2,3,10,11,12,13],3]Expected Output:
1Example 2: [10, 13) Aralığı
Input:
[[10,11,12,20],3]Expected Output:
10Example 3: Ayrık İstekler
Input:
[[1,5,9],2]Expected Output:
1