You are given 2 positive integers l and r. For any number x, all positive divisors of x except x are called the proper divisors of x.
A number is called special if it has exactly 2 proper divisors. For example:
Return the count of numbers in the range [l, r] that are not special.
Example 1:
Input: l = 5, r = 7
Output: 3
Explanation:
There are no special numbers in the range [5, 7].
Example 2:
Input: l = 4, r = 16
Output: 11
Explanation:
The special numbers in the range [4, 16] are 4 and 9.
Constraints:
1 <= l <= r <= 109Solutions for this problem are being prepared.
Try solving it yourselfNUMBER OF ISLANDS - Leetcode 200 - Python • NeetCode • 384,140 views views
Watch 9 more video solutions →Practice Find the Count of Numbers Which Are Not Special with our built-in code editor and test cases.
Practice on FleetCodePractice this problem
Open in Editor