LC: 644. Maximum Average Subarray II - spiralgo/algorithms GitHub Wiki
644. Maximum Average Subarray II:
The Essence:
We can pick some target value, try to find if there is some subarray of which's length ≥ k and at least has the target value as average.
If it does, we can look for higher values. Else, we need to look for lower values.
Details:
We can implement this using a trial-and-error approach empowered by Binary Search as in the corresponding PR: https://github.com/spiralgo/algorithms/pull/381