Java soln - Arrays
Intuitionin this problem, we are supposed to return List<List> with pairs that add up to target. it is very similar to 'Two Sum', we find the number and its com
# Intuition
in this problem, we are supposed to return List<List<Integer>> with pairs that add up to target. it is very similar to 'Two Sum', we find the number and its complement that add up to target except the numbers should be prime. We find List<Integer> prime using the same method as 'Count Prime' or 'Closest Prime Numbers in Range'

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public List<List<Integer>> findPrimePairs(int n) {

        // in this problem, we got to find the pair of prime numbers that eqals the target n.
        // it rings a bell similar to two sum problem?
        // the idea is to find the complement and return num and complement together except they have to be prime numbers

        // Step 1: Find prime numbers < n

        List<Integer> prime = new ArrayList<>();
        List<List<Integer>> result = new ArrayList<>();
        boolean[] multiple = new boolean[n+1];
        multiple[0]=true;
        multiple[1]=true;
    // works for smaller numbers best
    for (int num=2; num<=n; num++){
            if (multiple[num]==true){
                continue;
            }
            prime.add(num);

            for (long mult=(long)num*num; mult<=n; mult=mult+num){
                multiple[(int)mult]=true;
            }
    }

    // using this way because the usual way doesn't work for large n's
       /*
       for (int num = 2;  num <= n; num++) {
            if (isPrime(num)){
                prime.add(num);
            }
        }
        */

        // Step 2: find num and its complement similar to Two Sum
        /* // not working for large numbers
        for (int num=2; num<=n; num++){
            int complement = n - num;
            if (prime.contains(num) && prime.contains(complement) && num <= complement){
                List<Integer> pair = new ArrayList<>();
                pair.add(num);
                pair.add(complement);
                result.add(pair);
            }
        }
        */
        for (int num = 2; num <=n/2; num++) {
            int complement = n - num;
              if(!multiple[num] && !multiple[complement]){
                    List<Integer> pair = new ArrayList<>();
                    pair.add(num);
                    pair.add(complement);
                    result.add(pair);
              }
        }

        return result;
    }
/* not using but works!!
    private boolean isPrime(int n){
        for (int i=2; i<=(int)Math.sqrt(n); i++){
            if (n % i == 0){
                return false;
            }
        }
        return true;
    }
    */ 
}
```
['Java']