So I came across this question earlier, and I'm stumped: When given a list of n integers, we are looking to return a value equal to the highest possible average of x consecutive integers in that list.
For example:
we have list [1, 2, 1, 7, 9, 8, 3, 2]
we have x = 3
our answer would be 8, because the sequence of 3 consecutive integers, with the highest average, is 7, 9, 8, and their average is 8.
[1, 2, 1, 7, 9, 8, 3, 2]
Anyone know how to approach this in code/pseudocode?