✅C++ || Two Pointer || Sieve of eratosthenes
Code\n\nclass Solution {\n    private:\n            void findSubSet( vector<vector<int>>&ans, vector<int>&nums, int n){\n        int i=0,j=nums.size()-1;\n     
# Code\n```\nclass Solution {\n    private:\n            void findSubSet( vector<vector<int>>&ans, vector<int>&nums, int n){\n        int i=0,j=nums.size()-1;\n        while(i<=j){\n            if(nums[i]+nums[j]==n){\n                ans.push_back({nums[i],nums[j]});\n                i++;\n                j--;\n            }\n            else if(nums[i]+nums[j]<n)\n            i++;\n            else\n            j--;\n        }\n    }\n    \npublic:\n    vector<vector<int>> findPrimePairs(int n) {\n        vector<vector<int>>ans;\n        vector<int>v;\n        vector<int>store;\n               vector<bool>prime(n+1,true);\n            prime[0]=prime[1]=false;\n        \n             for(int i=2;i<n;i++){\n             if(prime[i])\n             v.push_back(i);\n             for(int j=2*i;j<n;j+=i)   \n             prime[j]=false;\n             }\n                \n        // sort(v.begin(),v.end());\n       findSubSet(ans,v, n);\n        return ans;\n        \n    }\n};\n```\n# Please Upvote!
['Two Pointers', 'C++']