Advertisement
nanenj

Facebook Post Permutation Sample

Jan 22nd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.21 KB | None | 0 0
  1. # Snippet Start
  2. set = %w(Logan Paul is an idiot)
  3. permutator = set.permutation 3
  4.  
  5. 3.times {
  6. permutator.next # => ["Logan", "Paul", "is"], ["Logan", "Paul", "an"], ["Logan", "Paul", "idiot"]
  7. }
  8. # Snippet End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement