Added test code to check against provided arrays, to make sure algorithms are correct.
Added function to add sub array elements.
Added problem arrays.