Search⌘ K
AI Features

Solution: Maximum Average Subarray I

Solution: Maximum Average Subarray I asks you to choose a contiguous subarray of exactly k elements from an integer array and return the greatest average, even when values are negative.

Statement

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

Constraints:

  • 1≤1 \leq ...