MeetCode
Home
Doubts
Why is my C function not returning the …
Solved
1
49
Ask Doubt
View All Doubts
Solvers Leaderboard
Tutorials
Quiz
All Tests
Leaderboard
My Tasks
User Login
Dark
Enable Notifications
Toggle navigation
Count Primes Up To N
Computer Mathematics
Medium
4 views
Back to Questions
View Answer
0
Previous
Prime Factorization List
Medium
P
Next
Goldbach Pair (Even)
Hard
N
Problem Description
Given n
Input Format
One integer n.
Output Format
One integer count.
Sample Test Case
Input:
10
Output:
4
Constraints
1
Official Solution
Use sieve: mark composites. Count numbers >=2 not marked.
Please
login
to submit solutions and comments.
Solutions (0)
No solutions submitted yet. Be the first!
Discussion (0)
No comments yet. Start the discussion!
Prev
Next
Fullscreen Editor
0 lines • 0 chars
Esc close • Tab indent
No comments yet. Start the discussion!