Given a number N find the product of all unique prime factors of that number.
Input: N = 5 Output: 5 Explanation: 5 has 1 prime factor i.e 5 only.
Input: N = 24 Output: 6 Explanation: 24 has 2 prime factors 3 and 2 where 3*2 = 6
You don't need to read input or print anything. Your task is to complete the function primeProduct() which takes an integer N as input parameters and returns an integer, product of all the prime factors of N.
Expected Time Complexity: O(sqrt(N))
Expected Space Complexity: O(1)
1 <= N <= 105
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.