Lets say array one [2/3, 0, -1, 0, 7/2] and array two [0, 0, -2/3, 1, 0, 0] so I want my result array to be [0, 2/3, -2/3, 0, 0, 7/2]. The result array length will be the max length between the two arrays. How can I do this in Java?
Pretty much I want the specific index locations to add each other however I don't know how to do this with unequal arrays.
Edit: It adds the locations and anything that is unmatched is left untouched in the largest array. [0, 0, -2/3, 1, 0, 0] has location 0, 1, 2, 3, 4, 5 and array [2/3, 0, -1, 0, 7/2] has locations that coincide with the larger array as 1, 2, 3, 4, 5 so I want the same location values to be added and placed into the resultant array. I created a new resultant array and set it equal to the largest array so all that has to be done is the adding of similar location values.