- Last Change:
- Clone URL:
ssh://anonymous@eburk.gothub.org:2249/permutation.git
- ECDSA:
SHA256:+8G/Cmnl/Se78PfC8/Aumjmkg6wQkPq3/HLtpMGk9Mg
- ED25519:
SHA256:M7nNXWPL7issS+0friWxnfLWAGKINNnhpll5ya6+joE
- RSA:
SHA256:kDHbPppFW4cpshA1S87hfVB25qb0dVZ/gAeCeSx9pgE
Commit Briefs
Branches
Tree
| .gitignore | commits | blame |
| LICENSE | commits | blame |
| README | commits | blame |
| go.mod | commits | blame |
| go.sum | commits | blame |
| permutation.go | commits | blame |
| permutation_test.go | commits | blame |
README
permutation
A simple permutation package using generics. Requires go1.18 or higher
-- Install --
go get github.com/fputs/permutation@latest
-- Usage --
package main
import (
"fmt"
perm "github.com/fputs/permutation"
)
func main() {
a := []int{1, 2, 3}
p := perm.Permutations(a)
fmt.Println(p)
}
result:
[1 2 3]
[2 1 3]
[3 1 2]
[1 3 2]
[2 3 1]
[3 2 1]
