# puzzle gauntlet medium

Closest to the Target

Nobody hit the target number exactly β€” so the prize goes to the PAIR whose sum lands nearest it. 🎯

You get the nums (at least two) and the target (exactly one pair-sum is nearest). Print that closest pair-sum.

Example:

Input: nums = [1, 8, 4, 10], target = 13 Output: 12

The pair-sums are 9, 5, 11, 12, 18, 14 β€” 12 (from 8 + 4) is closest to 13, off by just 1.

πŸ’‘ need a hint?

pg-closest-to-target.pyπŸ”’ given lines are locked β€” write your code in between
loading...