Dsa
Math
Easy
Counting Distinct Prime Factors
Given an integer n, count the number of distinct prime factors of n.
Input:
- A single integer n (1 <= n <= 10^6).
Output:
- An integer representing the count of distinct prime factors of n.
Example:
Input:
28
Output:
2
Key concepts
mathprimefactors
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