id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > t050115sum
prev  |  next  |  chance

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)

public int t050115sum(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 230

Copyright Nick Parlante 2017 - privacy