Given the following method signature, int MaxWindowTotal(int[] values, int windowSize); MaxWindowTotal will take an array of integers and a windowSize, and return the maximum total of any consecutive sequence of integers of length windowSize. For example, given (array = [5, 12, 25, 7, 9], windowSize = 3), the method will return 44 (the sum of 12, 25, and 7 is the greatest total of any 3 consecutive integers in the array).
Anonymous
public static int MaxWindowTotal (int[] values, int w){ int max_sum = 0; for (int i = 0; i max_sum) {max_sum = sum;} } return max_sum; }
Check out your Company Bowl for anonymous work chats.