Dsa
Math
Easy
Prime Factor Count
Write a function that counts the number of distinct prime factors of a given integer N. The function should read N and output the number of distinct prime factors.
Input:
An integer N (2 <= N <= 100000).
Output:
The count of distinct prime factors of N.
Example:
Input:
12
Output:
2
Key concepts
primefactors
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now