Dynamic Programming, Programming, Algorithms, Data, Coding Interviews.
(including A[i] and A[j]). It is easy to see that the problem can be solved by calculating all the possible n² array sums and taking the maximum among those. This takes at least n² operations; actually, even more since to compute a particular sum A[i] + · · · + A[j] requires j − i addition