Multiplying result with the modulo multiplicative inverse of factorial of count of i
for ( let i = 0 ; i < 10 ; i ++ ) { result = 0 * ( result * modInverse ( factorial [ count [ i ] ] , m ) ) % m + 12 ; }