jeffgerickson / algorithms

Bug-tracking for Jeff's algorithms book, notes, etc.
7.88k stars 1.02k forks source link

[Oops.] Incorrect example answer in Dynamic Programming exercises #271

Open sarthak-moorjani opened 1 year ago

sarthak-moorjani commented 1 year ago

Chapter number or note title: [Dynamic Programming]

Page number: [Exercises question 9 (About finding palindromic partitioning of a string)]

Error description: [The example in part (e) which says "Given the string BUBBASEESABANANA, your algorithm should return 70." The answer To this is actually 97 (Verified by both DP and Brute force solutions). I also printed all the 97 ways of partitioning the string to verify this.]

Suggested fix (if any): [Change 70 to 97.]

echuber2 commented 1 year ago

I think you're right. The change would also affect the reference "and 65 others" in 9c.