leetle

Daily challenge for 2026-06-01

517. Unique Sum of Distinct Pairs

Given an array of integers nums, find all unique pairs (a, b) such that a + b is a unique sum that appears exactly once across all possible pairs of elements at different indices. Return the total number of such unique sums.

Example:
Input: nums = [1, 2, 3]
Output: 3
Explanation: Pairs are (1,2) sum 3, (1,3) sum 4, (2,3) sum 5. All sums [3, 4, 5] are unique.

Run this challenge interactively in Python or JavaScript when the app loads.