Created
March 13, 2020 00:32
-
-
Save dannyverp/ca79a4e7c4af0e2431d4250e21b04ace to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
sumOfPrimes(int max): int { | |
$total = 0; | |
for (int i = 1; i <= max; ++i) { | |
for (int j = 2; j < i; ++j) { | |
if (i % j == 0) { | |
continue; | |
} | |
} | |
total += i; | |
} | |
return total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment