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

 

recur_sumArray


Given an integer array named "arr", recursively calculate the sum of all of the numbers in the array. The method will be sent the array to calculate the sum of, an integer "index", which will always start at 0 and keep track of which spot you are currently on.


recur_sumArray([1, 2, 3], 0) → 6
recur_sumArray([2, 2, 2], 0) → 6
recur_sumArray([1, 2, 1, 2, 1, 2], 0) → 9

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

public int recur_sumArray(int[] arr, int index) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy