Getting TLE CAN ANYONE HELP ...?
\nclass Solution {\n    int v=pow(10,9)+7;\n    private:\n     long long int fact(int n)\n             {\n               if(n==0 || n==1)\n               {\n   
````\nclass Solution {\n    int v=pow(10,9)+7;\n    private:\n     long long int fact(int n)\n             {\n               if(n==0 || n==1)\n               {\n                   return 1;\n               }\n                return n*fact(n-1);\n                 \n             }\npublic:\n    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        unordered_map<int,int>harsh;\n        for(int i=0;i<=24;i++)\n        {\n            harsh[primes[i]]++;\n        }\n        int cnt=0;\n      for(int i=1;i<=5;i++)\n      {\n          if(harsh.find(i)!=harsh.end())\n          {\n              cnt++;\n          }\n      }\n        return fact(cnt)*fact(n-cnt)%v;\n    }\n};\n````
[]