Created
November 15, 2015 11:42
-
-
Save seanhandley/e71e1f46a8574c581b37 to your computer and use it in GitHub Desktop.
Einstein 16: Permutation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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