MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Combine

Method Combine

strings/combination/combination.go:22–33  ·  view source on GitHub ↗

Combine ...

(seed int)

Source from the content-addressed store, hash-verified

20
21// Combine ...
22func (c *Combinations) Combine(seed int) {
23 inLen := len(c.in)
24 for i := seed; i < inLen-1; i++ {
25 c.out = append(c.out, c.in[i])
26 fmt.Println(string(c.out))
27 c.Combine(i + 1)
28 c.out = c.out[:len(c.out)-1]
29 }
30 c.out = append(c.out, c.in[inLen-1])
31 fmt.Println(string(c.out))
32 c.out = c.out[:len(c.out)-1]
33}

Callers 1

StartFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected