The correctness of the MaxsubFaster algorithm follows along the same arguments
as for the MaxsubSlow algorithm, but it is much faster. In particular, the outer
loop, for index j, will iterate n times, its inner loop, for index k, will iterate at
most n times, and the steps inside that loop will only take O(1) time in each iteration.
Thus, the total running time of the MaxsubFaster algorithm is O(n2), which
improves the running time of the MaxsubSlow algorithm by a linear factor.