Closed PhilWaldmann closed 6 years ago
combinations with repetition are currently not supported, right? Something like that would be awesome!
Combinatorics.combinationWithRep(['a', 'b', 'c'], 4) /* => [ [ 'a', 'a', 'a', 'a' ], [ 'a', 'a', 'a', 'b' ], [ 'a', 'a', 'a', 'c' ], [ 'a', 'a', 'b', 'b' ], [ 'a', 'a', 'b', 'c' ], [ 'a', 'a', 'c', 'c' ], [ 'a', 'b', 'b', 'b' ], [ 'a', 'b', 'b', 'c' ], [ 'a', 'b', 'c', 'c' ], [ 'a', 'c', 'c', 'c' ], [ 'b', 'b', 'b', 'b' ], [ 'b', 'b', 'b', 'c' ], [ 'b', 'b', 'c', 'c' ], [ 'b', 'c', 'c', 'c' ], [ 'c', 'c', 'c', 'c' ] ] */
baseN essentially does this, just not in the order you are indicating
combinations with repetition are currently not supported, right? Something like that would be awesome!