find the longest sum in the array