Maximum Average Subarray I
Google Interview Question
Problem Overview
Difficulty: Easy
LeetCode Pattern: Sliding Window
Given an array nums, find a contiguous subarray of length k that has the maximum average, and return that average value.
Note: Answer within 10-5 accuracy is acceptable.
Input:
· nums = [1,12,-5,-6,50,3]
· k = 4
Output:
· 12.75
Reason:
· Subarray: [12,-5,-6,50]
· It has max average of 12…Keep reading with a 7-day free trial
Subscribe to Harpreet's Newsletter to keep reading this post and get 7 days of free access to the full post archives.

