Skip to main content
3 of 3
Correcting the answer
Sherlock9
  • 12.4k
  • 1
  • 32
  • 68

Actually, 14 18 bytes

A simple algorithm.

Edit: Fixing a bug for n == 1

;;D╤$0D@H@u*'1@+╪i 

Ungolfing

 Implicit input: n ;; Duplicate n twice. D╤$ Push str(10**(n-1)) 0D@H Push str(10**(n-1))[:-1] @u* Push str * (n+1) '1@+ Append a "1" ╪ Split into chunks of length n i Flatten this list onto the stack Implicit print 

Try it online!

Sherlock9
  • 12.4k
  • 1
  • 32
  • 68