Write a method arrayPairwiseSum that takes an IntArray and returns an
array with the pairwise sums of all the elements.
For example, given the array {1, 2} you would return the array {3}.
Given the array {1, 3, 5} you would return the array {4, 8}. (1 + 3 = 4; 3 + 5 = 8).
Note that the input array must have at least 2 elements to be valid. If the passed array
has less than 2 elements, throw an IllegalArgumentException.
Stuck? You may find these lessons helpful: