Simple java solution
Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n\nclass Solution {\n    public List<List<Integer>> findPrimePairs(int n) {\n        L
# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```\nclass Solution {\n    public List<List<Integer>> findPrimePairs(int n) {\n        List<List<Integer>> nm=new ArrayList<>();\n        if(n<=2)\n        {\n            return nm;\n        }\n        boolean k[]=new boolean[n+1];\n        Arrays.fill(k,true);\n        k[0]=k[1]=false;\n        for(int i=2;i<=Math.sqrt(n);i++)\n        {\n            if(k[i])\n            {\n                for(int j=i*i;j<=n;j+=i)\n                {\n                    k[j]=false;\n                }\n            }\n        }\n        List<Integer> kk=new ArrayList<>();\n        for(int i=2;i<=n;i++)\n        {\n            if(k[i])\n            {\n                kk.add(i);\n            }\n        }\n        for(int i=0;i<kk.size();i++)\n        {\n            int a=kk.get(i);\n            int b=n-a;\n            boolean value = binary_search(kk,b);\n            if(value && a<=b)\n            {\n                nm.add(new ArrayList<>(Arrays.asList(a,b)));\n            }\n        }\n        return nm;\n    }\n    public boolean binary_search(List<Integer> nm, int val)\n    {\n        int i=0,j=nm.size()-1;\n        while(i<=j)\n        {\n            int mid=i+(j-i)/2;\n            if(nm.get(mid) == val)\n            {\n                return true;\n            }\n            else if(nm.get(mid) > val)\n            {\n                j=mid-1;\n            }\n            else\n            {\n                i=mid+1;\n            }\n        }\n        return false;\n    }\n}\n```
['Binary Search', 'Java']