Files
hello-algo/ja/codes/go/chapter_backtracking/permutation_test.go
Yudong Jin d7b2277d2b Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4

* Retranslate Japanese code with GPT-5.4
2026-03-30 07:30:15 +08:00

34 lines
629 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)
}