Simple Approach | Somewhat beginner friendly | beats 77% of the users!!!
Intuition\n Describe your first thoughts on how to solve this problem. \nUses Sieve of erasto#### and a simple while loop for finding pair sum.\n# Approach\n De
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nUses Sieve of erasto#### and a simple while loop for finding pair sum.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFirst create a array(hash table) of prime number less than the sum using sieve of eras####.\nThen using the array, create another simple array of prime numbers and using 2 pointer(left, right) start a simple while loop and start storing all the answers into the final answer array.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N\u2217Log(Log(N)))\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<vector<int>> findPrimePairs(int n) {\n        vector<int> prime(n + 1, 1);\n        prime[0] = prime[1] = 0;\n        for (int i = 2; i * i <= n; i++) {\n            if (prime[i] == 1) {\n                for (int j = i * i; j <= n; j += i) {\n                    prime[j] = 0;\n                }\n            }\n        }\n        vector<int> arr;\n        vector<vector<int>> ans;\n        for(int i=2; i<prime.size(); i++){\n            if(prime[i] == 1)\n            arr.push_back(i);\n        }\n        int l = 0, r = arr.size()-1;\n        while(l<=r){\n            int sum = arr[l]+arr[r];\n            if(sum == n){\n                ans.push_back({arr[l], arr[r]});\n                l++;\n                r--;\n            }else if(sum < n){\n                l++;\n            }else{\n                r--;\n            }\n        }\n        return ans;\n    }\n};\n```
['Array', 'Math', 'C++']