use sieve of eratosthenes.
Intuitionenvolved prime.use sieve of eratosthenes.Approachuse sieve of eratosthenes to mark the primes.use ordered set to store the primes.find the difference a
# Intuition
envolved prime.use sieve of eratosthenes.

# Approach
use sieve of eratosthenes to mark the primes.use ordered set to store the primes.find the difference and if found push it to the result vector

# Complexity
- Time complexity:


- Space complexity:
O(n*log(log(n)))

# Code
```cpp []
class Solution {
public:
    vector<vector<int>> findPrimePairs(int n) {
        vector<bool>isPrime(n+1,true);
        if(n<=2){
            return {};
        }
        isPrime[0]=false;
        isPrime[1]=false;
        for(int i=2;i*i<=n;i++){
            if(isPrime[i]==true){
                for(int j=2;i*j<=n;j++){
                    isPrime[i*j]=false;
                }
            }
        }
        set<int>st;
        for(int i=2;i<=n;i++){
            if(isPrime[i]==true){
                st.insert(i);

            }
        }
        vector<vector<int>>result;
        for(int x:st){
            int y=n-x;
            if(y<x){
                break;
            }
            if(st.count(y)){
                result.push_back({x,y});
            }
        }
        return result;

        
        
    }
};
```
['C++']