Skip to content

Commit

Permalink
chore: update API comments after PR #12 changed input to generic arra…
Browse files Browse the repository at this point in the history
…ys (#15)
  • Loading branch information
giulianopz committed May 19, 2024
1 parent 3a0377e commit 9657a1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/mxschmitt/golang-combinations)](https://goreportcard.com/report/github.com/mxschmitt/golang-combinations)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

This package provides a method to generate all ordered combinations out of a given string array.
This package provides a method to generate all ordered combinations out of a given generic array.
This essentially creates the powerset of the given array except that the empty set is disregarded.

## Examples
Expand Down
6 changes: 3 additions & 3 deletions combinations.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Package combinations provides a method to generate all combinations out of a given string array.
// Package combinations provides a method to generate all combinations out of a given generic array.
package combinations

import "math/bits"

// All returns all combinations for a given string array.
// All returns all combinations for a given generic array.
// This is essentially a powerset of the given set except that the empty set is disregarded.
func All[T any](set []T) (subsets [][]T) {
length := uint(len(set))
Expand All @@ -27,7 +27,7 @@ func All[T any](set []T) (subsets [][]T) {
return subsets
}

// Combinations returns combinations of n elements for a given string array.
// Combinations returns combinations of n elements for a given generic array.
// For n < 1, it equals to All and returns all combinations.
func Combinations[T any](set []T, n int) (subsets [][]T) {
length := uint(len(set))
Expand Down

0 comments on commit 9657a1a

Please sign in to comment.