Improving list sum function based on head and tail with C# 8