Skip to content

Instantly share code, notes, and snippets.

@hiwaldo89
Created January 14, 2020 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiwaldo89/94fc6ea425815f4e593bd3b17b20cae2 to your computer and use it in GitHub Desktop.
Save hiwaldo89/94fc6ea425815f4e593bd3b17b20cae2 to your computer and use it in GitHub Desktop.
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