Write a function to calculate the sum of all prime numbers up to a given number.
MediumProblem Statement
Write a function to calculate the sum of all prime numbers up to a given number.
Sample Input
n = 10
Sample Output
17
Limits
Time: 2s · Memory: 256 MB