Dynamic Programming, Recursion, Competitive Programming, Leetcode, 3sum.
there are better ways of implementing the caching. Complexity: O(n²)(The time to compute the 2sums) Visually, while the original looks similar to this: The cached implementation is similar to this: 2Sum part is kind of cheating as I’ve not written that part of the algorithm recursively, so it’s