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

 

siochi@cnu.edu > addArrays
prev  |  next  |  chance

addArrays() -- given two int arrays, return an int array that is the sum of the corresponding elements of the two arrays. You may assume the two arrays have the same number of elements.


addArrays([1, 1, 1], [10, 20, 30]) → [11, 21, 31]
addArrays([2], [4]) → [6]
addArrays([-1, -2, -3], [1, 2, 3]) → [0, 0, 0]

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

public int[] addArrays(int[] nums1, int[] nums2) { }

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: 250 Post-solution available

Copyright Nick Parlante 2017 - privacy