Assignment Help >> JAVA Programming
Write a method called addUnevenArrays that takes two arrays, a and b, and returns a new array, c, with a
length that is the maximum of the lengths of a and b. Each c[i] is the sum of the corresponding elements
of a and b if both elements exist. If one of the elements does not exist, however, c[i] is a copy of the
element from a or b that does exist. For example, given
a == {0, 1, 2, 3}, and
b == {100, 101, 102, 103, 104, 105},
then addUnevenArrays(a,b) should return the array
{100 102, 104, 106, 104, 105}.
Use the method definition below.
public static int[] addUnevenArrays(int[] a, int[] b)