Dynamic Programming, Recursion, Competitive Programming, Leetcode, 3sum.
trickier and not as neat as the version I provide above. def three_sum_cached(arr: list[int], sum: int, two_sums: dict[int, tuple[int, int]]) -> list[int]: if len(arr) < 3: return [] # Same function call with the original version c1 = three_sum_cached(arr[:-1], sum, two_sums) # Instead of the