Using Standard Sieve of Eratosthenes Concept
IntuitionI have used the Sieve of Eratosthenes to identify prime numbers up to (10^6) and then found all pairs of these primes that sum up to a given integer (n
# Intuition
  I have used the Sieve of Eratosthenes to identify prime numbers up to \(10^6\) and then found all pairs of these primes that sum up to a given integer \(n\).

# Approach
  Certainly! Here's a brief explanation of the second half of the code:

After identifying prime numbers using the Sieve of Eratosthenes, the code iterates through numbers from 2 to \(n/2\). For each number \(i\), it checks if both \(i\) and \(n - i\) are prime. If they are, it adds the pair \([i, n - i]\) to the result list. This ensures that all pairs of prime numbers that sum up to \(n\) are found and stored in the result list. Finally, the function returns this list of prime pairs.

# Complexity
- Time complexity:
  O(nlogn)

- Space complexity:
  O(n)

# Code
```java []
class Solution {
    public List<List<Integer>> findPrimePairs(int n) {
        List<List<Integer>> res = new ArrayList<>();
        int[] sieve = new int[1000001];
        for (int i = 2; i <= Math.sqrt(1000000); i++) {
            if (sieve[i] == 0) {
                for (int j = i * i; j <= 1000000; j += i)
                    sieve[j] = 1;
            }
        }
        for (int i = 2; i <= n - i; i++) {
            if (sieve[i] == 0 && sieve[n - i] == 0) {
                List<Integer> ans = new ArrayList<>();
                ans.add(i);
                ans.add(n - i);
                res.add(ans);
            }
        }
        return res;
    }
}
```
['Array', 'Math', 'Java']