-----Description-----
Given a sequence of n integers, your task is to find the largest sum obtainable by choosing a contiguous subarray of the sequence. At least one number must be selected.

The algorithm uses dynamic programming (Kadane’s Algorithm) to solve the problem:
1. Initialize the current maximum (cur) and the overall maximum (maxSoFar) with the first element.
2. For each subsequent element, update:
     cur = max(element, cur + element)
     maxSoFar = max(maxSoFar, cur)
3. Return maxSoFar as the answer.

-----Input-----
The input is provided as a list of integers:
  sequence: A list of n integers.

-----Output-----
The output is a single integer representing the maximum subarray sum.

