we have to find prime factors of n! and k but in solution there is no calculation of n!.
A Factorial Problem
n! would be too large value. So we don’t calculate n! and then find its primes. We directly calculate prime factors of n! and their powers and compare them with those of k.