β back to unit
Medium
# puzzle gauntlet medium
The Gift Card Puzzle
The gift card holds exactly target coins, and toy-store rules say: buy exactly TWO toys, spend it ALL. π
You get the toy prices and the target (exactly one pair works). Print the two winning prices, smaller first, separated by a space.
Example:
Input: prices = [3, 9, 4, 6], target = 10
Output: 4 6
Checking every pair, 4 + 6 = 10 is the only pair that hits the target exactly.
π‘ need a hint?
pg-gift-card.pyπ given lines are locked β write your code in between
loading...