Search
⌘K

Leetcode 644. Maximum Average Subarray II

Given an array of numbers and an integer k, find the maximum possible average of any contiguous subarray with length at least k. The typical approach is to binary-search the possible average (real value) and use prefix-sum-based feasibility checks to test whether any subarray of length ≥k can achieve that average.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.