Prime Pairs with Target Sum - Sieve Method + two pointer's approach
IntuitionApproach

Sieve of Eratosthenes:
The sieve function generates a list of all prime numbers less than or equal to n. It marks non-prime numbers using a b
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
1. Sieve of Eratosthenes:
The sieve function generates a list of all prime numbers less than or equal to n. It marks non-prime numbers using a boolean array and returns a list of primes.

2. Two-pointer technique:
After generating all the primes, two pointers (i and j) are initialized at the start and end of the list of primes. We check if the sum of the primes at these positions equals n. If the sum is too large, we move the right pointer (j) left; if the sum is too small, we move the left pointer (i) right.
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(n log log n) + O(p)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(n)
# Code
```python3 []
class Solution:
    def findPrimePairs(self, n: int) -> List[List[int]]:

        def sieve(n):
            if n < 2:
                return []
            
            prime = [1] * (n + 1)
            prime[0] = prime[1] = 0

            for i in range(2, int(sqrt(n)) + 1):
                if prime[i] == 1:
                    for j in range(i * i, n + 1, i):
                        prime[j] = 0
            
            primes = [i for i in range(2, n + 1) if prime[i] == 1]
            return primes
        
        primes = sieve(n)
        i, j = 0, len(primes) -1
        res = []
       
        while i <= j:
            if primes[i] + primes[j] == n:
                res.append([primes[i], primes[j]])
                i, j = i + 1, j - 1
            elif primes[i] + primes[j] > n:
                j -= 1
            else:
                i += 1
        
        return res


```
['Python3']