Skip to main content
3 of 3
switched from Classic to Unicode because the code that enables boxing stopped working in Classic
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Unicode), 13 bytesSBCS

⊃,/,¨∘.,\⎕⍴⊂⍞

Try it online!

never miss an opportunity to use a scan :)

prompts for a string of "digits" and then for n

thanks @Adám for telling me how to enable ]box on TIO

ngn
  • 15.3k
  • 2
  • 43
  • 87