Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[ ["-71", "-49"], ["-47", "-37"], ["-73"] ] =returns=> [ ["-71", "-47", "-73"] ["-71", "-37", "-73"] ["-49", "-47", "-73"] ["-49", "-37", "-73"] ]
or
[
["-71", "-49"],
["-47", "-37"],
["-73"]
]
returns
[
["-71", "-47", "-73"]
["-71", "-37", "-73"]
["-49", "-47", "-73"]
["-49", "-37", "-73"]
]
set = Set.new ["-71", "-49"]
set.cartesian_product( ["-47", "-37"], ["-73"] )
#<Set: {#<Set: {"-71", "-73", "-47"}>, #<Set: {"-49", "-73", "-47"}>, #<Set: {"-71", "-73", "-37"}>, #<Set: {"-49", "-73", "-37"}>}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.