Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3233. Find the Count of Numbers Which Are Not Special
Count how many integers in [l, r] are not "special", where a "special" number has exactly two proper divisors — equivalently, it is a prime square (has exactly three total divisors). So the answer is (r−l+1) minus the number of primes p with p^2 in [l, r] (i.e., primes in [ceil(sqrt(l)), floor(sqrt(r))]).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.