The problem being addressed in section 4.1 of CLRS is very much similar to this one. But when I applied "maximum subarray" , solution did not get accepted. I understand that maximum subarray maximizes contiguous sum. But I do not understand how to differentiate this problem from CLRS' problem statement.

## Thanks

update: page from the book

http://postimg.org/image/3ra3baa07/

if you are not able to find the page, here is the pdf copy of book

http://tberg.dk/books/Introduction_to_algorithms_3rd_edition.pdf

page 89 (for pdf viewer)

(for printed book page no. 68)