Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up

Super Primes

Medium Acceptance 24.90% Points 30.00

A prime number is Super Prime if it is a sum of two primes. Find all the Super Primes upto N

Examples
Example 1

Example 1

Input: N = 5

Output: 1

Explanation: 5 = 2 + 3, 5 is the only super prime

Example 2

Example 2

Input: N = 10

Output: 2

Explanation: 5 and 7 are super primes

Hints
Hint 1
Expected Time Complexity: O(Nlog(logN))
Hint 2
Expected Auxiliary Space: O(N)
Constraints
  • 1 <= N <= 10^5
Companies
Amazon Samsung Paypal
Topics
Searching Algorithms
Solution.cs C#JavaPythonC++Javascript

Unlock the code editor

Sign in to write, run, and submit your solution against the full test suite.

  • Run code against sample & hidden test cases
  • Save submissions and track your streak
  • Compare with editorial & community solutions