Dsa
Math
Medium
Diverse Factors
Given an integer N, determine the count of distinct factors of N that are not present in its prime factors. A factor is defined as a number that divides N without leaving a remainder.
Input:
A single integer N (1 <= N <= 10^6).
Output:
An integer representing the count of diverse factors.
Example:
Input:
12
Output:
2
Explanation: The factors of 12 are 1, 2, 3, 4, 6, 12. The prime factors are 2 and 3. The diverse factors are 1, 4, 6, 12, hence the count is 4 - {2,3} = 2.
Key concepts
mathfactorizationdivisor
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