Given an array of n integers, find the contiguous subarray of given length k that has the maximum average value. Output the maximum average value.
The candidate's solution is correct and solves the problem. The approach is good, iterating through the array once and keeping track of the sum of the previous k elements. The time complexity is O(n) and the space complexity is O(1).
Evaluated at: 2022-12-03 02:15:36