// findMaxCrossingSubarray return left-index, right-index and sum value of the crossing subarray
findMaxCrossingSubarray return left-index, right-index and sum value of the crossing subarray
// findMaxCrossingSubarray return left - index right - index and sum value of the crossing subarray
func findMaxCrossingSubarray(in []int, low, mid, high int) (int, int, int) {
	leftLow := mid
	leftSum := in[mid]
	sum := leftSum
	for i := mid - 1; i >= low; i-- {
		sum += in[i]
		if sum > leftSum {
			leftLow = i
			leftSum = sum
		}
	}
	rightHigh := mid + 1
	rightSum := in[mid+1]
	sum = rightSum
	for i := mid + 2; i <= high; i++ {
		sum += in[i]
		if sum > rightSum {
			rightHigh = i
			rightSum = sum
		}
	}
	return leftLow, rightHigh, leftSum + rightSum
}
func findMaxCrossingSubarray ( in [ ] int , low , mid , high int ) ( int , int , int ) { leftLow := mid leftSum := in [ mid ] sum := leftSum for i := mid - 1 ; i >= low ; i -- { sum += in [ i ] if sum > leftSum { leftLow = i leftSum = sum } } rightHigh := mid + 1 rightSum := in [ mid + 1 ] sum = rightSum for i := mid + 2 ; i <= high ; i ++ { sum += in [ i ] if sum > rightSum { rightHigh = i rightSum = sum } } return leftLow , rightHigh , leftSum + rightSum }
findMaxCrossingSubarray return left-index, right-index and sum value of the crossing subarray
findMaxCrossingSubarray return left - index right - index and sum value of the crossing subarray