Dsa
Math
Medium
Product of Unique Prime Factors
Given a positive integer n, calculate the product of all unique prime factors of n. Print the result.
### Input Format:
A single integer n (1 <= n <= 10^6).
### Output Format:
A single integer representing the product of unique prime factors of n.
### Example:
Input:
30
Output:
15
### Explanation:
The prime factors of 30 are 2, 3, and 5. The product of unique prime factors is 2 * 3 * 5 = 30.
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