Count Pairs With Sum
Medium · rating 1350 · Hashing, Arrays
The first line has n and target t. The second line has n integers. Print the number of index pairs (i, j) with i < j and ai + aj = t.
Constraints: 1 ≤ n ≤ 105
Related problems
- Count Pairs With Difference — Medium
- Count Pairs with Sum — Medium
- Find the Duplicate — Medium
- Most Common Value — Medium
- Two Sum Exists — Medium
- Most Frequent Element — Medium