Sponsored
Use these hints if you're stuck. Try solving on your own first.
Count how many times each number appears. If a number appears n times, then n * (n – 1) // 2 good pairs can be made with this number.
Solve with full IDE support and test cases