Data Center Peak Hours

Medium15m

Examples:

Input: [[1,2,3,4,5,2,1,2,5,5,4,3,2,2,1,1,1,2,3,4,5,3,2,1], 3]
Output: 8

Hours 8-10 (5,5,4) have the highest average of 4.67

Input: [[1,1,1,1,2,2,3,3,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2], 4]
Output: 5

Hours 5-8 (2,3,3,2) have the highest average of 2.5

Input: [[3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3], 2]
Output: 22

Hours 22-23 wrap around to next day, [2,3] has highest average

Constraints:

  • len(loads) = 24
  • 0 ≤ loads[i] ≤ 1000
  • 1 ≤ k ≤ 24
  • All loads are integers
  • List always contains exactly 24 hours

Custom Test Input

Output

Loading Python environment...