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

 

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

Write a method that accepts two arrays of integers. The method returns the sum of all of the integers in the two arrays with two exceptions: #1 Do not count any numbers that have the same value in the same location in both arrays. For example, if both arrays have a 7 in the third position then neither of those count towards the sum. #2 Do not count any numbers that do not have a matching position in the other array. So if one array is 3 numbers long and the other array is 100 numbers long, only the first three numbers from the second array would count, provided they did not violate rule #1 above.


splitSum([], []) → 0
splitSum([5, 2, 3, -24], []) → 0
splitSum([10], [20]) → 30

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

public int splitSum(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: 280

Copyright Nick Parlante 2017 - privacy