To define the problem more formally, we conventionally define the special array
element A[0] = 0 and let A[j : k] denote the sequence of elements of A from index
j toindex k (0≤j ≤k ≤n). The maximum subarray problem consists of finding the sequence
A[j : k] (0≤ j ≤ k ≤ n) that maximizes sj,k, the sum of its values. Such amaximumsumisreferredtoasthemaximumsubarraysumofarray A.