How does the sumOnArray function calculate the sum of values?

How does the sumOnArray function calculate the sum of values?

The function iterates through the input data array and keeps track of the sum of values within the specified period.

It updates the output data array with the calculated sum for each corresponding index.