Computer Science, asked by fookme, 1 month ago

find the sum of prime numbers in an array

Answers

Answered by aparuparava07
1

Answer:

Efficient Approach: Generate all primes up to the maximum element of the array using the sieve of Eratosthenes and store them in a hash. Now traverse the array and find the sum of those elements which are prime using the sieve. Below is the implementation of the efficient approach: C++

Explanation:

hiii

Similar questions