Skip to content

Instantly share code, notes, and snippets.

@RedSoxFan22
Created June 29, 2015 14:11
Show Gist options
  • Save RedSoxFan22/2d1f5dcade2c33848d95 to your computer and use it in GitHub Desktop.
Save RedSoxFan22/2d1f5dcade2c33848d95 to your computer and use it in GitHub Desktop.
def all_permutations(array)
a = []
if array.length == 0
return [[]]
elsif array.length == 1
a << (array)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment