Search⌘ K
AI Features

Solution: Maximum Average Subarray I

Explore the sliding window technique to efficiently find the maximum average of a contiguous subarray of length k in an integer array. This lesson guides you through implementing a solution with linear time complexity and minimal space usage.

Statement

Given an array of integers nums, and an integer k, return the maximum average of a contiguous subarray of length k.

Constraints:

  • 11 \leq ...