Optimised Easy C++ Solution || Beginner Friendly
\nclass Solution {\npublic:\n    bool isPrime(int n) {\n        if (n == 1) return false;\n        if (n == 2 || n == 3 || n == 5) return true;\n        if (n %
```\nclass Solution {\npublic:\n    bool isPrime(int n) {\n        if (n == 1) return false;\n        if (n == 2 || n == 3 || n == 5) return true;\n        if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0) return false;\n        for (int i = 5; i <= sqrt(n); i += 6) {\n            if (n % i == 0 || n % (i + 2) == 0)\n                return false;\n        }\n        return true;\n    }\n    vector<vector<int>> findPrimePairs(int n) {\n        vector<vector<int>>ans;\n        int low=1,high=n-1;\n        while(low<=high){\n            //cout<<low<<" "<<high<<"\\n";\n            if(isPrime(low)==true and isPrime(high)==true){\n                ans.push_back({low,high});\n            }          \n            low++,high--;\n        }\n        return ans;\n    }\n};\n```
['C']