Using two pointers and boolena
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```java []\nclass Solution {\n    public List<List<Integer>> findPrimePairs(int n) {\n        boolean [] arr = new boolean[n+1] ;\n        for ( int i = 2 ; i < n+1 ; i ++ ){\n            if (arr[i] == false  ){\n                if ( n/i > 1 ) {\n                    for ( int j = 2 ; j < (n/i + 1) ; j++ ){\n                        arr[i*j] = true ;\n                    }\n                }\n            }\n        }\n        List <Integer>  primes = new ArrayList<> () ; \n        for ( int i = 2 ; i < n+1 ; i++ ){\n            if ( ! arr[i] ){\n                primes.add(i) ;\n            }\n        }\n        int low = 0 , high = primes.size() -1 ;\n        List <List<Integer>> pairs = new ArrayList<>();\n        while ( low <= high ){\n            int sum = primes.get(low) + primes.get(high) ;\n            if ( sum == n ) {\n                pairs.add(List.of(primes.get(low),primes.get(high)));\n                low ++ ;\n                high -- ;\n            }\n            else if ( sum < n ) {\n                low ++ ;\n            }\n            else {\n                high -- ;\n            }\n        }\n        return pairs ;\n    }\n}\n```
['Java']