Picks up where Two-sum indices left off.
Same setup as two-sum, but count how many index pairs (i<j) sum to target.
Write count_pairs(nums, target).
Starter:
def count_pairs(nums, target):
# TODO
pass
Solve it interactively in your browser (no setup), check your answer instantly, and keep your daily streak going on IWTLP: https://iwtlp.com/challenge
Top comments (0)