Easiest C++ Solution🔥🔥|| Easy to undertand
Intuition\n Describe your first thoughts on how to solve this problem. \nWe need to find the prime numbers that sum upto n. \n# Approach\n Describe your approac
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe need to find the prime numbers that sum upto n. \n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe need to calculate the integer x for which x and n-x both are primes . How can we check if an integer is prime and that too in log(log(n)) yes its sieve of eratosthenes. So we will use it to calculate the primes before starting our calculation and then will check if x and n-x are primes ,if then they are part of our answer. \n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n O(n log(log n)) As we are iterating for N/2 elements and for each element we are checking if its prime in O(Log(log(N))).\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N) as we are using a vector that can have atmost N/2 elements\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> findPrimePairs(int n) {\n        vector<vector<int>>v;\n        if(n==1)return v;\n        vector<int>prime(n+1,true);\n        prime[0]=0;\n        prime[1]=0;\n        \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        \n        for(int i=2;i<=n/2;i++)\n        {\n            if(prime[i] && prime[n-i])\n            {\n                vector<int>temp;\n                temp.push_back(i);\n                temp.push_back(n-i);\n                v.push_back(temp);\n            }\n        }\n        return v;\n    }\n};\n```
['Counting', 'C++']