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

 

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

Wrtie a method that returns an array representing the "running sum" of the numbers in the input array. For example: {4, -2, 6, 1, 3} returns {4, 2, 8, 9, 12} because 4+(-2)=2, then 2+6=8, then 8+1=9, then 9+3=12. Look at the test data for further examples. The input array will contain at least one number.


oceanRunningSum([5]) → [5]
oceanRunningSum([2, 5, -3, -1]) → [2, 7, 4, 3]
oceanRunningSum([1, 1, 1, 1, 1, 1, 1]) → [1, 2, 3, 4, 5, 6, 7]

...Save, Compile, Run (ctrl-enter)

public int[] oceanRunningSum(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: 280

Copyright Nick Parlante 2017 - privacy