Todefinetheproblemmoreformally,weconventionallydefinethespecialarray elementA[0] = 0andletA[j : k]denotethesequenceofelementsofAfromindex j toindex k (0≤j ≤k ≤n). Themaximumsubarrayproblemconsistsoffinding the sequence A[j : k] (0≤ j ≤ k ≤ n) that maximizes sj,k, the sum of its values. Suchamaximumsumisreferredtoasthemaximumsubarraysumofarray A.