2761. Prime Pairs With Target Sum
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def findPrimePairs(self, n: int) -> List[List[int]]:
        if n < 2:
            return []

        sieve = [True] * (n + 1)
        sieve[0] = sieve[1] = False

        for i in range(2, int(n**0.5) + 1):
            if sieve[i]:
                for j in range(i * i, n + 1, i):
                    sieve[j] = False

        primes = [i for i in range(2, n + 1) if sieve[i]]
        prime_set = set(primes)

        result = []
        for prime in primes:
            if prime > n // 2:
                break
            complement = n - prime
            if complement in prime_set:
                result.append([prime, complement])

        return result

```
['Python3']