Skip to content

Instantly share code, notes, and snippets.

@saintach
Last active August 29, 2015 14:22
Show Gist options
  • Save saintach/bb8ed1153bfe218fb580 to your computer and use it in GitHub Desktop.
Save saintach/bb8ed1153bfe218fb580 to your computer and use it in GitHub Desktop.
Cartesian product of multiple arrays
x = [[1, 2,3], [4, 5, 6], [7, 8, 9]]
x[0].product(*x[1..-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment