https://github.com/akramarenkov/combin
Library that provides to drawn combinations
https://github.com/akramarenkov/combin
combinations go golang
Last synced: over 1 year ago
JSON representation
Library that provides to drawn combinations
- Host: GitHub
- URL: https://github.com/akramarenkov/combin
- Owner: akramarenkov
- License: mit
- Created: 2024-12-31T02:05:25.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-22T10:40:07.000Z (over 1 year ago)
- Last Synced: 2025-02-22T11:26:55.230Z (over 1 year ago)
- Topics: combinations, go, golang
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Combin
[](https://pkg.go.dev/github.com/akramarenkov/combin)
[](https://goreportcard.com/report/github.com/akramarenkov/combin)
[](https://coveralls.io/github/akramarenkov/combin)
## Purpose
Library that provides to drawn combinations
## Usage
Example:
```go
package main
import (
"fmt"
"github.com/akramarenkov/combin"
)
func main() {
for combination := range combin.Every([]int{4, 3, 2, 1}) {
fmt.Println(combination)
}
// Output:
// [4]
// [4 3]
// [4 3 2]
// [4 3 2 1]
// [4 3 1]
// [4 2]
// [4 2 1]
// [4 1]
// [3]
// [3 2]
// [3 2 1]
// [3 1]
// [2]
// [2 1]
// [1]
}
```