Skip to main content
-7 bytes
Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104

Haskell, 3939 32 bytes

No for loops/recursion at all, makes use of list comprehension and [a..b] which is equivalent to Python's range(a,b+1):

[[1..x]++tail(reverse[1x]++[x-1,x-2..x])|x<1]|x<-[1..9]]

Try it online!Try it online!

Haskell, 39 bytes

No for loops/recursion at all, makes use of list comprehension and [a..b] which is equivalent to Python's range(a,b+1):

[[1..x]++tail(reverse[1..x])|x<-[1..9]]

Try it online!

Haskell, 39 32 bytes

No for loops/recursion at all, makes use of list comprehension:

[[1..x]++[x-1,x-2..1]|x<-[1..9]]

Try it online!

Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104

Haskell, 39 bytes

No for loops/recursion at all, makes use of list comprehension and [a..b] which is equivalent to Python's range(a,b+1):

[[1..x]++tail(reverse[1..x])|x<-[1..9]]

Try it online!