A Common-Sense Guide to Data Structures and Algorithms, Second Edition: wrong max sum including -9 (page 421)

@jaywengrow

While reading through the “Greedy Algorithm” section of chapter 20 I saw that after the diagram for the greatest sum being 6, this one:

greatest sum = 6
[3, -4, 4, -3, 5, -9]
             |-----|
                  6

The next sentence says, “Finally, we reach the -9. This would make the current sum -4.”

Shouldn’t the current sum actually be -3 (e.g. 4 + -3 + 5 + -9 = -3)?

You’re right, thank you! This will be fixed in the next version.