mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-25 21:23:21 +08:00
* Retranslate the complete Japanese online edition from Chinese * Fit Japanese homepage labels and localize heading permalinks * Point Japanese contribution instructions to the Japanese preview * Replace locale conditionals with multilingual UI tables
34 lines
638 B
Go
34 lines
638 B
Go
// File: permutation_test.go
|
|
// Created Time: 2023-05-09
|
|
// Author: Reanon (793584285@qq.com)
|
|
|
|
package chapter_backtracking
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
. "github.com/krahets/hello-algo/pkg"
|
|
)
|
|
|
|
func TestPermutationI(t *testing.T) {
|
|
/* すべての順列 I */
|
|
nums := []int{1, 2, 3}
|
|
fmt.Printf("入力配列 nums = ")
|
|
PrintSlice(nums)
|
|
|
|
res := permutationsI(nums)
|
|
fmt.Printf("すべての順列 res = ")
|
|
fmt.Println(res)
|
|
}
|
|
|
|
func TestPermutationII(t *testing.T) {
|
|
nums := []int{1, 2, 2}
|
|
fmt.Printf("入力配列 nums = ")
|
|
PrintSlice(nums)
|
|
|
|
res := permutationsII(nums)
|
|
fmt.Printf("すべての順列 res = ")
|
|
fmt.Println(res)
|
|
}
|