If I have list lets say for ex. four different list of numbers and i want to get all the different combinations between those, how can I achive it.
This could be what I want to bring as an input.
{1, 2, 3}
{2, 4}
{3, 4}
{5, 6}
And result should be something like this:
[[1, 2, 3, 5], [1, 2, 3, 6], [1, 2, 4, 5], [1, 2, 4, 6], [1, 4, 3, 5], [1, 4, 3, 6], [1, 4, 4, 5], [1, 4, 4, 6], [2, 2, 3, 5], [2, 2, 3, 6], [2, 2, 4, 5], [2, 2, 4, 6], [2, 4, 3, 5], [2, 4, 3, 6], [2, 4, 4, 5], [2, 4, 4, 6], [3, 2, 3, 5], [3, 2, 3, 6], [3, 2, 4, 5], [3, 2, 4, 6], [3, 4, 3, 5], [3, 4, 3, 6], [3, 4, 4, 5], [3, 4, 4, 6]]
I found this what is quite close what I try to do, but couldn't solve it. What is the best way to find all combinations of items in an array?