I have a requirement that i need to not get the full cartesian product
but a unique ordered single product of an array with nested arrays. For
example.
[[“X”,“Y”] , [“E”], [“S”,“T”,“R”] ]
My requirement is that the function would generate
[“X”, “E”, “S”]
[“X”, “E”, “T”]
[“X”, “E”, “R”]
[“Y”, “E”, “S”]
[“Y”, “E”, “T”]
[“Y”, “E”, “R”]
I started writing a function with recursion to do it but i though there
must be a nicer way. If anyone had suggestions on a nice way to get the
results that would be great.
Thanks.