BackmediumArrays arrays medium

Unique Pairs With Target Sum Solution

Problem Statement

You are given an array of integers `nums` and a target sum `target`. Find all unique pairs in the array that add up to the `target` sum. The pairs can be in any order and can have any number of repeated elements.

Example 1
Input
{"array":[1,2,3,4,5,6,7],"targetSum":9}
Output
[[2,7],[3,6],[4,5]]

Explanation: Pairs that add up to the target sum 9

Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free