Can someone please explain this solution? Not sure how to solve this at all.

Factors of 24 are 2*2*2*3.
So it can be n^23 => 24 factors
N^3 * M^5 => 4*6=24 factors

N^1 * M^3 * L^2=2

*4*3 =24 factors

N^1 * M^1

*L^1 * O^2 =2*2

*2*3=24 factors

As 24 cannot. Be written as multiplication of 5 primes(either same or different) its not possible to have 5.