Count Primes in Range Problem
Count Primes in Range Problem — ExecCode Easy DSA Practice
Solve the Count Primes in Range problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given the input needed to solve Count Primes in Range. Your task is to compute the required answer and return count of primes less than n. n: upper bound (exclusive).
Examples
Input {"n": 10}; Output 4. Input {"n": 0}; Output 0. Input {"n": 1}; Output 0
Constraints
0 <= n <= 5*10^6
Practice Count Primes in Range free on ExecCode. Browse DSA problems, topic map, and placement guides.