GFG | Problem of the Day : Super Primes

Опубликовано: 21 Июль 2026
на канале: Learn Together
1,099
16

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

Example 1:

Input:
N = 5
Output: 1
Explanation: 5 = 2 + 3, 5 is the
only super prime

Example 2:

Input:
N = 10
Output: 2
Explanation: 5 and 7 are super primes

Your Task:
You don't need to read input or print anything. Your task is to complete the function superPrimes() which takes the N as input and returns the count of super primes.

Expected Time Complexity: O(Nlog(logN))
Expected Auxiliary Space: O(N)