package kr.co.programmers

// https://school.programmers.co.kr/learn/courses/30/lessons/87377
class P87377 {
    fun solution(line: Array<IntArray>): Array<String> {
        // 교점 좌표를 기록할 Set
        val set = mutableSetOf<Pair<Long, Long>>()
        // 가장자리 좌표
        var minX = Long.MAX_VALUE
        var maxX = Long.MIN_VALUE
        var minY = Long.MAX_VALUE
        var maxY = Long.MIN_VALUE
        // Int * Int = Long 이 될 수 있기 때문에 처음부터 Long 변환 후 계산한다.
        val rows = line.map { (a, b, c) ->
            longArrayOf(a.toLong(), b.toLong(), c.toLong())
        }
        for (i in 0 until rows.size - 1) {
            for (j in i + 1 until rows.size) {
                val (a, b, e) = rows[i]
                val (c, d, f) = rows[j]
                // 교점 계산식
                val adbc = (a * d) - (b * c)
                val bfed = (b * f) - (e * d)
                val ecaf = (e * c) - (a * f)
                // 평행하거나 좌표가 정수가 아니면 패스
                if (adbc == 0L || bfed % adbc != 0L || ecaf % adbc != 0L) continue
                // 교점 기록
                val x = bfed / adbc
                val y = ecaf / adbc
                set += x to y
                // 좌표의 최대치
                minX = minOf(minX, x)
                maxX = maxOf(maxX, x)
                minY = minOf(minY, y)
                maxY = maxOf(maxY, y)
            }
        }
        // "*" 찍기
        val row = (maxY - minY + 1).toInt()
        val col = (maxX - minX + 1).toInt()
        val arr = Array(row) { CharArray(col) { '.' } }
        for ((x, y) in set) {
            arr[(maxY - y).toInt()][(x - minX).toInt()] = '*'
        }
        // List → Array
        return arr.map { it.joinToString("") }.toTypedArray()
    }
}

Compiled from "P87377.kt"
public final class kr.co.programmers.P87377 {
  public kr.co.programmers.P87377();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final java.lang.String[] solution(int[][]);
    Code:
       0: aload_1
       1: ldc           #15                 // String line
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #23                 // class java/util/LinkedHashSet
       9: dup
      10: invokespecial #24                 // Method java/util/LinkedHashSet."<init>":()V
      13: checkcast     #26                 // class java/util/Set
      16: astore_2
      17: ldc2_w        #27                 // long 9223372036854775807l
      20: lstore_3
      21: ldc2_w        #29                 // long -9223372036854775808l
      24: lstore        5
      26: ldc2_w        #27                 // long 9223372036854775807l
      29: lstore        7
      31: ldc2_w        #29                 // long -9223372036854775808l
      34: lstore        9
      36: aload_1
      37: checkcast     #32                 // class "[Ljava/lang/Object;"
      40: astore        12
      42: iconst_0
      43: istore        13
      45: aload         12
      47: astore        14
      49: new           #34                 // class java/util/ArrayList
      52: dup
      53: aload         12
      55: arraylength
      56: invokespecial #37                 // Method java/util/ArrayList."<init>":(I)V
      59: checkcast     #39                 // class java/util/Collection
      62: astore        15
      64: iconst_0
      65: istore        16
      67: iconst_0
      68: istore        17
      70: aload         14
      72: arraylength
      73: istore        18
      75: iload         17
      77: iload         18
      79: if_icmpge     164
      82: aload         14
      84: iload         17
      86: aaload
      87: astore        19
      89: aload         15
      91: aload         19
      93: checkcast     #41                 // class "[I"
      96: astore        20
      98: astore        40
     100: iconst_0
     101: istore        21
     103: aload         20
     105: iconst_0
     106: iaload
     107: istore        22
     109: aload         20
     111: iconst_1
     112: iaload
     113: istore        23
     115: aload         20
     117: iconst_2
     118: iaload
     119: istore        24
     121: iconst_3
     122: newarray       long
     124: astore        25
     126: aload         25
     128: iconst_0
     129: iload         22
     131: i2l
     132: lastore
     133: aload         25
     135: iconst_1
     136: iload         23
     138: i2l
     139: lastore
     140: aload         25
     142: iconst_2
     143: iload         24
     145: i2l
     146: lastore
     147: aload         25
     149: aload         40
     151: swap
     152: invokeinterface #45,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     157: pop
     158: iinc          17, 1
     161: goto          75
     164: aload         15
     166: checkcast     #47                 // class java/util/List
     169: nop
     170: astore        11
     172: iconst_0
     173: istore        12
     175: aload         11
     177: invokeinterface #51,  1           // InterfaceMethod java/util/List.size:()I
     182: iconst_1
     183: isub
     184: istore        13
     186: iload         12
     188: iload         13
     190: if_icmpge     431
     193: iload         12
     195: iconst_1
     196: iadd
     197: istore        14
     199: aload         11
     201: invokeinterface #51,  1           // InterfaceMethod java/util/List.size:()I
     206: istore        15
     208: iload         14
     210: iload         15
     212: if_icmpge     425
     215: aload         11
     217: iload         12
     219: invokeinterface #55,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     224: checkcast     #57                 // class "[J"
     227: astore        16
     229: aload         16
     231: iconst_0
     232: laload
     233: lstore        17
     235: aload         16
     237: iconst_1
     238: laload
     239: lstore        19
     241: aload         16
     243: iconst_2
     244: laload
     245: lstore        21
     247: aload         11
     249: iload         14
     251: invokeinterface #55,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     256: checkcast     #57                 // class "[J"
     259: astore        23
     261: aload         23
     263: iconst_0
     264: laload
     265: lstore        24
     267: aload         23
     269: iconst_1
     270: laload
     271: lstore        26
     273: aload         23
     275: iconst_2
     276: laload
     277: lstore        28
     279: lload         17
     281: lload         26
     283: lmul
     284: lload         19
     286: lload         24
     288: lmul
     289: lsub
     290: lstore        30
     292: lload         19
     294: lload         28
     296: lmul
     297: lload         21
     299: lload         26
     301: lmul
     302: lsub
     303: lstore        32
     305: lload         21
     307: lload         24
     309: lmul
     310: lload         17
     312: lload         28
     314: lmul
     315: lsub
     316: lstore        34
     318: lload         30
     320: lconst_0
     321: lcmp
     322: ifeq          419
     325: lload         32
     327: lload         30
     329: lrem
     330: lconst_0
     331: lcmp
     332: ifne          419
     335: lload         34
     337: lload         30
     339: lrem
     340: lconst_0
     341: lcmp
     342: ifeq          348
     345: goto          419
     348: lload         32
     350: lload         30
     352: ldiv
     353: lstore        36
     355: lload         34
     357: lload         30
     359: ldiv
     360: lstore        38
     362: aload_2
     363: checkcast     #39                 // class java/util/Collection
     366: lload         36
     368: invokestatic  #63                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     371: lload         38
     373: invokestatic  #63                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     376: invokestatic  #69                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     379: invokeinterface #45,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     384: pop
     385: lload_3
     386: lload         36
     388: invokestatic  #75                 // Method java/lang/Math.min:(JJ)J
     391: lstore_3
     392: lload         5
     394: lload         36
     396: invokestatic  #78                 // Method java/lang/Math.max:(JJ)J
     399: lstore        5
     401: lload         7
     403: lload         38
     405: invokestatic  #75                 // Method java/lang/Math.min:(JJ)J
     408: lstore        7
     410: lload         9
     412: lload         38
     414: invokestatic  #78                 // Method java/lang/Math.max:(JJ)J
     417: lstore        9
     419: iinc          14, 1
     422: goto          208
     425: iinc          12, 1
     428: goto          186
     431: lload         9
     433: lload         7
     435: lsub
     436: lconst_1
     437: ladd
     438: l2i
     439: istore        12
     441: lload         5
     443: lload_3
     444: lsub
     445: lconst_1
     446: ladd
     447: l2i
     448: istore        13
     450: iconst_0
     451: istore        15
     453: iload         12
     455: anewarray     #80                 // class "[C"
     458: astore        16
     460: iload         15
     462: iload         12
     464: if_icmpge     525
     467: iload         15
     469: istore        17
     471: aload         16
     473: iload         17
     475: iconst_0
     476: istore        18
     478: iload         13
     480: newarray       char
     482: astore        19
     484: istore        41
     486: astore        40
     488: iload         18
     490: iload         13
     492: if_icmpge     512
     495: iload         18
     497: istore        20
     499: aload         19
     501: iload         20
     503: bipush        46
     505: castore
     506: iinc          18, 1
     509: goto          488
     512: aload         40
     514: iload         41
     516: aload         19
     518: aastore
     519: iinc          15, 1
     522: goto          460
     525: aload         16
     527: astore        14
     529: aload_2
     530: invokeinterface #84,  1           // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     535: astore        15
     537: aload         15
     539: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     544: ifeq          605
     547: aload         15
     549: invokeinterface #94,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     554: checkcast     #96                 // class kotlin/Pair
     557: astore        16
     559: aload         16
     561: invokevirtual #99                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
     564: checkcast     #101                // class java/lang/Number
     567: invokevirtual #105                // Method java/lang/Number.longValue:()J
     570: lstore        17
     572: aload         16
     574: invokevirtual #108                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     577: checkcast     #101                // class java/lang/Number
     580: invokevirtual #105                // Method java/lang/Number.longValue:()J
     583: lstore        19
     585: aload         14
     587: lload         9
     589: lload         19
     591: lsub
     592: l2i
     593: aaload
     594: lload         17
     596: lload_3
     597: lsub
     598: l2i
     599: bipush        42
     601: castore
     602: goto          537
     605: aload         14
     607: checkcast     #32                 // class "[Ljava/lang/Object;"
     610: astore        15
     612: iconst_0
     613: istore        16
     615: aload         15
     617: astore        17
     619: new           #34                 // class java/util/ArrayList
     622: dup
     623: aload         15
     625: arraylength
     626: invokespecial #37                 // Method java/util/ArrayList."<init>":(I)V
     629: checkcast     #39                 // class java/util/Collection
     632: astore        18
     634: iconst_0
     635: istore        19
     637: iconst_0
     638: istore        20
     640: aload         17
     642: arraylength
     643: istore        21
     645: iload         20
     647: iload         21
     649: if_icmpge     706
     652: aload         17
     654: iload         20
     656: aaload
     657: astore        22
     659: aload         18
     661: aload         22
     663: checkcast     #80                 // class "[C"
     666: astore        23
     668: astore        40
     670: iconst_0
     671: istore        24
     673: aload         23
     675: ldc           #110                // String
     677: checkcast     #112                // class java/lang/CharSequence
     680: aconst_null
     681: aconst_null
     682: iconst_0
     683: aconst_null
     684: aconst_null
     685: bipush        62
     687: aconst_null
     688: invokestatic  #118                // Method kotlin/collections/ArraysKt.joinToString$default:([CLjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     691: aload         40
     693: swap
     694: invokeinterface #45,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     699: pop
     700: iinc          20, 1
     703: goto          645
     706: aload         18
     708: checkcast     #47                 // class java/util/List
     711: nop
     712: checkcast     #39                 // class java/util/Collection
     715: astore        15
     717: nop
     718: iconst_0
     719: istore        16
     721: aload         15
     723: astore        17
     725: aload         17
     727: iconst_0
     728: anewarray     #120                // class java/lang/String
     731: invokeinterface #124,  2          // InterfaceMethod java/util/Collection.toArray:([Ljava/lang/Object;)[Ljava/lang/Object;
     736: checkcast     #126                // class "[Ljava/lang/String;"
     739: areturn
}


package kr.co.programmers

// https://github.com/antop-dev/algorithm/issues/314
class P83201 {
    fun solution(scores: Array<IntArray>): String {
        val n = scores.size
        val answer = StringBuffer()

        for (j in 0 until n) {
            val arr = Array(n) { i -> scores[i][j] }
            var min = Int.MAX_VALUE
            var max = Int.MIN_VALUE
            var count = 0

            var m = n
            var sum = 0

            for (i in 0 until n) {
                val v = scores[i][j]
                sum += v
                if (v < min) min = v
                if (v > max) max = v
                if (v == scores[j][j]) count++
            }

            // 유일한 최고점이거나 최저점
            if ((arr[j] == min || arr[j] == max) && count == 1) {
                sum -= arr[j]
                m--
            }

            val average = sum.toDouble() / m
            answer.append(when {
                average >= 90 -> "A"
                average >= 80 -> "B"
                average >= 70 -> "C"
                average >= 50 -> "D"
                else -> "F"
            })
        }

        return answer.toString()
    }
}

Compiled from "P83201.kt"
public final class kr.co.programmers.P83201 {
  public kr.co.programmers.P83201();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final java.lang.String solution(int[][]);
    Code:
       0: aload_1
       1: ldc           #15                 // String scores
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #23                 // class "[Ljava/lang/Object;"
      10: arraylength
      11: istore_2
      12: new           #25                 // class java/lang/StringBuffer
      15: dup
      16: invokespecial #26                 // Method java/lang/StringBuffer."<init>":()V
      19: astore_3
      20: iconst_0
      21: istore        4
      23: iload         4
      25: iload_2
      26: if_icmpge     284
      29: iconst_0
      30: istore        6
      32: iload_2
      33: anewarray     #28                 // class java/lang/Integer
      36: astore        7
      38: iload         6
      40: iload_2
      41: if_icmpge     69
      44: iload         6
      46: istore        8
      48: aload         7
      50: iload         8
      52: aload_1
      53: iload         8
      55: aaload
      56: iload         4
      58: iaload
      59: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      62: aastore
      63: iinc          6, 1
      66: goto          38
      69: aload         7
      71: astore        5
      73: ldc           #33                 // int 2147483647
      75: istore        6
      77: ldc           #34                 // int -2147483648
      79: istore        7
      81: iconst_0
      82: istore        8
      84: iload_2
      85: istore        9
      87: iconst_0
      88: istore        10
      90: iconst_0
      91: istore        11
      93: iload         11
      95: iload_2
      96: if_icmpge     158
      99: aload_1
     100: iload         11
     102: aaload
     103: iload         4
     105: iaload
     106: istore        12
     108: iload         10
     110: iload         12
     112: iadd
     113: istore        10
     115: iload         12
     117: iload         6
     119: if_icmpge     126
     122: iload         12
     124: istore        6
     126: iload         12
     128: iload         7
     130: if_icmple     137
     133: iload         12
     135: istore        7
     137: iload         12
     139: aload_1
     140: iload         4
     142: aaload
     143: iload         4
     145: iaload
     146: if_icmpne     152
     149: iinc          8, 1
     152: iinc          11, 1
     155: goto          93
     158: aload         5
     160: iload         4
     162: aaload
     163: invokevirtual #38                 // Method java/lang/Integer.intValue:()I
     166: iload         6
     168: if_icmpeq     184
     171: aload         5
     173: iload         4
     175: aaload
     176: invokevirtual #38                 // Method java/lang/Integer.intValue:()I
     179: iload         7
     181: if_icmpne     206
     184: iload         8
     186: iconst_1
     187: if_icmpne     206
     190: iload         10
     192: aload         5
     194: iload         4
     196: aaload
     197: invokevirtual #38                 // Method java/lang/Integer.intValue:()I
     200: isub
     201: istore        10
     203: iinc          9, -1
     206: iload         10
     208: i2d
     209: iload         9
     211: i2d
     212: ddiv
     213: dstore        11
     215: aload_3
     216: dload         11
     218: ldc2_w        #39                 // double 90.0d
     221: dcmpl
     222: iflt          230
     225: ldc           #42                 // String A
     227: goto          274
     230: dload         11
     232: ldc2_w        #43                 // double 80.0d
     235: dcmpl
     236: iflt          244
     239: ldc           #46                 // String B
     241: goto          274
     244: dload         11
     246: ldc2_w        #47                 // double 70.0d
     249: dcmpl
     250: iflt          258
     253: ldc           #50                 // String C
     255: goto          274
     258: dload         11
     260: ldc2_w        #51                 // double 50.0d
     263: dcmpl
     264: iflt          272
     267: ldc           #54                 // String D
     269: goto          274
     272: ldc           #56                 // String F
     274: invokevirtual #60                 // Method java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
     277: pop
     278: iinc          4, 1
     281: goto          23
     284: aload_3
     285: invokevirtual #64                 // Method java/lang/StringBuffer.toString:()Ljava/lang/String;
     288: dup
     289: ldc           #66                 // String toString(...)
     291: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     294: areturn
}


package kr.co.programmers

// https://github.com/antop-dev/algorithm/issues/386
class P72411 {
    fun solution(orders: Array<String>, course: IntArray): Array<String> {
        val answer = mutableListOf<String>()
        // 메뉴조합을 오름차순으로 정렬
        val sorted = orders.map { it.toCharArray().sorted() }
        // 메뉴별 갯수별 가능한 모든 조합을 구한다.
        val combination = mutableListOf<String>()
        for (chars in sorted) {
            for (c in course) {
                combination(combination, chars, BooleanArray(chars.size), 0, c)
            }
        }
        // 문자열의 길이별로 그룹핑
        val count = combination.groupBy { it.length }
        for (e in count) {
            // 문자열별 횟수로 그룹핑
            val g = e.value.groupingBy { it }.eachCount()
            // 2회 이상 주문되고 가장 많이 주문된 횟수를 구한다.
            var max = Int.MIN_VALUE
            for (v in g.values) {
                if (v >= 2 && v > max) max = v
            }
            // 최대 주문수가 있다면 주문된 조합을 찾는다.
            if (max != Int.MIN_VALUE) {
                g.filter { it.value == max }.forEach { (t, _) -> answer += t }
            }
        }
        // 최종 메뉴 조합도 오름차순으로 정렬해서 리턴
        return answer.sorted().toTypedArray()
    }

    private fun combination(result: MutableList<String>, arr: List<Char>, visited: BooleanArray, index: Int, r: Int) {
        if (r == 0) {
            result += arr.filterIndexed { i, _ -> visited[i] }.joinToString("")
        } else if (index == arr.size) {
            return
        } else {
            visited[index] = true // 선택하는 경우
            combination(result, arr, visited, index + 1, r - 1)

            visited[index] = false // 선택하지 않는 경우
            combination(result, arr, visited, index + 1, r)
        }
    }

}

Compiled from "_Collections.kt"
public final class kr.co.programmers.P72411$solution$$inlined$groupingBy$1 implements kotlin.collections.Grouping<java.lang.String, java.lang.String> {
  final java.lang.Iterable $this_groupingBy;

  public kr.co.programmers.P72411$solution$$inlined$groupingBy$1(java.lang.Iterable);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       5: aload_0
       6: invokespecial #21                 // Method java/lang/Object."<init>":()V
       9: return

  public java.util.Iterator<java.lang.String> sourceIterator();
    Code:
       0: aload_0
       1: getfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       4: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
       9: areturn

  public java.lang.String keyOf(java.lang.String);
    Code:
       0: aload_1
       1: checkcast     #37                 // class java/lang/String
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: areturn
}

Compiled from "P72411.kt"
public final class kr.co.programmers.P72411 {
  public kr.co.programmers.P72411();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final java.lang.String[] solution(java.lang.String[], int[]);
    Code:
       0: aload_1
       1: ldc           #15                 // String orders
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #23                 // String course
       9: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #25                 // class java/util/ArrayList
      15: dup
      16: invokespecial #26                 // Method java/util/ArrayList."<init>":()V
      19: checkcast     #28                 // class java/util/List
      22: astore_3
      23: aload_1
      24: astore        5
      26: iconst_0
      27: istore        6
      29: aload         5
      31: astore        7
      33: new           #25                 // class java/util/ArrayList
      36: dup
      37: aload         5
      39: arraylength
      40: invokespecial #31                 // Method java/util/ArrayList."<init>":(I)V
      43: checkcast     #33                 // class java/util/Collection
      46: astore        8
      48: iconst_0
      49: istore        9
      51: iconst_0
      52: istore        10
      54: aload         7
      56: arraylength
      57: istore        11
      59: iload         10
      61: iload         11
      63: if_icmpge     113
      66: aload         7
      68: iload         10
      70: aaload
      71: astore        12
      73: aload         8
      75: aload         12
      77: astore        13
      79: astore        21
      81: iconst_0
      82: istore        14
      84: aload         13
      86: invokevirtual #39                 // Method java/lang/String.toCharArray:()[C
      89: dup
      90: ldc           #41                 // String toCharArray(...)
      92: invokestatic  #44                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      95: invokestatic  #50                 // Method kotlin/collections/ArraysKt.sorted:([C)Ljava/util/List;
      98: aload         21
     100: swap
     101: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     106: pop
     107: iinc          10, 1
     110: goto          59
     113: aload         8
     115: checkcast     #28                 // class java/util/List
     118: nop
     119: astore        4
     121: new           #25                 // class java/util/ArrayList
     124: dup
     125: invokespecial #26                 // Method java/util/ArrayList."<init>":()V
     128: checkcast     #28                 // class java/util/List
     131: astore        5
     133: aload         4
     135: invokeinterface #58,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     140: astore        6
     142: aload         6
     144: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     149: ifeq          210
     152: aload         6
     154: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     159: checkcast     #28                 // class java/util/List
     162: astore        7
     164: iconst_0
     165: istore        8
     167: aload_2
     168: arraylength
     169: istore        9
     171: iload         8
     173: iload         9
     175: if_icmpge     142
     178: aload_2
     179: iload         8
     181: iaload
     182: istore        10
     184: aload_0
     185: aload         5
     187: aload         7
     189: aload         7
     191: invokeinterface #72,  1           // InterfaceMethod java/util/List.size:()I
     196: newarray       boolean
     198: iconst_0
     199: iload         10
     201: invokespecial #76                 // Method combination:(Ljava/util/List;Ljava/util/List;[ZII)V
     204: iinc          8, 1
     207: goto          171
     210: aload         5
     212: checkcast     #78                 // class java/lang/Iterable
     215: astore        7
     217: iconst_0
     218: istore        8
     220: aload         7
     222: astore        9
     224: new           #80                 // class java/util/LinkedHashMap
     227: dup
     228: invokespecial #81                 // Method java/util/LinkedHashMap."<init>":()V
     231: checkcast     #83                 // class java/util/Map
     234: astore        10
     236: iconst_0
     237: istore        11
     239: aload         9
     241: invokeinterface #84,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     246: astore        12
     248: aload         12
     250: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     255: ifeq          363
     258: aload         12
     260: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     265: astore        13
     267: aload         13
     269: checkcast     #35                 // class java/lang/String
     272: astore        14
     274: iconst_0
     275: istore        15
     277: aload         14
     279: invokevirtual #87                 // Method java/lang/String.length:()I
     282: invokestatic  #93                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     285: astore        16
     287: aload         10
     289: astore        17
     291: iconst_0
     292: istore        18
     294: aload         17
     296: aload         16
     298: invokeinterface #97,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     303: astore        19
     305: aload         19
     307: ifnonnull     342
     310: iconst_0
     311: istore        20
     313: new           #25                 // class java/util/ArrayList
     316: dup
     317: invokespecial #26                 // Method java/util/ArrayList."<init>":()V
     320: checkcast     #28                 // class java/util/List
     323: astore        20
     325: aload         17
     327: aload         16
     329: aload         20
     331: invokeinterface #101,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     336: pop
     337: aload         20
     339: goto          344
     342: aload         19
     344: nop
     345: checkcast     #28                 // class java/util/List
     348: astore        14
     350: aload         14
     352: aload         13
     354: invokeinterface #102,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     359: pop
     360: goto          248
     363: aload         10
     365: nop
     366: astore        6
     368: aload         6
     370: invokeinterface #106,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     375: invokeinterface #109,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     380: astore        7
     382: aload         7
     384: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     389: ifeq          714
     392: aload         7
     394: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     399: checkcast     #111                // class java/util/Map$Entry
     402: astore        8
     404: aload         8
     406: invokeinterface #114,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     411: checkcast     #78                 // class java/lang/Iterable
     414: astore        10
     416: iconst_0
     417: istore        11
     419: new           #116                // class kr/co/programmers/P72411$solution$$inlined$groupingBy$1
     422: dup
     423: aload         10
     425: invokespecial #119                // Method kr/co/programmers/P72411$solution$$inlined$groupingBy$1."<init>":(Ljava/lang/Iterable;)V
     428: checkcast     #121                // class kotlin/collections/Grouping
     431: invokestatic  #127                // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;
     434: astore        9
     436: iconst_0
     437: istore        10
     439: ldc           #128                // int -2147483648
     441: istore        10
     443: aload         9
     445: invokeinterface #132,  1          // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
     450: invokeinterface #133,  1          // InterfaceMethod java/util/Collection.iterator:()Ljava/util/Iterator;
     455: astore        11
     457: aload         11
     459: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     464: ifeq          502
     467: aload         11
     469: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     474: checkcast     #135                // class java/lang/Number
     477: invokevirtual #138                // Method java/lang/Number.intValue:()I
     480: istore        12
     482: iload         12
     484: iconst_2
     485: if_icmplt     457
     488: iload         12
     490: iload         10
     492: if_icmple     457
     495: iload         12
     497: istore        10
     499: goto          457
     502: iload         10
     504: ldc           #128                // int -2147483648
     506: if_icmpeq     382
     509: aload         9
     511: astore        11
     513: iconst_0
     514: istore        12
     516: aload         11
     518: astore        13
     520: new           #80                 // class java/util/LinkedHashMap
     523: dup
     524: invokespecial #81                 // Method java/util/LinkedHashMap."<init>":()V
     527: checkcast     #83                 // class java/util/Map
     530: astore        14
     532: iconst_0
     533: istore        15
     535: aload         13
     537: invokeinterface #106,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     542: invokeinterface #109,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     547: astore        16
     549: aload         16
     551: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     556: ifeq          629
     559: aload         16
     561: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     566: checkcast     #111                // class java/util/Map$Entry
     569: astore        17
     571: aload         17
     573: astore        18
     575: iconst_0
     576: istore        19
     578: aload         18
     580: invokeinterface #114,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     585: checkcast     #135                // class java/lang/Number
     588: invokevirtual #138                // Method java/lang/Number.intValue:()I
     591: iload         10
     593: if_icmpne     600
     596: iconst_1
     597: goto          601
     600: iconst_0
     601: ifeq          549
     604: aload         14
     606: aload         17
     608: invokeinterface #141,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     613: aload         17
     615: invokeinterface #114,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     620: invokeinterface #101,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     625: pop
     626: goto          549
     629: aload         14
     631: nop
     632: astore        11
     634: nop
     635: iconst_0
     636: istore        12
     638: aload         11
     640: invokeinterface #106,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     645: invokeinterface #109,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     650: astore        13
     652: aload         13
     654: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     659: ifeq          710
     662: aload         13
     664: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     669: checkcast     #111                // class java/util/Map$Entry
     672: astore        14
     674: aload         14
     676: astore        15
     678: iconst_0
     679: istore        16
     681: aload         15
     683: invokeinterface #141,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     688: checkcast     #35                 // class java/lang/String
     691: astore        17
     693: aload_3
     694: checkcast     #33                 // class java/util/Collection
     697: aload         17
     699: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     704: pop
     705: nop
     706: nop
     707: goto          652
     710: nop
     711: goto          382
     714: aload_3
     715: checkcast     #78                 // class java/lang/Iterable
     718: invokestatic  #146                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
     721: checkcast     #33                 // class java/util/Collection
     724: astore        7
     726: iconst_0
     727: istore        8
     729: aload         7
     731: astore        9
     733: aload         9
     735: iconst_0
     736: anewarray     #35                 // class java/lang/String
     739: invokeinterface #150,  2          // InterfaceMethod java/util/Collection.toArray:([Ljava/lang/Object;)[Ljava/lang/Object;
     744: checkcast     #152                // class "[Ljava/lang/String;"
     747: areturn

  private final void combination(java.util.List<java.lang.String>, java.util.List<java.lang.Character>, boolean[], int, int);
    Code:
       0: iload         5
       2: ifne          179
       5: aload_1
       6: checkcast     #33                 // class java/util/Collection
       9: astore        6
      11: aload_2
      12: checkcast     #78                 // class java/lang/Iterable
      15: astore        7
      17: iconst_0
      18: istore        8
      20: aload         7
      22: astore        9
      24: new           #25                 // class java/util/ArrayList
      27: dup
      28: invokespecial #26                 // Method java/util/ArrayList."<init>":()V
      31: checkcast     #33                 // class java/util/Collection
      34: astore        10
      36: iconst_0
      37: istore        11
      39: aload         9
      41: astore        12
      43: iconst_0
      44: istore        13
      46: iconst_0
      47: istore        14
      49: aload         12
      51: invokeinterface #84,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      56: astore        15
      58: aload         15
      60: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      65: ifeq          141
      68: aload         15
      70: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      75: astore        16
      77: iload         14
      79: iinc          14, 1
      82: istore        17
      84: iload         17
      86: ifge          92
      89: invokestatic  #211                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      92: iload         17
      94: aload         16
      96: astore        18
      98: istore        19
     100: iconst_0
     101: istore        20
     103: iload         19
     105: aload         18
     107: checkcast     #213                // class java/lang/Character
     110: invokevirtual #217                // Method java/lang/Character.charValue:()C
     113: pop
     114: istore        21
     116: iconst_0
     117: istore        22
     119: aload_3
     120: iload         21
     122: baload
     123: ifeq          136
     126: aload         10
     128: aload         18
     130: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     135: pop
     136: nop
     137: nop
     138: goto          58
     141: nop
     142: aload         10
     144: checkcast     #28                 // class java/util/List
     147: nop
     148: checkcast     #78                 // class java/lang/Iterable
     151: ldc           #219                // String
     153: checkcast     #221                // class java/lang/CharSequence
     156: aconst_null
     157: aconst_null
     158: iconst_0
     159: aconst_null
     160: aconst_null
     161: bipush        62
     163: aconst_null
     164: invokestatic  #225                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     167: aload         6
     169: swap
     170: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     175: pop
     176: goto          229
     179: iload         4
     181: aload_2
     182: invokeinterface #72,  1           // InterfaceMethod java/util/List.size:()I
     187: if_icmpne     191
     190: return
     191: aload_3
     192: iload         4
     194: iconst_1
     195: bastore
     196: aload_0
     197: aload_1
     198: aload_2
     199: aload_3
     200: iload         4
     202: iconst_1
     203: iadd
     204: iload         5
     206: iconst_1
     207: isub
     208: invokespecial #76                 // Method combination:(Ljava/util/List;Ljava/util/List;[ZII)V
     211: aload_3
     212: iload         4
     214: iconst_0
     215: bastore
     216: aload_0
     217: aload_1
     218: aload_2
     219: aload_3
     220: iload         4
     222: iconst_1
     223: iadd
     224: iload         5
     226: invokespecial #76                 // Method combination:(Ljava/util/List;Ljava/util/List;[ZII)V
     229: return
}


package kr.co.programmers

class P42579 {
    fun solution(genres: Array<String>, plays: IntArray): IntArray {
        // 해시 구조로 저장
        // 장르 : [<인덱스, 재생 횟수>, ..., ...]
        val hash = mutableMapOf<String, MutableList<IntArray>>().apply {
            for (i in plays.indices) {
                val genre = genres[i]
                val play = plays[i]
                val data = intArrayOf(i, play)
                this[genre] = (this[genre] ?: mutableListOf()).apply { add(data) }
            }
        }

        // 장르의 총 재생 횟수로 내림차순 정렬
        val sorted = hash.toList()
                .sortedWith(compareByDescending { it -> it.second.sumBy { it[1] } })
        // 장르 내에서 재생 횟수로 내림차순 정렬
        sorted.forEach { pair -> pair.second.sortByDescending { it[1] } }

        // 장르별 두 개씩 추출
        var answer = mutableListOf<Int>()
        for (pair in sorted) {
            answer.addAll(pair.second.take(2).map { it[0] })
        }

        return answer.toIntArray()
    }
}

Compiled from "Comparisons.kt"
public final class kr.co.programmers.P42579$solution$lambda$5$$inlined$sortByDescending$1<T> implements java.util.Comparator {
  public kr.co.programmers.P42579$solution$lambda$5$$inlined$sortByDescending$1();
    Code:
       0: aload_0
       1: invokespecial #16                 // Method java/lang/Object."<init>":()V
       4: return

  public final int compare(T, T);
    Code:
       0: aload_2
       1: checkcast     #23                 // class "[I"
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: iconst_1
      10: iaload
      11: invokestatic  #29                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #31                 // class java/lang/Comparable
      17: aload_1
      18: checkcast     #23                 // class "[I"
      21: astore_3
      22: astore        5
      24: iconst_0
      25: istore        4
      27: aload_3
      28: iconst_1
      29: iaload
      30: invokestatic  #29                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      33: aload         5
      35: swap
      36: checkcast     #31                 // class java/lang/Comparable
      39: invokestatic  #37                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
      42: ireturn
}

Compiled from "Comparisons.kt"
public final class kr.co.programmers.P42579$solution$$inlined$compareByDescending$1<T> implements java.util.Comparator {
  public kr.co.programmers.P42579$solution$$inlined$compareByDescending$1();
    Code:
       0: aload_0
       1: invokespecial #16                 // Method java/lang/Object."<init>":()V
       4: return

  public final int compare(T, T);
    Code:
       0: aload_2
       1: checkcast     #23                 // class kotlin/Pair
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: invokevirtual #27                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      12: checkcast     #29                 // class java/lang/Iterable
      15: astore        5
      17: iconst_0
      18: istore        6
      20: iconst_0
      21: istore        7
      23: aload         5
      25: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      30: astore        8
      32: aload         8
      34: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      39: ifeq          81
      42: aload         8
      44: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      49: astore        9
      51: iload         7
      53: aload         9
      55: checkcast     #44                 // class "[I"
      58: astore        10
      60: istore        11
      62: iconst_0
      63: istore        12
      65: aload         10
      67: iconst_1
      68: iaload
      69: istore        13
      71: iload         11
      73: iload         13
      75: iadd
      76: istore        7
      78: goto          32
      81: iload         7
      83: invokestatic  #50                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      86: checkcast     #52                 // class java/lang/Comparable
      89: nop
      90: aload_1
      91: checkcast     #23                 // class kotlin/Pair
      94: astore_3
      95: astore        14
      97: iconst_0
      98: istore        4
     100: aload_3
     101: invokevirtual #27                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     104: checkcast     #29                 // class java/lang/Iterable
     107: astore        5
     109: iconst_0
     110: istore        6
     112: iconst_0
     113: istore        7
     115: aload         5
     117: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     122: astore        8
     124: aload         8
     126: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     131: ifeq          173
     134: aload         8
     136: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     141: astore        9
     143: iload         7
     145: aload         9
     147: checkcast     #44                 // class "[I"
     150: astore        10
     152: istore        11
     154: iconst_0
     155: istore        12
     157: aload         10
     159: iconst_1
     160: iaload
     161: istore        13
     163: iload         11
     165: iload         13
     167: iadd
     168: istore        7
     170: goto          124
     173: iload         7
     175: invokestatic  #50                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     178: checkcast     #52                 // class java/lang/Comparable
     181: nop
     182: aload         14
     184: swap
     185: invokestatic  #58                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
     188: ireturn
}

Compiled from "P42579.kt"
public final class kr.co.programmers.P42579 {
  public kr.co.programmers.P42579();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final int[] solution(java.lang.String[], int[]);
    Code:
       0: aload_1
       1: ldc           #15                 // String genres
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #23                 // String plays
       9: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #25                 // class java/util/LinkedHashMap
      15: dup
      16: invokespecial #26                 // Method java/util/LinkedHashMap."<init>":()V
      19: checkcast     #28                 // class java/util/Map
      22: astore        4
      24: aload         4
      26: astore        5
      28: iconst_0
      29: istore        6
      31: iconst_0
      32: istore        7
      34: aload_2
      35: arraylength
      36: istore        8
      38: iload         7
      40: iload         8
      42: if_icmpge     150
      45: aload_1
      46: iload         7
      48: aaload
      49: astore        9
      51: aload_2
      52: iload         7
      54: iaload
      55: istore        10
      57: iconst_2
      58: newarray       int
      60: astore        11
      62: aload         11
      64: iconst_0
      65: iload         7
      67: iastore
      68: aload         11
      70: iconst_1
      71: iload         10
      73: iastore
      74: aload         11
      76: astore        12
      78: aload         5
      80: astore        11
      82: aload         5
      84: aload         9
      86: invokeinterface #32,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      91: checkcast     #34                 // class java/util/List
      94: dup
      95: ifnonnull     109
      98: pop
      99: new           #36                 // class java/util/ArrayList
     102: dup
     103: invokespecial #37                 // Method java/util/ArrayList."<init>":()V
     106: checkcast     #34                 // class java/util/List
     109: astore        13
     111: aload         13
     113: astore        14
     115: iconst_0
     116: istore        15
     118: aload         14
     120: aload         12
     122: invokeinterface #41,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     127: pop
     128: aload         13
     130: astore        13
     132: aload         11
     134: aload         9
     136: aload         13
     138: invokeinterface #45,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     143: pop
     144: iinc          7, 1
     147: goto          38
     150: nop
     151: aload         4
     153: astore_3
     154: aload_3
     155: invokestatic  #51                 // Method kotlin/collections/MapsKt.toList:(Ljava/util/Map;)Ljava/util/List;
     158: checkcast     #53                 // class java/lang/Iterable
     161: new           #55                 // class kr/co/programmers/P42579$solution$$inlined$compareByDescending$1
     164: dup
     165: invokespecial #56                 // Method kr/co/programmers/P42579$solution$$inlined$compareByDescending$1."<init>":()V
     168: checkcast     #58                 // class java/util/Comparator
     171: invokestatic  #64                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     174: astore        4
     176: aload         4
     178: checkcast     #53                 // class java/lang/Iterable
     181: astore        5
     183: iconst_0
     184: istore        6
     186: aload         5
     188: invokeinterface #68,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     193: astore        7
     195: aload         7
     197: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     202: ifeq          269
     205: aload         7
     207: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     212: astore        8
     214: aload         8
     216: checkcast     #80                 // class kotlin/Pair
     219: astore        9
     221: iconst_0
     222: istore        10
     224: aload         9
     226: invokevirtual #83                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     229: checkcast     #34                 // class java/util/List
     232: astore        11
     234: iconst_0
     235: istore        12
     237: aload         11
     239: invokeinterface #87,  1           // InterfaceMethod java/util/List.size:()I
     244: iconst_1
     245: if_icmple     263
     248: aload         11
     250: new           #89                 // class kr/co/programmers/P42579$solution$lambda$5$$inlined$sortByDescending$1
     253: dup
     254: invokespecial #90                 // Method kr/co/programmers/P42579$solution$lambda$5$$inlined$sortByDescending$1."<init>":()V
     257: checkcast     #58                 // class java/util/Comparator
     260: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.sortWith:(Ljava/util/List;Ljava/util/Comparator;)V
     263: nop
     264: nop
     265: nop
     266: goto          195
     269: nop
     270: new           #36                 // class java/util/ArrayList
     273: dup
     274: invokespecial #37                 // Method java/util/ArrayList."<init>":()V
     277: checkcast     #34                 // class java/util/List
     280: astore        5
     282: aload         4
     284: invokeinterface #95,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     289: astore        6
     291: aload         6
     293: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     298: ifeq          445
     301: aload         6
     303: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     308: checkcast     #80                 // class kotlin/Pair
     311: astore        7
     313: aload         5
     315: aload         7
     317: invokevirtual #83                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     320: checkcast     #53                 // class java/lang/Iterable
     323: iconst_2
     324: invokestatic  #99                 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
     327: checkcast     #53                 // class java/lang/Iterable
     330: astore        8
     332: astore        17
     334: iconst_0
     335: istore        9
     337: aload         8
     339: astore        10
     341: new           #36                 // class java/util/ArrayList
     344: dup
     345: aload         8
     347: bipush        10
     349: invokestatic  #103                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     352: invokespecial #106                // Method java/util/ArrayList."<init>":(I)V
     355: checkcast     #108                // class java/util/Collection
     358: astore        11
     360: iconst_0
     361: istore        12
     363: aload         10
     365: invokeinterface #68,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     370: astore        13
     372: aload         13
     374: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     379: ifeq          424
     382: aload         13
     384: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     389: astore        14
     391: aload         11
     393: aload         14
     395: checkcast     #110                // class "[I"
     398: astore        15
     400: astore        18
     402: iconst_0
     403: istore        16
     405: aload         15
     407: iconst_0
     408: iaload
     409: invokestatic  #116                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     412: aload         18
     414: swap
     415: invokeinterface #117,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     420: pop
     421: goto          372
     424: aload         11
     426: checkcast     #34                 // class java/util/List
     429: nop
     430: aload         17
     432: swap
     433: checkcast     #108                // class java/util/Collection
     436: invokeinterface #121,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
     441: pop
     442: goto          291
     445: aload         5
     447: checkcast     #108                // class java/util/Collection
     450: invokestatic  #125                // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I
     453: areturn
}


package kr.co.programmers

// https://github.com/antop-dev/algorithm/issues/532
class P49191 {
    fun solution(n: Int, results: Array<IntArray>): Int {
        // 승/패로 초기화
        val graph = Array(n) { IntArray(n) }
        for ((win, lose) in results) {
            graph[win - 1][lose - 1] = 1
            graph[lose - 1][win - 1] = -1
        }
        // 플로이드 와샬
        for (k in 0 until n) {
            for (i in 0 until n) {
                for (j in 0 until n) {
                    if (graph[i][k] == 1 && graph[k][j] == 1) {
                        graph[i][j] = 1
                        graph[j][i] = -1
                    }
                }
            }
        }
        // 경기 결과의 수가 (n-1)개면 이 선수의 순위를 알 수 있다.
        return graph.count { p ->
            p.count { it != 0 } == n - 1
        }
    }
}

Compiled from "P49191.kt"
public final class kr.co.programmers.P49191 {
  public kr.co.programmers.P49191();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final int solution(int, int[][]);
    Code:
       0: aload_2
       1: ldc           #15                 // String results
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore        4
       9: iload_1
      10: anewarray     #23                 // class "[I"
      13: astore        5
      15: iload         4
      17: iload_1
      18: if_icmpge     39
      21: iload         4
      23: istore        6
      25: aload         5
      27: iload         6
      29: iload_1
      30: newarray       int
      32: aastore
      33: iinc          4, 1
      36: goto          15
      39: aload         5
      41: astore_3
      42: iconst_0
      43: istore        4
      45: aload_2
      46: checkcast     #25                 // class "[Ljava/lang/Object;"
      49: arraylength
      50: istore        5
      52: iload         4
      54: iload         5
      56: if_icmpge     107
      59: aload_2
      60: iload         4
      62: aaload
      63: astore        6
      65: aload         6
      67: iconst_0
      68: iaload
      69: istore        7
      71: aload         6
      73: iconst_1
      74: iaload
      75: istore        8
      77: aload_3
      78: iload         7
      80: iconst_1
      81: isub
      82: aaload
      83: iload         8
      85: iconst_1
      86: isub
      87: iconst_1
      88: iastore
      89: aload_3
      90: iload         8
      92: iconst_1
      93: isub
      94: aaload
      95: iload         7
      97: iconst_1
      98: isub
      99: iconst_m1
     100: iastore
     101: iinc          4, 1
     104: goto          52
     107: iconst_0
     108: istore        4
     110: iload         4
     112: iload_1
     113: if_icmpge     190
     116: iconst_0
     117: istore        5
     119: iload         5
     121: iload_1
     122: if_icmpge     184
     125: iconst_0
     126: istore        6
     128: iload         6
     130: iload_1
     131: if_icmpge     178
     134: aload_3
     135: iload         5
     137: aaload
     138: iload         4
     140: iaload
     141: iconst_1
     142: if_icmpne     172
     145: aload_3
     146: iload         4
     148: aaload
     149: iload         6
     151: iaload
     152: iconst_1
     153: if_icmpne     172
     156: aload_3
     157: iload         5
     159: aaload
     160: iload         6
     162: iconst_1
     163: iastore
     164: aload_3
     165: iload         6
     167: aaload
     168: iload         5
     170: iconst_m1
     171: iastore
     172: iinc          6, 1
     175: goto          128
     178: iinc          5, 1
     181: goto          119
     184: iinc          4, 1
     187: goto          110
     190: aload_3
     191: checkcast     #25                 // class "[Ljava/lang/Object;"
     194: astore        4
     196: iconst_0
     197: istore        5
     199: iconst_0
     200: istore        6
     202: iconst_0
     203: istore        7
     205: aload         4
     207: arraylength
     208: istore        8
     210: iload         7
     212: iload         8
     214: if_icmpge     320
     217: aload         4
     219: iload         7
     221: aaload
     222: astore        9
     224: aload         9
     226: checkcast     #23                 // class "[I"
     229: astore        10
     231: iconst_0
     232: istore        11
     234: aload         10
     236: astore        12
     238: iconst_0
     239: istore        13
     241: iconst_0
     242: istore        14
     244: iconst_0
     245: istore        15
     247: aload         12
     249: arraylength
     250: istore        16
     252: iload         15
     254: iload         16
     256: if_icmpge     295
     259: aload         12
     261: iload         15
     263: iaload
     264: istore        17
     266: iload         17
     268: istore        18
     270: iconst_0
     271: istore        19
     273: iload         18
     275: ifeq          282
     278: iconst_1
     279: goto          283
     282: iconst_0
     283: ifeq          289
     286: iinc          14, 1
     289: iinc          15, 1
     292: goto          252
     295: iload         14
     297: iload_1
     298: iconst_1
     299: isub
     300: if_icmpne     307
     303: iconst_1
     304: goto          308
     307: iconst_0
     308: ifeq          314
     311: iinc          6, 1
     314: iinc          7, 1
     317: goto          210
     320: iload         6
     322: ireturn
}


package kr.co.programmers

// https://github.com/antop-dev/algorithm/issues/374
class P72412 {
    fun solution(info: Array<String>, query: Array<String>): IntArray {
        val aggregate = mutableMapOf<String, MutableList<Int>>()
        // 경우의 수를 집계한다.
        for (i in info.indices) {
            dfs(aggregate, "", 0, info[i].split(" "))
        }
        // 이진 탐색으로 숫자를 찾을 것이므로 점수를 오름차순 정렬
        for (e in aggregate.entries) {
            e.value.sort()
        }
        // 찾기
        val answer = IntArray(query.size)
        for (i in query.indices) {
            val split = query[i].replace(" and ", "").split(" ")
            answer[i] = search(aggregate, split[0], split[1].toInt())
        }
        return answer
    }

    private fun dfs(aggregate: MutableMap<String, MutableList<Int>>, key: String, depth: Int, info: List<String>) {
        if (depth == 4) {
            aggregate[key] = aggregate[key]?.run {
                this += info[4].toInt()
                this
            } ?: mutableListOf(info[4].toInt())
            return
        }
        dfs(aggregate, "$key-", depth + 1, info)
        dfs(aggregate, "$key${info[depth]}", depth + 1, info)
    }

    private fun search(aggregate: MutableMap<String, MutableList<Int>>, key: String, score: Int): Int {
        return aggregate[key]?.run {
            var start = 0
            var end = this.lastIndex
            while (start <= end) {
                val mid = (start + end) / 2
                if (this[mid] < score) {
                    start = mid + 1
                } else {
                    end = mid - 1
                }
            }
            this.size - start
        } ?: 0
    }

}

Compiled from "P72412.kt"
public final class kr.co.programmers.P72412 {
  public kr.co.programmers.P72412();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final int[] solution(java.lang.String[], java.lang.String[]);
    Code:
       0: aload_1
       1: ldc           #15                 // String info
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #23                 // String query
       9: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #25                 // class java/util/LinkedHashMap
      15: dup
      16: invokespecial #26                 // Method java/util/LinkedHashMap."<init>":()V
      19: checkcast     #28                 // class java/util/Map
      22: astore_3
      23: iconst_0
      24: istore        4
      26: aload_1
      27: arraylength
      28: istore        5
      30: iload         4
      32: iload         5
      34: if_icmpge     80
      37: aload_0
      38: aload_3
      39: ldc           #30                 // String
      41: iconst_0
      42: aload_1
      43: iload         4
      45: aaload
      46: checkcast     #32                 // class java/lang/CharSequence
      49: iconst_1
      50: anewarray     #34                 // class java/lang/String
      53: astore        6
      55: aload         6
      57: iconst_0
      58: ldc           #36                 // String
      60: aastore
      61: aload         6
      63: iconst_0
      64: iconst_0
      65: bipush        6
      67: aconst_null
      68: invokestatic  #42                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      71: invokespecial #46                 // Method dfs:(Ljava/util/Map;Ljava/lang/String;ILjava/util/List;)V
      74: iinc          4, 1
      77: goto          30
      80: aload_3
      81: invokeinterface #50,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      86: invokeinterface #56,  1           // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      91: astore        4
      93: aload         4
      95: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     100: ifeq          131
     103: aload         4
     105: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     110: checkcast     #68                 // class java/util/Map$Entry
     113: astore        5
     115: aload         5
     117: invokeinterface #71,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     122: checkcast     #73                 // class java/util/List
     125: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.sort:(Ljava/util/List;)V
     128: goto          93
     131: aload_2
     132: arraylength
     133: newarray       int
     135: astore        4
     137: iconst_0
     138: istore        5
     140: aload_2
     141: arraylength
     142: istore        6
     144: iload         5
     146: iload         6
     148: if_icmpge     233
     151: aload_2
     152: iload         5
     154: aaload
     155: ldc           #81                 // String  and
     157: ldc           #30                 // String
     159: iconst_0
     160: iconst_4
     161: aconst_null
     162: invokestatic  #85                 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
     165: checkcast     #32                 // class java/lang/CharSequence
     168: iconst_1
     169: anewarray     #34                 // class java/lang/String
     172: astore        8
     174: aload         8
     176: iconst_0
     177: ldc           #36                 // String
     179: aastore
     180: aload         8
     182: iconst_0
     183: iconst_0
     184: bipush        6
     186: aconst_null
     187: invokestatic  #42                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     190: astore        7
     192: aload         4
     194: iload         5
     196: aload_0
     197: aload_3
     198: aload         7
     200: iconst_0
     201: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     206: checkcast     #34                 // class java/lang/String
     209: aload         7
     211: iconst_1
     212: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     217: checkcast     #34                 // class java/lang/String
     220: invokestatic  #95                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     223: invokespecial #99                 // Method search:(Ljava/util/Map;Ljava/lang/String;I)I
     226: iastore
     227: iinc          5, 1
     230: goto          144
     233: aload         4
     235: areturn

  private final void dfs(java.util.Map<java.lang.String, java.util.List<java.lang.Integer>>, java.lang.String, int, java.util.List<java.lang.String>);
    Code:
       0: iload_3
       1: iconst_4
       2: if_icmpne     109
       5: aload_1
       6: astore        5
       8: aload_1
       9: aload_2
      10: invokeinterface #116,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      15: checkcast     #73                 // class java/util/List
      18: dup
      19: ifnull        62
      22: astore        8
      24: iconst_0
      25: istore        9
      27: nop
      28: aload         8
      30: checkcast     #118                // class java/util/Collection
      33: aload         4
      35: iconst_4
      36: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      41: checkcast     #34                 // class java/lang/String
      44: invokestatic  #95                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      47: invokestatic  #122                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      50: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      55: pop
      56: aload         8
      58: nop
      59: goto          95
      62: pop
      63: iconst_1
      64: anewarray     #91                 // class java/lang/Integer
      67: astore        7
      69: aload         7
      71: iconst_0
      72: aload         4
      74: iconst_4
      75: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      80: checkcast     #34                 // class java/lang/String
      83: invokestatic  #95                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      86: invokestatic  #122                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      89: aastore
      90: aload         7
      92: invokestatic  #130                // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
      95: astore        6
      97: aload         5
      99: aload_2
     100: aload         6
     102: invokeinterface #134,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     107: pop
     108: return
     109: aload_0
     110: aload_1
     111: new           #136                // class java/lang/StringBuilder
     114: dup
     115: invokespecial #137                // Method java/lang/StringBuilder."<init>":()V
     118: aload_2
     119: invokevirtual #141                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     122: bipush        45
     124: invokevirtual #144                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     127: invokevirtual #148                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     130: iload_3
     131: iconst_1
     132: iadd
     133: aload         4
     135: invokespecial #46                 // Method dfs:(Ljava/util/Map;Ljava/lang/String;ILjava/util/List;)V
     138: aload_0
     139: aload_1
     140: new           #136                // class java/lang/StringBuilder
     143: dup
     144: invokespecial #137                // Method java/lang/StringBuilder."<init>":()V
     147: aload_2
     148: invokevirtual #141                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     151: aload         4
     153: iload_3
     154: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     159: checkcast     #34                 // class java/lang/String
     162: invokevirtual #141                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     165: invokevirtual #148                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     168: iload_3
     169: iconst_1
     170: iadd
     171: aload         4
     173: invokespecial #46                 // Method dfs:(Ljava/util/Map;Ljava/lang/String;ILjava/util/List;)V
     176: return

  private final int search(java.util.Map<java.lang.String, java.util.List<java.lang.Integer>>, java.lang.String, int);
    Code:
       0: aload_1
       1: aload_2
       2: invokeinterface #116,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #73                 // class java/util/List
      10: dup
      11: ifnull        96
      14: astore        4
      16: iconst_0
      17: istore        5
      19: iconst_0
      20: istore        6
      22: aload         4
      24: invokestatic  #158                // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I
      27: istore        7
      29: iload         6
      31: iload         7
      33: if_icmpgt     82
      36: iload         6
      38: iload         7
      40: iadd
      41: iconst_2
      42: idiv
      43: istore        8
      45: aload         4
      47: iload         8
      49: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      54: checkcast     #160                // class java/lang/Number
      57: invokevirtual #164                // Method java/lang/Number.intValue:()I
      60: iload_3
      61: if_icmpge     73
      64: iload         8
      66: iconst_1
      67: iadd
      68: istore        6
      70: goto          29
      73: iload         8
      75: iconst_1
      76: isub
      77: istore        7
      79: goto          29
      82: aload         4
      84: invokeinterface #167,  1          // InterfaceMethod java/util/List.size:()I
      89: iload         6
      91: isub
      92: nop
      93: goto          98
      96: pop
      97: iconst_0
      98: ireturn
}


package kr.co.programmers

// https://github.com/antop-dev/algorithm/issues/531
class P161988 {

    fun solution(sequence: IntArray): Long {
        val pulse1 = max(sequence, 1) // [1, -1, 1, ...]
        val pulse2 = max(sequence, -1) // [-1, 1, -1, ...]
        return maxOf(pulse1, pulse2)
    }

    private fun max(sequence: IntArray, start: Int): Long {
        val n = sequence.size
        val dp = LongArray(n)
        var sign = start
        for (i in 0 until n) {
            dp[i] = sequence[i] * sign * 1L
            sign *= -1
        }
        var max = dp[0]
        for (i in 1 until n) {
            // dp[n] = n번째 원소를 포함했을 때의 최대값
            dp[i] = maxOf(dp[i - 1] + dp[i], dp[i])
            max = maxOf(max, dp[i])
        }
        return max
    }

}

Compiled from "P161988.kt"
public final class kr.co.programmers.P161988 {
  public kr.co.programmers.P161988();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final long solution(int[]);
    Code:
       0: aload_1
       1: ldc           #15                 // String sequence
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: iconst_1
       9: invokespecial #25                 // Method max:([II)J
      12: lstore_2
      13: aload_0
      14: aload_1
      15: iconst_m1
      16: invokespecial #25                 // Method max:([II)J
      19: lstore        4
      21: lload_2
      22: lload         4
      24: invokestatic  #30                 // Method java/lang/Math.max:(JJ)J
      27: lreturn

  private final long max(int[], int);
    Code:
       0: aload_1
       1: arraylength
       2: istore_3
       3: iload_3
       4: newarray       long
       6: astore        4
       8: iload_2
       9: istore        5
      11: iconst_0
      12: istore        6
      14: iload         6
      16: iload_3
      17: if_icmpge     47
      20: aload         4
      22: iload         6
      24: aload_1
      25: iload         6
      27: iaload
      28: iload         5
      30: imul
      31: i2l
      32: lconst_1
      33: lmul
      34: lastore
      35: iload         5
      37: iconst_m1
      38: imul
      39: istore        5
      41: iinc          6, 1
      44: goto          14
      47: aload         4
      49: iconst_0
      50: laload
      51: lstore        6
      53: iconst_1
      54: istore        8
      56: iload         8
      58: iload_3
      59: if_icmpge     106
      62: aload         4
      64: iload         8
      66: aload         4
      68: iload         8
      70: iconst_1
      71: isub
      72: laload
      73: aload         4
      75: iload         8
      77: laload
      78: ladd
      79: aload         4
      81: iload         8
      83: laload
      84: invokestatic  #30                 // Method java/lang/Math.max:(JJ)J
      87: lastore
      88: lload         6
      90: aload         4
      92: iload         8
      94: laload
      95: invokestatic  #30                 // Method java/lang/Math.max:(JJ)J
      98: lstore        6
     100: iinc          8, 1
     103: goto          56
     106: lload         6
     108: lreturn
}


package kr.co.programmers

import java.util.*

class P72413 {
    companion object {
        const val INF = (100_000 * 200) + 1
    }

    fun solution(n: Int, s: Int, a: Int, b: Int, fares: Array<IntArray>): Int {
        // 지점 → (지점들,택시요금)
        val paths = paths(n, fares)
        // 다익스트라
        val office = dijkstra(paths, s) // S → Other
        val muzi = dijkstra(paths, a) // A → Other
        val apeach = dijkstra(paths, b) // B → Other
        // 합승 도착 지점 C를 기준으로 최소 비용 계산
        var ans = INF
        for (c in 1..n) {
            val cost = office[c] + muzi[c] + apeach[c]
            ans = minOf(ans, cost)
        }
        return ans
    }

    private fun paths(n: Int, fares: Array<IntArray>): Array<MutableList<Point>> {
        val paths = Array(n + 1) { mutableListOf<Point>() }
        for ((s, e, cost) in fares) {
            paths[s] += Point(e, cost)
            paths[e] += Point(s, cost)
        }
        return paths
    }

    private fun dijkstra(paths: Array<MutableList<Point>>, s: Int): IntArray {
        val costs = IntArray(paths.size) { INF }
        costs[s] = 0

        val pq = LinkedList<Point>()
        pq += Point(s, 0)

        while (pq.isNotEmpty()) {
            val curr = pq.poll()
            for (next in paths[curr.n]) {
                val nextCost = curr.cost + next.cost
                if (nextCost < costs[next.n]) {
                    costs[next.n] = nextCost
                    pq += Point(next.n, nextCost)
                }
            }
        }
        return costs
    }

    data class Point(val n: Int, val cost: Int)
}

Compiled from "P72413.kt"
public final class kr.co.programmers.P72413$Point {
  private final int n;

  private final int cost;

  public kr.co.programmers.P72413$Point(int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field n:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field cost:I
      14: return

  public final int getN();
    Code:
       0: aload_0
       1: getfield      #13                 // Field n:I
       4: ireturn

  public final int getCost();
    Code:
       0: aload_0
       1: getfield      #16                 // Field cost:I
       4: ireturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field n:I
       4: ireturn

  public final int component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field cost:I
       4: ireturn

  public final kr.co.programmers.P72413$Point copy(int, int);
    Code:
       0: new           #2                  // class kr/co/programmers/P72413$Point
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #28                 // Method "<init>":(II)V
       9: areturn

  public static kr.co.programmers.P72413$Point copy$default(kr.co.programmers.P72413$Point, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field n:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field cost:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #32                 // Method copy:(II)Lkr/co/programmers/P72413$Point;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #36                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #37                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #39                 // String Point(n=
       9: invokevirtual #43                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field n:I
      16: invokevirtual #46                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #48                 // String , cost=
      21: invokevirtual #43                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field cost:I
      28: invokevirtual #46                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #51                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #53                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field n:I
       4: invokestatic  #59                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field cost:I
      16: invokestatic  #59                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class kr/co/programmers/P72413$Point
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class kr/co/programmers/P72413$Point
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field n:I
      25: aload_2
      26: getfield      #13                 // Field n:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field cost:I
      38: aload_2
      39: getfield      #16                 // Field cost:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: iconst_1
      48: ireturn
}

Compiled from "P72413.kt"
public final class kr.co.programmers.P72413$Companion {
  private kr.co.programmers.P72413$Companion();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public kr.co.programmers.P72413$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #12                 // Method "<init>":()V
       4: return
}

Compiled from "P72413.kt"
public final class kr.co.programmers.P72413 {
  public static final kr.co.programmers.P72413$Companion Companion;

  public static final int INF;

  public kr.co.programmers.P72413();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final int solution(int, int, int, int, int[][]);
    Code:
       0: aload         5
       2: ldc           #15                 // String fares
       4: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: iload_1
       9: aload         5
      11: invokespecial #25                 // Method paths:(I[[I)[Ljava/util/List;
      14: astore        6
      16: aload_0
      17: aload         6
      19: iload_2
      20: invokespecial #29                 // Method dijkstra:([Ljava/util/List;I)[I
      23: astore        7
      25: aload_0
      26: aload         6
      28: iload_3
      29: invokespecial #29                 // Method dijkstra:([Ljava/util/List;I)[I
      32: astore        8
      34: aload_0
      35: aload         6
      37: iload         4
      39: invokespecial #29                 // Method dijkstra:([Ljava/util/List;I)[I
      42: astore        9
      44: ldc           #30                 // int 20000001
      46: istore        10
      48: iconst_1
      49: istore        11
      51: iload         11
      53: iload_1
      54: if_icmpgt     97
      57: aload         7
      59: iload         11
      61: iaload
      62: aload         8
      64: iload         11
      66: iaload
      67: iadd
      68: aload         9
      70: iload         11
      72: iaload
      73: iadd
      74: istore        12
      76: iload         10
      78: iload         12
      80: invokestatic  #36                 // Method java/lang/Math.min:(II)I
      83: istore        10
      85: iload         11
      87: iload_1
      88: if_icmpeq     97
      91: iinc          11, 1
      94: goto          57
      97: iload         10
      99: ireturn

  private final java.util.List<kr.co.programmers.P72413$Point>[] paths(int, int[][]);
    Code:
       0: iconst_0
       1: istore        4
       3: iload_1
       4: iconst_1
       5: iadd
       6: istore        5
       8: iload         5
      10: anewarray     #56                 // class java/util/List
      13: astore        6
      15: iload         4
      17: iload         5
      19: if_icmpge     47
      22: iload         4
      24: istore        7
      26: aload         6
      28: iload         7
      30: new           #58                 // class java/util/ArrayList
      33: dup
      34: invokespecial #59                 // Method java/util/ArrayList."<init>":()V
      37: checkcast     #56                 // class java/util/List
      40: aastore
      41: iinc          4, 1
      44: goto          15
      47: aload         6
      49: astore_3
      50: iconst_0
      51: istore        4
      53: aload_2
      54: checkcast     #61                 // class "[Ljava/lang/Object;"
      57: arraylength
      58: istore        5
      60: iload         4
      62: iload         5
      64: if_icmpge     145
      67: aload_2
      68: iload         4
      70: aaload
      71: astore        6
      73: aload         6
      75: iconst_0
      76: iaload
      77: istore        7
      79: aload         6
      81: iconst_1
      82: iaload
      83: istore        8
      85: aload         6
      87: iconst_2
      88: iaload
      89: istore        9
      91: aload_3
      92: iload         7
      94: aaload
      95: checkcast     #63                 // class java/util/Collection
      98: new           #65                 // class kr/co/programmers/P72413$Point
     101: dup
     102: iload         8
     104: iload         9
     106: invokespecial #68                 // Method kr/co/programmers/P72413$Point."<init>":(II)V
     109: invokeinterface #72,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     114: pop
     115: aload_3
     116: iload         8
     118: aaload
     119: checkcast     #63                 // class java/util/Collection
     122: new           #65                 // class kr/co/programmers/P72413$Point
     125: dup
     126: iload         7
     128: iload         9
     130: invokespecial #68                 // Method kr/co/programmers/P72413$Point."<init>":(II)V
     133: invokeinterface #72,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     138: pop
     139: iinc          4, 1
     142: goto          60
     145: aload_3
     146: areturn

  private final int[] dijkstra(java.util.List<kr.co.programmers.P72413$Point>[], int);
    Code:
       0: iconst_0
       1: istore        4
       3: aload_1
       4: arraylength
       5: istore        5
       7: iload         5
       9: newarray       int
      11: astore        6
      13: iload         4
      15: iload         5
      17: if_icmpge     37
      20: iload         4
      22: istore        7
      24: aload         6
      26: iload         7
      28: ldc           #30                 // int 20000001
      30: iastore
      31: iinc          4, 1
      34: goto          13
      37: aload         6
      39: astore_3
      40: aload_3
      41: iload_2
      42: iconst_0
      43: iastore
      44: new           #76                 // class java/util/LinkedList
      47: dup
      48: invokespecial #77                 // Method java/util/LinkedList."<init>":()V
      51: astore        4
      53: aload         4
      55: checkcast     #63                 // class java/util/Collection
      58: new           #65                 // class kr/co/programmers/P72413$Point
      61: dup
      62: iload_2
      63: iconst_0
      64: invokespecial #68                 // Method kr/co/programmers/P72413$Point."<init>":(II)V
      67: invokeinterface #72,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      72: pop
      73: aload         4
      75: checkcast     #63                 // class java/util/Collection
      78: invokeinterface #81,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      83: ifne          90
      86: iconst_1
      87: goto          91
      90: iconst_0
      91: ifeq          202
      94: aload         4
      96: invokevirtual #85                 // Method java/util/LinkedList.poll:()Ljava/lang/Object;
      99: checkcast     #65                 // class kr/co/programmers/P72413$Point
     102: astore        5
     104: aload_1
     105: aload         5
     107: invokevirtual #89                 // Method kr/co/programmers/P72413$Point.getN:()I
     110: aaload
     111: invokeinterface #93,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     116: astore        6
     118: aload         6
     120: invokeinterface #98,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     125: ifeq          73
     128: aload         6
     130: invokeinterface #101,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     135: checkcast     #65                 // class kr/co/programmers/P72413$Point
     138: astore        7
     140: aload         5
     142: invokevirtual #104                // Method kr/co/programmers/P72413$Point.getCost:()I
     145: aload         7
     147: invokevirtual #104                // Method kr/co/programmers/P72413$Point.getCost:()I
     150: iadd
     151: istore        8
     153: iload         8
     155: aload_3
     156: aload         7
     158: invokevirtual #89                 // Method kr/co/programmers/P72413$Point.getN:()I
     161: iaload
     162: if_icmpge     118
     165: aload_3
     166: aload         7
     168: invokevirtual #89                 // Method kr/co/programmers/P72413$Point.getN:()I
     171: iload         8
     173: iastore
     174: aload         4
     176: checkcast     #63                 // class java/util/Collection
     179: new           #65                 // class kr/co/programmers/P72413$Point
     182: dup
     183: aload         7
     185: invokevirtual #89                 // Method kr/co/programmers/P72413$Point.getN:()I
     188: iload         8
     190: invokespecial #68                 // Method kr/co/programmers/P72413$Point."<init>":(II)V
     193: invokeinterface #72,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     198: pop
     199: goto          118
     202: aload_3
     203: areturn

  static {};
    Code:
       0: new           #113                // class kr/co/programmers/P72413$Companion
       3: dup
       4: aconst_null
       5: invokespecial #116                // Method kr/co/programmers/P72413$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #120                // Field Companion:Lkr/co/programmers/P72413$Companion;
      11: return
}