Skip to content

Instantly share code, notes, and snippets.

@danwang
Created January 14, 2020 13:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danwang/7aa9dd50a7bcaba1e267f5f5e30ea84e to your computer and use it in GitHub Desktop.
Save danwang/7aa9dd50a7bcaba1e267f5f5e30ea84e to your computer and use it in GitHub Desktop.
nPalindromes
const nPalindromes = length =>
parseInt(
"4" +
"9".repeat(length - 1) +
"5" +
"0".repeat(Math.floor((length - 1) / 2))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment