Created
January 14, 2020 00:16
-
-
Save hiwaldo89/94fc6ea425815f4e593bd3b17b20cae2 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
const nPalindromes = function(n) { | |
let sum = 0; | |
for (i; i < 10; i++) { | |
const palindromeNum = i.toString().repeat(n); | |
sum = sum + Number(palindromeNum); | |
} | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment