Overlapping subproblems
The same smaller question coming up again and again, such as the fewest bags for 28 lb. Spotting this is the cue to use dynamic programming.
The same smaller question coming up again and again, such as the fewest bags for 28 lb. Spotting this is the cue to use dynamic programming.