Easy to understand Java solution || Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n\n# Approach\n Describe your approach to solving the problem. \nObtain all the prime 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nObtain all the prime numbers less than n using sieve of eratosthenes. Iterate on all numbers less than n, say x. Check if x and n-x are primes. If they both are prime add it to list of answers.  \n\n# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\n```\nclass Solution {\n    \n    static boolean[] sieve=new boolean[1000001];\n\n    //function to build Prime Sieve \n    public void buildSieve(int n){\n        for(int i=0;i<n;i++){\n            if(i%2==0)\n                sieve[i]=false;\n            else\n                sieve[i]=true;\n        }\n        sieve[2]=true;\n        sieve[0]=false;\n        sieve[1]=false;\n        \n        for(int i=3;i*i<=n;i+=2){\n            if(sieve[i]==true){\n                for(int j=i*i;j<=n;j+=i){\n                    sieve[j]=false;\n                }\n            }\n        }\n    }\n    public List<List<Integer>> findPrimePairs(int n) {\n        \n        List<List<Integer>> ans=new ArrayList<>();\n        buildSieve(n);\n        for(int i=2;i<=n/2;i++){\n            if(sieve[i] && sieve[n-i]){\n                List<Integer> a=new ArrayList<>();\n                a.add(i);\n                a.add(n-i);\n                ans.add(a);\n            }\n        }\n        return ans;\n    }\n}\n```
['Math', 'Java']