Skip to content

Instantly share code, notes, and snippets.

@naxmefy
Created May 6, 2021 02:07
Show Gist options
  • Save naxmefy/b351dd1bf3402bc049568c90dbaeb478 to your computer and use it in GitHub Desktop.
Save naxmefy/b351dd1bf3402bc049568c90dbaeb478 to your computer and use it in GitHub Desktop.
palindromes with N-Digits
n = parseInt(readline());
n -= 2
result = 9
result *= 10 ** ~~((n + 1) / 2)
console.log(result);
n=int(input())
print(9*10**(n//2-(n&1<1)))
p 9 * 10 ** (gets.to_i.pred / 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment