I\'m trying to find a better way of processing a sequence of numbers based on the following requirement:
the value of sequence[i] is the sum of its own value pl
using System.Linq;
List numbers = new List {10, 20, 30, 40};
List runningTotals = new List(numbers.Count);
numbers.Aggregate(0, (sum, value) => {
sum += value;
runningTotals.Add(sum);
return sum;
});