The first two cases can be solved recursively
For the last case:
find the largest sum in the first half that includes
the last element in the first half
the largest sum in the second half that includes the
first element in the second half
add these two sums together