SIEVE OF ERATOSTHENES
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
```cpp []
class Solution {
public:
    vector<vector<int>> findPrimePairs(int n) {
        vector<int> prime(n+1,1);
        prime[0]=0;
        prime[1]=0;
        for(int i=2; i*i<=n; i++){
            if(prime[i]){
                for(int j=i*i; j<=n; j+=i){
                    prime[j]=0;
                }
            }
        }
        vector<int> arr;
        for(int i=2; i<=n; i++){
            if(prime[i])
                arr.push_back(i);
        }
        vector<vector<int>> brr;
        map<int, int> mp;
        
        for(int i=0; i<arr.size(); i++){
            mp[arr[i]]++;
            int y=n-arr[i];
            if(mp.find(y)!=mp.end()){
                brr.push_back({arr[i], y});
            }
        }
        for(int i=0; i<brr.size(); i++){
            if(brr[i][0]>brr[i][1])
                swap(brr[i][1], brr[i][0]);
        }
        sort(brr.begin(), brr.end());
        return brr;
    }
};
```
['Math', 'Ordered Map', 'Enumeration', 'C++']