Created
April 27, 2022 14:26
-
-
Save MuddyBootsCode/5537f05085ae234a8984bac4e51f22d2 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
function sumSquareDifference(n) { | |
let sum = 0; | |
let square = 0; | |
for(let i = 1; i <= n; i++){ | |
sum += i ** 2; | |
square += i; | |
} | |
return (square ** 2 - sum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment