패션왕 신해빈(백준)
package com.dofury.kotlin fun main() { val count = readLine()!!.toInt() repeat(count){ val amount = readLine()!!.toInt() val map = mutableMapOf() repeat(amount){ val input = readLine()!!.split(' ') if(map[input[1]]==null) map[input[1]] = 0 map[input[1]] = map[input[1]]!! + 1 } var result = 1 map.forEach { (key, value) -> result *= combination(value+1,1) } println(result-1) } } fun combination(n:..
코딩테스트
2023. 7. 21. 21:29