代码拉取完成,页面将自动刷新
// Package combination ...
package combination
import "fmt"
// Combinations structure with in and out rune
type Combinations struct {
out []rune
in []rune
}
// Start ...
func Start(input string) {
c := &Combinations{
in: []rune(input),
}
c.Combine(0)
}
// Combine ...
func (c *Combinations) Combine(seed int) {
inLen := len(c.in)
for i := seed; i < inLen-1; i++ {
c.out = append(c.out, c.in[i])
fmt.Println(string(c.out))
c.Combine(i + 1)
c.out = c.out[:len(c.out)-1]
}
c.out = append(c.out, c.in[inLen-1])
fmt.Println(string(c.out))
c.out = c.out[:len(c.out)-1]
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。