Sieve of Eratosthenes + Two Pointers | C++
\nclass Solution {\n    vector<int> findPrimes(int n) {\n        vector<int> v(n + 1), ans;\n        \n        for(int i=2; i<=sqrt(n); i++) {\n            if(!
```\nclass Solution {\n    vector<int> findPrimes(int n) {\n        vector<int> v(n + 1), ans;\n        \n        for(int i=2; i<=sqrt(n); i++) {\n            if(!v[i]) {\n                for(int j=i*i; j<=n; j+=i) v[j] = 1;\n            }\n        }\n        \n        for(int i=2; i<=n; i++) {\n            if(!v[i]) ans.push_back(i);\n        }\n        return ans;\n    }\npublic:\n    vector<vector<int>> findPrimePairs(int n) {\n        vector<int> primes = findPrimes(n);\n        \n        vector<vector<int>> ans;\n        int s = 0, e = primes.size() - 1;\n        \n        while(s <= e) {\n            if(primes[s] + primes[e] == n) ans.push_back({primes[s], primes[e]}), s++;\n            else if(primes[s] + primes[e] < n) s++;\n            else e--;\n        }\n        return ans;\n    }\n};\n```
['Two Pointers', 'C++']