[Java] Counting solution 0ms
\nclass Solution {\n    public int numPrimeArrangements(int n) {\n        int [] primes = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,9
```\nclass Solution {\n    public int numPrimeArrangements(int n) {\n        int [] primes = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};\n        int primeCount = n >= 97 ? primes.length : 0;\n        \n        for(int i = 0; i < primes.length; ++i){\n            if(primes[i] >= n){\n                primeCount = primes[i] > n ? i : i + 1;\n                break;\n            }\n        }\n        \n        return (int) (fact(primeCount) * fact(n - primeCount) % 1000000007);\n    }\n    \n    public long fact(int num){\n        if(num <= 1) return 1;\n        return (num * fact(num - 1)) % 1000000007;\n    }\n}\n\n```
['Java']