Python Solution || Two pointer Approach
Approach\nstep 1: Generate all prime numbers in an efficient way\nstep 2: Apply two pointer method then add prime numbers in ans[]\n\n# Code\n\nclass Solution:\
# Approach\nstep 1: Generate all prime numbers in an efficient way\nstep 2: Apply two pointer method then add prime numbers in ans[]\n\n# Code\n```\nclass Solution:\n    def findPrimePairs(self, n: int) -> List[List[int]]:\n        def generate_primes(n):\n            prime = [True]*(n+1)\n            prime[0] = prime[1] = False\n            p = 2\n            while p*p<=n:\n                if prime[p]:\n                    for num in range(p*p,n+1,p):\n                        prime[num] = False               \n                p+=1\n        \n            ans = []\n            for i in range(2,n+1):\n                if prime[i]:\n                    ans.append(i)\n            return ans\n        \n        prime = generate_primes(n)\n        l,r=0,len(prime)-1\n        ans =[]\n        while(l<=r):\n            if prime[l]+ prime[r] == n:\n                ans.append([prime[l],prime[r]])\n                l+=1\n                r-=1\n            elif prime[l]+ prime[r] <n:\n                l+=1\n            else:\n                r-=1\n        return ans\n```        \n![Upvote.png](https://assets.leetcode.com/users/images/04c807e9-4167-4b0e-a922-38d56ba02f92_1688281684.0394893.png)\n
['Two Pointers', 'Python', 'Python3']