Dynamic Programming, Recursion, Competitive Programming, Leetcode, 3sum.
items [3, 2, 7, 6], the first algorithm would sum it as ((((0 + 3) + 2) + 7) + 6) Whereas the second algorithm would sum it as (3 + (2 + (7 + (6 + 0)))) The real difference between them is, the second one explicitly relies on optimal substructure property. It follows the statement that we can just