I am trying to implement a cartesian product of an arbitrary number of lists. I have been thinking about this for hours, and I can't figure it out.
For example, if I have:
list letter = [1, 2, 3] list num = [a, b, c]
then we will print cartesian product of:
- letter x letter
- letter x num
- num x num
- num x letter
However, if i had a fixed number of lists, it would be easy. But I don't know how to do an arbitrary number of lists.