Write a function that finds the maximum sum of a subarray of a given array of integers. The function should return the maximum sum of a subarray. For example, given the array [-2, -3, 4, -1, -2, 1, 5, -3], the function should return 7, which is the maximum sum of the subarray [4, -1, -2, 1, 5].
Write a function that finds the maximum sum of a subarray of a given array of integers. The function should return the maximum sum of a subarray. For example, given the array [-2, -3, 4, -1, -2, 1, 5, -3], the function should return 7, which is the maximum sum of the subarray [4, -1, -2, 1, 5].
Example
Input: [-2, -3, 4, -1, -2, 1, 5, -3]
Output: 7