seive_of_erotosthenes C++
class Solution {\npublic:\n\n    int numPrimeArrangements(int n) {\n        if(n==1){\n            return 1;\n        }\n        vector arr(n+1,1);\n        arr
class Solution {\npublic:\n\n    int numPrimeArrangements(int n) {\n        if(n==1){\n            return 1;\n        }\n        vector<int> arr(n+1,1);\n        arr[0] = 0;\n        arr[1] = 0;\n        int count = 0;\n        for(int i = 2; i<=sqrt(n); i++){\n            for(int j = i*i; j<=n; j+=i){\n                if(arr[j]==1){\n                    arr[j] = 0;\n                }\n            }\n        }\n        \n        for(int i = 0; i<arr.size(); i++){\n            if(arr[i]==1){\n                count++;\n            }\n        }\n        long long int answer = 1;\n        int reverse = n - count;\n        \n        while(reverse!=1){\n            answer = answer*reverse%1000000007;\n            answer%1000000007;\n            reverse--;\n        }\n        while(count!=1){\n            answer = answer*count%1000000007;\n            answer%1000000007;\n            count--;\n        }\n        return answer;\n    }\n};\nPlease Upvote
['C']