Let's say I have 10 types of fruit, and 10 jars to put them in. What would be the best way of writing a function that creates every possibility without repeating itself?
Here is an example of what I mean with 3 dimensions instead of 10. The function could produce an array of what is in each jar for every possible combination.
[[Apple, Orange, Banana], [Apple, Banana, Orange], [Orange, Apple, Banana], [Orange, Banana, Apple], [Banana, Apple, Orange], [Banana, Orange, Apple]]