Grade 1 - Partial Sums Algorithm