2825 ms Beats 54.59% easy solution step by step
\n\nfrom typing import List\nfrom math import isqrt\n\nclass Solution:\n    def findPrimePairs(self, n: int) -> List[List[int]]:\n        if n <= 2:\n          
\n```\nfrom typing import List\nfrom math import isqrt\n\nclass Solution:\n    def findPrimePairs(self, n: int) -> List[List[int]]:\n        if n <= 2:\n            return []\n\n        def primenumber(n):\n            is_prime = [True] * n\n            is_prime[0] = False\n            is_prime[1] = False\n            for i in range(2, isqrt(n) + 1):\n                if is_prime[i]:\n                    for x in range(i * i, n, i):\n                        is_prime[x] = False\n            primes = [i for i in range(n) if is_prime[i]]\n            return primes\n        \n        primes = primenumber(n)\n        target = n\n        dic = {}\n        res = []\n        \n        # Add all primes to the dictionary for fast lookup\n        for prime in primes:\n            dic[prime] = True\n        \n        # Find pairs\n        for prime in primes:\n            complement = target - prime\n            if complement in dic and complement >= prime:\n                res.append([prime, complement])\n        \n        return res\n\n# Example usage\nsolution = Solution()\nprint(solution.findPrimePairs(10))  # Output: [[3, 7], [7, 3]]\n\n```
['Python3']