backtracking

package
v0.0.0-...-eb09a2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPermutation

func GetPermutation(n int, k int) string
Example
package main

import (
	"fmt"
)

type question60 struct {
	para60
	ans60
}

// para 是参数
// one 代表第一个参数
type para60 struct {
	n int
	k int
}

// ans 是答案
// one 代表第一个答案
type ans60 struct {
	one string
}

func main() {

	qs := []question60{

		{
			para60{3, 3},
			ans60{"213"},
		},

		{
			para60{4, 9},
			ans60{"2314"},
		},
	}

	for _, q := range qs {
		_, p := q.ans60, q.para60
		fmt.Println(p, GetPermutation(p.n, p.k))
	}
}
Output:

{3 3} 213
{4 9} 2314

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL