Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Einstein 16: Permutation
def q(a)
a.permutation
end
q([1,2,3]).to_a # => [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
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.