Two ways to sum array