Dynamic Programming, Recursion, Competitive Programming, Leetcode, 3sum.
is the actual code we would write for those who would like to test it by hand. def two_sums(arr: list[int]) -> dict[int, tuple[int, int]]: """ Returns a dictionary of all the two sums in the array """ two_sum_dict = {} for i in range(len(arr)): for j in range(i + 1, len(arr)): if arr[i] + arr[j]