Simple and faster using sieve of eratosthenes
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public List<List<Integer>> findPrimePairs(int n) {\n        List<List<Integer>> li=new ArrayList<>();\n        if(n<4){\n            return li;\n        }\n        boolean[] ans=prime(n+1);\n        for(int i=2;i<=n/2+1;i++){\n            if(!ans[i]){\n                int a=n-i;\n                if(!ans[a]&&i<=a){\n                    li.add(new ArrayList<>(Arrays.asList(i,a)));\n                }\n            }\n        }\n        return li;\n    }\n    public static boolean[] prime(int n) {\n\tboolean[]arr=new boolean[n+1];\n\tarr[0]=arr[1]=true;\n\tfor(int i=2;i<arr.length;i++) {\n\t\tif(!arr[i]) {\n\t\t\tfor(int k=2;k*i<arr.length;k++) {\n\t\t\t\tarr[i*k]=true;\n\t\t\t}\n\t\t}\n\t}\n\treturn arr;\n\t}\n}\n```
['Java']