Dell OpenManage Enterprise processes sequences of server telemetry readings. Given an integer array readings and a desired window length k, return the maximum sum of any contiguous subarray containing exactly k readings.
Use a sliding-window approach rather than recomputing every window from scratch.
Implement max_window_sum(readings, k).
readings, a list of integers, and k, a positive integer.k.k consecutive elements. The array may contain negative values.def max_window_sum(readings, k):