Search
⌘K

Leetcode 2761. Prime Pairs With Target Sum

Find all prime pairs (x, y) with 1 ≤ x ≤ y ≤ n and x + y = n, returning them sorted by x. With n ≤ 10^6 this is typically done by precomputing primes up to n (e.g., sieve) and checking complements for x in [2, n/2].


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.