Sha256: e1b3bb5a53c07090455198edee6c8ea9c1c8c05c02ea4f5e8455be6fda4b0d6f

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

## Array#unique_permutation

    require 'facets/array/unique_permutation'
    
Enumerates permutation of Array.  Unlike Array#permutation, there are no 
duplicates in generated permutations.  Instead elements must be comparable

      p = [1,1,2,2,3].unique_permutation(2).to_a
      e = [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2]]
      p.assert == e

      [1,1,2,3].unique_permutation.to_a.assert != [1,1,2,3].permutation.to_a

      [1,1,2,3].unique_permutation.to_a.assert == [1,1,2,3].permutation.to_a.uniq

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 demo/core/array/unique_permutation.md
facets-3.1.0 demo/core/array/unique_permutation.md