Google Interview Question

Q) Given and array, find the maximum subarray sum having first and last element of the subarray equal