Distinct Prime Factors — Solution & Editorial
Factorize by trial division to √N and count distinct primes found (plus the leftover prime, if any).
Complexity: O(√N)
Factorize by trial division to √N and count distinct primes found (plus the leftover prime, if any).
Complexity: O(√N)