Skip to main content
2 of 5
added 7 characters in body
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

C (gcc), 40 39 32 bytes

Saved 7 bytes using formula from xnor's Python answer!!!

f(n){n=n>9?10*f(n/10):5>>5/-~n;}

Try it online!

Noodle9
  • 20.3k
  • 3
  • 21
  • 46