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

 

raAdd


Write a method that takes two int arrays, adds corresponding elements and returns an array containing the sums. Both arrays must contain the same number of elements. If they are different lengths, the empty array must be returned.


raAdd([1, 2, 3], [1, 2, 3]) → [2, 4, 6]
raAdd([1, 2, 3], [0, 0, 0]) → [1, 2, 3]
raAdd([-1, 2, -3], [0, 0, 0]) → [-1, 2, -3]

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

public int[] raAdd( int[] ra1, int[] ra2) { }

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: 200

Copyright Nick Parlante 2017 - privacy