题目描述
Given a number N, find the maximum number of unique prime factors any number can have in range [1, N].
Example 1:
Input:
N = 3
Output:
1
Explanation:
No number in the range 1 to 3
can have more than 1 unique
Prime factor. So, the Output is 1.
Example 2:
Input:
N = 500
Output:
4
Explanation:
No number in the range 1 to 500
can have more than 4 unique
Prime factors. So, the Output is 4.
An example of a number with 4
unique Prime Factors is 210.
Your Task:
You don't need to read input or print anything. Your task is to complete the function maxUniquePrimeFactors() which takes an Integer N as input and returns the answer.
Expected Time Complexity: O(Largest Prime Factor of N)
Expected Auxiliary Space: O(1)
Constraints:
1 <= N <= 10^{18}
输入格式
见题面
输出格式
见题面