package main import ( "fmt" "sort" "reflect" ) func main() { // 1:13 var a, b, c, d, e int fmt.Scan(&a, &b, &c, &d, &e) cards := []int{a, b, c, d, e} cardMap := map[int]int{} for _, v := range cards { cardMap[v] = (cardMap[v] + 1) } allocationNumbers := make([]int, 0) for _, value := range cardMap { allocationNumbers = append(allocationNumbers, value) } sort.Ints(allocationNumbers) if isFullHouse(allocationNumbers) { fmt.Println("FULL HOUSE") } else if isThreeCard(allocationNumbers) { fmt.Println("THREE CARD") } else if isTwoPair(allocationNumbers) { fmt.Println("TWO PAIR") } else if isOnePair(allocationNumbers) { fmt.Println("ONE PAIR") } else { fmt.Print("NO HAND") } } func isFullHouse(allocationNumbers []int) bool { return reflect.DeepEqual(allocationNumbers, []int{2, 3}) } func isThreeCard(allocationNumbers []int) bool { return reflect.DeepEqual(allocationNumbers, []int{1, 1, 3}) } func isTwoPair(allocationNumbers []int) bool { return reflect.DeepEqual(allocationNumbers, []int{1, 2, 2}) } func isOnePair(allocationNumbers []int) bool { return reflect.DeepEqual(allocationNumbers, []int{1, 1, 1, 2}) }