Skip to main content
added 87 characters in body
Source Link
Chas Brown
  • 9.8k
  • 1
  • 13
  • 39

Python 2, 6060 59 bytes

f=lambda A,*x:A and[[v]+u[[v]+u for v in A[0]forA for u in x and f(A[1:]*x)]or[[]]or[[]]]

Try it online!Try it online!

1 byte thx to ovs.

Look Ma! No itertools!

Python 2, 60 bytes

f=lambda A:A and[[v]+u for v in A[0]for u in f(A[1:])]or[[]]

Try it online!

Look Ma! No itertools!

Python 2, 60 59 bytes

f=lambda A,*x:[[v]+u for v in A for u in x and f(*x)or[[]]]

Try it online!

1 byte thx to ovs.

Look Ma! No itertools!

Source Link
Chas Brown
  • 9.8k
  • 1
  • 13
  • 39

Python 2, 60 bytes

f=lambda A:A and[[v]+u for v in A[0]for u in f(A[1:])]or[[]]

Try it online!

Look Ma! No itertools!