Maximum Average Subarray I
题目描述
Given an array consisting ofn
integers, find the contiguous subarray of given lengthk
that has the maximum average value. And you need to output the maximum average value.
Example 1:
题目链接
https://leetcode.com/problems/maximum-average-subarray-i/description/
Java
使用k为滑动窗口,做平均值计算即可。
Last updated