Hello
Consider Array A. For any suffix of A compute the prefix with maximum average.
Example : A => 1 3 2 5 3 Suffix [2, 5) => 2 5 3 Answer => 3.5
Is there a better solution than O(N ^ 2) ??
A Good Problem
Hello
Consider Array A. For any suffix of A compute the prefix with maximum average.
Example : A => 1 3 2 5 3 Suffix [2, 5) => 2 5 3 Answer => 3.5
Is there a better solution than O(N ^ 2) ??