On Monday, 19 March 2018 at 17:33:31 UTC, Dukc wrote:
public static int Foo(int[] input) { int result = 10; for (int i = input.Length / 4; i >= 0; i -= 4) { int sum = 0;for (int j = i; j < i +4 && j < input.Length; j++) sum += input[j];sum *= i; result = (result + sum) / 2; } return result; }
Looks like you need to partition, select, aggregate and another aggregate.