Skip to main content
3 of 3
Commonmark migration

Haskell, 14 = 28 bytes / 2

f n=n:[1..n-1]>>= \r->[r..n]

example output:

>f 5
[5,1,2,3,4,5,2,3,4,5,3,4,5,4,5]

24 bytes without the bonus:

f n=[1..n]>>= \r->[r..n]
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37