Question d’entretien chez Google

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