• Home
  • About
    • Moon photo

      Moon

      개발자는 자고 싶다.

    • Learn More
    • Twitter
    • Facebook
    • Instagram
    • Github
    • Steam
  • Posts
    • All Posts
    • All Tags
  • Projects

백준 - 3009 네 번째 점

05 Jun 2022

Reading time ~1 minute

문제

3009 네 번째 점

screencaptures

답

kotlin code

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


baekjoonkotlin코틀린백준브론즈구현기하학 Share Tweet +1