Find the Maximum Sum of a Subarray given an Array