Search⌘ K
AI Features

Solution: Maximum Average Subarray I

Solution: Maximum Average Subarray I asks you to find the largest average among all contiguous subarrays of exactly k elements in an integer array, whose values may be 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 ...