No description
Find a file
2026-03-18 12:35:55 -07:00
.gitignore init 2022-01-21 13:12:47 -08:00
go.mod git repo update 2022-11-03 07:57:15 -07:00
go.sum add PermutationsAllSizes 2022-11-03 07:54:02 -07:00
LICENSE init 2022-01-21 13:12:47 -08:00
permutation.go add PermutationsAllSizes 2022-11-03 07:54:02 -07:00
permutation_test.go add PermutationsAllSizes 2022-11-03 07:54:02 -07:00
README Convert README from markdown to plaintext 2026-03-18 12:35:55 -07:00

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]