PythiloEasy · 15 min · Task 4 of 20 · progress kept in this browser

A pair that hits the target

You have a list of numbers and a target. Find two different positions whose values add up to the target.

pair_with_sum([4, 7, 1, 5], 6)  # (2, 3)
pair_with_sum([3], 6)           # None

If several pairs work, return the one that finishes earliest, meaning the smallest second index. If several first indexes work with that second index, take the smallest.

Your task

Write pair_with_sum(numbers, target) returning (i, j) with i < j as described, or None if no pair adds up to the target.