백준 - 3009 네 번째 점
문제
3009 네 번째 점
답
kotlin code
1
2
3
4
5
6
7
8
9
10
fun main() {
val lines = Array(3) { readln().split(" ").map { it.toInt() }.toPair() }
val x = lines.map { it.first }.groupingBy { it }.eachCount().filter { it.value == 1 }.keys.first()
val y = lines.map { it.second }.groupingBy { it }.eachCount().filter { it.value == 1 }.keys.first()
println("$x $y")
}
fun <T> List<T>.toPair(): Pair<T, T> = Pair(this[0], this[1])
This post is licensed under CC BY 4.0 by the author.