MutableCollectionType

protocol MutableCollectionType : MutableIndexable, CollectionType
  • Declaration

    Swift

    public mutating func nextLexPerm
        (isOrderedBefore: (Generator.Element, Generator.Element) -> Bool) -> Self?
  • Returns an array of the permutations of self, ordered lexicographically. - Note: The permutations returned follow self, so if self is not the first lexicographically ordered permutation, not all permutations will be returned. “`swift [1, 2, 3].lexPermutations()

    [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]] swift [3, 2, 1].lexPermutations()

    [[3, 2, 1]] ”`

    Declaration

    Swift

    public func lexPermutations() -> [[Generator.Element]]