Skip to content

Instantly share code, notes, and snippets.

@dimiro1
Created May 25, 2015 23:56
Show Gist options
  • Save dimiro1/c2dbfa8f0d32817b71e0 to your computer and use it in GitHub Desktop.
Save dimiro1/c2dbfa8f0d32817b71e0 to your computer and use it in GitHub Desktop.
Permutations Ruby
[2,3,5,6,7,9].permutation(3).map {|e| e.join.to_i % 5 == 0 }.count { |i| i == true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment