about | help | code help+videos | done | prefs |
Write a method that returns the sum of the integers in an array. However, only include a specific number in the sum if that number is stricktly greater than the previous number in the array. Note that the first number in the array is always included in the sum. However, if the array is empty simply return zero. t050115sum([5, 7, 8, 12]) → 32 t050115sum([7, 8, 9, 3, 3, 3, 3, 2, 6, 4, 4, 4, 4, 8, 1, 2]) → 40 t050115sum([6]) → 6 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 230
Copyright Nick Parlante 2017 - privacy