Sum of Consecutive Subarrays
Keep two running runs, one rising by one and one falling by one; each position extends them and adds their sums.
Keep two running runs, one rising by one and one falling by one; each position extends them and adds their sums.