[python] *understanding the question* with solution and comments
Original Question:\nReturn the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.)\n\n(Recall that an integer is prime if a
**Original Question:**\nReturn the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.)\n\n(Recall that an integer is prime if and only if it is greater than 1, and cannot be written as a product of two positive integers both smaller than it.)\n\nSince the answer may be large, return the answer modulo 10^9 + 7.\n\n**More Descriptive Example:**\nreturn the (factorial of length n_prime) multiplyed by (factorial of length n_non_prime) mod (10^9 + 7)\n\nexample:\nn = 5\nn_array = [1,2,3,4,5]\nn_non_prime = [1,4]\nlength_n_non_prime = 2 \nn_prime = [2,3,5]\nlength_n_prime = 3 \n3! * 2! mod (10^9 + 7)\n\n**My Solution:**\n```python\n# Runtime: 40 ms, faster than 75.00%\n# Memory Usage: 13.5 MB, less than 100.00%\nfrom functools import reduce\nfrom operator import mul\n\nclass Solution:\n    def numPrimeArrangements(self, n):\n        if n == 1:\n            return 1\n\t\t\t\n\t\t# the list of primes from 1 to 100\n        prime = [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\t\t\n\t\t# the number of primes to n\n        number_primes = len(list(filter(lambda x: x <= n, prime)))\n        \n\t\t# factorial of prime\n\t\tfact_prime = reduce(mul, list(range(1,number_primes + 1)))\n\t\t\n\t\t# factorial of  non prime \n        fact_non = reduce(mul, list(range(1, 1 + n - number_primes)))\n\t\t\n        return fact_prime * fact_non % (10 ** 9 + 7)\n```
[]