Completed sum of integers in an array