mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-01 18:55:23 +08:00
* feat(ko): add the complete Korean online edition * Use UTF-8 for Python CI output on Windows * Remove print-book promotion from the Korean site * fix(ko): preserve emphasis before Korean particles
34 lines
625 B
Go
34 lines
625 B
Go
// File: permutation_test.go
|
|
// Created Time: 2023-05-09
|
|
// Author: Reanon ([email protected])
|
|
|
|
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)
|
|
}
|