Google Interview Question

Return maximum sum of minimum and maximum of a subarray