Dynamic Programming, Recursion, Competitive Programming, Leetcode, 3sum.
one for computing 2sums([1, 2, 3, 4]) , and in fact that’s a property of 2sums . Any array that computes its 2sum always computes 2sums’s of all of its subsets. Upon this realization, we will simply precompute 2sum and relieve ourselves of the responsibility of computing it every single time. Below