Files
hello-algo/ja/codes/go/chapter_backtracking/permutation_test.go
Yudong Jin 7257641e0e Retranslate the complete Japanese online edition from Chinese (#2008)
* 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
2026-10-30 02:12:26 +08:00

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)
}