class Solution {
    fun largestIsland(grid: Array<IntArray>): Int {
        val n = grid.size
        val firstLabel = 2
        val sizes = mutableMapOf<Int, Int>()

        fun label(row: Int, col: Int): Int =
            if (row !in 0 until n || col !in 0 until n) 0 else grid[row][col]

        fun conquerIsland(label: Int, row: Int, col: Int): Int {
            val queue = mutableListOf<Pair<Int, Int>>()
            var size = 0
            grid[row][col] = label
            queue.add(Pair(row, col))
            while (queue.isNotEmpty()) {
                val (r, c) = queue.removeAt(0)
                size++
                for (step in steps) {
                    val nextR = r + step.first
                    val nextC = c + step.second
                    if (label(nextR, nextC) == 1) {
                        grid[nextR][nextC] = label
                        queue.add(Pair(nextR, nextC))
                    }
                }
            }
            return size
        }

        fun discoverIslands() {
            var k = firstLabel
            for (row in 0 until n) {
                for (col in 0 until n) {
                    if (grid[row][col] == 1) {
                        val size = conquerIsland(k, row, col)
                        sizes[k] = size
                        k++
                    }
                }
            }
        }

        fun largestCombinedIsland(): Int {
            var maxSize = sizes.getOrDefault(firstLabel, 0)
            for (row in 0 until n) {
                for (col in 0 until n) {
                    if (grid[row][col] == 0) {
                        val neighbors = steps.map { (dr, dc) -> label(row + dr, col + dc) }.toSet()
                        val combinedSize = neighbors.sumOf { label -> sizes.getOrDefault(label, 0) }
                        maxSize = maxOf(combinedSize + 1, maxSize)
                    }
                }
            }
            return maxSize
        }

        discoverIslands()
        return largestCombinedIsland()
    }

    companion object {
        private val steps = arrayOf(Pair(-1, 0), Pair(1, 0), Pair(0, -1), Pair(0, 1))
    }
}

Compiled from "Solution.kt"
public final class Solution {
  public static final Solution$Companion Companion;

  private static final kotlin.Pair<java.lang.Integer, java.lang.Integer>[] steps;

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

  public final int largestIsland(int[][]);
    Code:
       0: aload_1
       1: ldc           #15                 // String grid
       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: iconst_2
      13: istore_3
      14: new           #25                 // class java/util/LinkedHashMap
      17: dup
      18: invokespecial #26                 // Method java/util/LinkedHashMap."<init>":()V
      21: checkcast     #28                 // class java/util/Map
      24: astore        4
      26: iload_3
      27: iload_2
      28: aload_1
      29: aload         4
      31: invokestatic  #32                 // Method largestIsland$discoverIslands:(II[[ILjava/util/Map;)V
      34: aload         4
      36: iload_3
      37: iload_2
      38: aload_1
      39: invokestatic  #36                 // Method largestIsland$largestCombinedIsland:(Ljava/util/Map;II[[I)I
      42: ireturn

  private static final int largestIsland$label(int, int[][], int, int);
    Code:
       0: iconst_0
       1: iload_2
       2: if_icmpgt     18
       5: iload_2
       6: iload_0
       7: if_icmpge     14
      10: iconst_1
      11: goto          19
      14: iconst_0
      15: goto          19
      18: iconst_0
      19: ifeq          44
      22: iconst_0
      23: iload_3
      24: if_icmpgt     40
      27: iload_3
      28: iload_0
      29: if_icmpge     36
      32: iconst_1
      33: goto          41
      36: iconst_0
      37: goto          41
      40: iconst_0
      41: ifne          48
      44: iconst_0
      45: goto          53
      48: aload_1
      49: iload_2
      50: aaload
      51: iload_3
      52: iaload
      53: ireturn

  private static final int largestIsland$conquerIsland(int[][], int, int, int, int);
    Code:
       0: new           #51                 // class java/util/ArrayList
       3: dup
       4: invokespecial #52                 // Method java/util/ArrayList."<init>":()V
       7: checkcast     #54                 // class java/util/List
      10: astore        5
      12: iconst_0
      13: istore        6
      15: aload_0
      16: iload_3
      17: aaload
      18: iload         4
      20: iload_2
      21: iastore
      22: aload         5
      24: new           #56                 // class kotlin/Pair
      27: dup
      28: iload_3
      29: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      32: iload         4
      34: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      37: invokespecial #65                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      40: invokeinterface #69,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      45: pop
      46: aload         5
      48: checkcast     #71                 // class java/util/Collection
      51: invokeinterface #75,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      56: ifne          63
      59: iconst_1
      60: goto          64
      63: iconst_0
      64: ifeq          220
      67: aload         5
      69: iconst_0
      70: invokeinterface #79,  2           // InterfaceMethod java/util/List.remove:(I)Ljava/lang/Object;
      75: checkcast     #56                 // class kotlin/Pair
      78: astore        7
      80: aload         7
      82: invokevirtual #83                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      85: checkcast     #85                 // class java/lang/Number
      88: invokevirtual #89                 // Method java/lang/Number.intValue:()I
      91: istore        8
      93: aload         7
      95: invokevirtual #92                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      98: checkcast     #85                 // class java/lang/Number
     101: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     104: istore        9
     106: iinc          6, 1
     109: getstatic     #96                 // Field steps:[Lkotlin/Pair;
     112: astore        10
     114: iconst_0
     115: istore        11
     117: aload         10
     119: arraylength
     120: istore        12
     122: iload         11
     124: iload         12
     126: if_icmpge     46
     129: aload         10
     131: iload         11
     133: aaload
     134: astore        13
     136: iload         8
     138: aload         13
     140: invokevirtual #99                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     143: checkcast     #85                 // class java/lang/Number
     146: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     149: iadd
     150: istore        14
     152: iload         9
     154: aload         13
     156: invokevirtual #102                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     159: checkcast     #85                 // class java/lang/Number
     162: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     165: iadd
     166: istore        15
     168: iload_1
     169: aload_0
     170: iload         14
     172: iload         15
     174: invokestatic  #104                // Method largestIsland$label:(I[[III)I
     177: iconst_1
     178: if_icmpne     214
     181: aload_0
     182: iload         14
     184: aaload
     185: iload         15
     187: iload_2
     188: iastore
     189: aload         5
     191: new           #56                 // class kotlin/Pair
     194: dup
     195: iload         14
     197: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     200: iload         15
     202: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     205: invokespecial #65                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     208: invokeinterface #69,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     213: pop
     214: iinc          11, 1
     217: goto          122
     220: iload         6
     222: ireturn

  private static final void largestIsland$discoverIslands(int, int, int[][], java.util.Map<java.lang.Integer, java.lang.Integer>);
    Code:
       0: iload_0
       1: istore        4
       3: iconst_0
       4: istore        5
       6: iload         5
       8: iload_1
       9: if_icmpge     85
      12: iconst_0
      13: istore        6
      15: iload         6
      17: iload_1
      18: if_icmpge     79
      21: aload_2
      22: iload         5
      24: aaload
      25: iload         6
      27: iaload
      28: iconst_1
      29: if_icmpne     73
      32: aload_2
      33: iload_1
      34: iload         4
      36: iload         5
      38: iload         6
      40: invokestatic  #119                // Method largestIsland$conquerIsland:([[IIIII)I
      43: istore        7
      45: iload         4
      47: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      50: astore        8
      52: iload         7
      54: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      57: astore        9
      59: aload_3
      60: aload         8
      62: aload         9
      64: invokeinterface #123,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      69: pop
      70: iinc          4, 1
      73: iinc          6, 1
      76: goto          15
      79: iinc          5, 1
      82: goto          6
      85: return

  private static final int largestIsland$largestCombinedIsland(java.util.Map<java.lang.Integer, java.lang.Integer>, int, int, int[][]);
    Code:
       0: aload_0
       1: iload_1
       2: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       5: iconst_0
       6: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       9: invokeinterface #128,  3          // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      14: checkcast     #85                 // class java/lang/Number
      17: invokevirtual #89                 // Method java/lang/Number.intValue:()I
      20: istore        4
      22: iconst_0
      23: istore        5
      25: iload         5
      27: iload_2
      28: if_icmpge     301
      31: iconst_0
      32: istore        6
      34: iload         6
      36: iload_2
      37: if_icmpge     295
      40: aload_3
      41: iload         5
      43: aaload
      44: iload         6
      46: iaload
      47: ifne          289
      50: getstatic     #96                 // Field steps:[Lkotlin/Pair;
      53: astore        8
      55: iconst_0
      56: istore        9
      58: aload         8
      60: astore        10
      62: new           #51                 // class java/util/ArrayList
      65: dup
      66: aload         8
      68: arraylength
      69: invokespecial #131                // Method java/util/ArrayList."<init>":(I)V
      72: checkcast     #71                 // class java/util/Collection
      75: astore        11
      77: iconst_0
      78: istore        12
      80: iconst_0
      81: istore        13
      83: aload         10
      85: arraylength
      86: istore        14
      88: iload         13
      90: iload         14
      92: if_icmpge     172
      95: aload         10
      97: iload         13
      99: aaload
     100: astore        15
     102: aload         11
     104: aload         15
     106: astore        16
     108: astore        20
     110: iconst_0
     111: istore        17
     113: aload         16
     115: invokevirtual #83                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
     118: checkcast     #85                 // class java/lang/Number
     121: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     124: istore        18
     126: aload         16
     128: invokevirtual #92                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     131: checkcast     #85                 // class java/lang/Number
     134: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     137: istore        19
     139: iload_2
     140: aload_3
     141: iload         5
     143: iload         18
     145: iadd
     146: iload         6
     148: iload         19
     150: iadd
     151: invokestatic  #104                // Method largestIsland$label:(I[[III)I
     154: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     157: aload         20
     159: swap
     160: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     165: pop
     166: iinc          13, 1
     169: goto          88
     172: aload         11
     174: checkcast     #54                 // class java/util/List
     177: nop
     178: checkcast     #134                // class java/lang/Iterable
     181: invokestatic  #140                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     184: astore        7
     186: aload         7
     188: checkcast     #134                // class java/lang/Iterable
     191: astore        9
     193: iconst_0
     194: istore        10
     196: aload         9
     198: invokeinterface #144,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     203: astore        11
     205: aload         11
     207: invokeinterface #149,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     212: ifeq          274
     215: aload         11
     217: invokeinterface #152,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     222: astore        12
     224: iload         10
     226: aload         12
     228: checkcast     #85                 // class java/lang/Number
     231: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     234: istore        13
     236: istore        20
     238: iconst_0
     239: istore        14
     241: aload_0
     242: iload         13
     244: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     247: iconst_0
     248: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     251: invokeinterface #128,  3          // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     256: checkcast     #85                 // class java/lang/Number
     259: invokevirtual #89                 // Method java/lang/Number.intValue:()I
     262: istore        21
     264: iload         20
     266: iload         21
     268: iadd
     269: istore        10
     271: goto          205
     274: iload         10
     276: istore        8
     278: iload         8
     280: iconst_1
     281: iadd
     282: iload         4
     284: invokestatic  #158                // Method java/lang/Math.max:(II)I
     287: istore        4
     289: iinc          6, 1
     292: goto          34
     295: iinc          5, 1
     298: goto          25
     301: iload         4
     303: ireturn

  static {};
    Code:
       0: new           #179                // class Solution$Companion
       3: dup
       4: aconst_null
       5: invokespecial #182                // Method Solution$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #186                // Field Companion:LSolution$Companion;
      11: iconst_4
      12: anewarray     #56                 // class kotlin/Pair
      15: astore_0
      16: aload_0
      17: iconst_0
      18: new           #56                 // class kotlin/Pair
      21: dup
      22: iconst_m1
      23: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      26: iconst_0
      27: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      30: invokespecial #65                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      33: aastore
      34: aload_0
      35: iconst_1
      36: new           #56                 // class kotlin/Pair
      39: dup
      40: iconst_1
      41: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      44: iconst_0
      45: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      48: invokespecial #65                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      51: aastore
      52: aload_0
      53: iconst_2
      54: new           #56                 // class kotlin/Pair
      57: dup
      58: iconst_0
      59: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      62: iconst_m1
      63: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      66: invokespecial #65                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      69: aastore
      70: aload_0
      71: iconst_3
      72: new           #56                 // class kotlin/Pair
      75: dup
      76: iconst_0
      77: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: iconst_1
      81: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      84: invokespecial #65                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      87: aastore
      88: aload_0
      89: putstatic     #96                 // Field steps:[Lkotlin/Pair;
      92: return
}

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

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


object Day02 {

    fun part1(input: String): Int {
        var sum = 0
        input.lines().forEach({ line ->
            var min = 0
            var max = 0
            line.split("\\s+".toRegex()).forEach {
                val number = it.toInt()
                if (min == 0 || min > number) {
                    min = number
                }

                if (max == 0 || max < number) {
                    max = number
                }
            }
            sum += max - min
        })
        return sum
    }

    fun part2(input: String): Int {
        var sum = 0
        input.lines().forEach({ line ->
            var lineSum = 0;
            val numbersString = line.split("\\s".toRegex())
            for (i in 0 until numbersString.size - 1) {
                (i + 1 until numbersString.size)
                        .filter {
                            val first = numbersString[i].toInt()
                            val second = numbersString[it].toInt()
                            if (first > second) {
                                first % second == 0
                            } else {
                                second % first == 0
                            }
                        }
                        .forEach {
                            val first = numbersString[i].toInt()
                            val second = numbersString[it].toInt()
                            if (first > second) {
                                lineSum += first / second
                            } else {
                                lineSum += second / first
                            }
                        }
            }
            sum += lineSum
        })
        return sum
    }

}

Compiled from "Day02.kt"
public final class Day02 {
  public static final Day02 INSTANCE;

  private Day02();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final int part1(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_2
       8: aload_1
       9: checkcast     #23                 // class java/lang/CharSequence
      12: invokestatic  #29                 // Method kotlin/text/StringsKt.lines:(Ljava/lang/CharSequence;)Ljava/util/List;
      15: checkcast     #31                 // class java/lang/Iterable
      18: astore_3
      19: iconst_0
      20: istore        4
      22: aload_3
      23: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      28: astore        5
      30: aload         5
      32: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      37: ifeq          200
      40: aload         5
      42: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      47: astore        6
      49: aload         6
      51: checkcast     #47                 // class java/lang/String
      54: astore        7
      56: iconst_0
      57: istore        8
      59: iconst_0
      60: istore        9
      62: iconst_0
      63: istore        10
      65: aload         7
      67: checkcast     #23                 // class java/lang/CharSequence
      70: astore        11
      72: new           #49                 // class kotlin/text/Regex
      75: dup
      76: ldc           #51                 // String \\s+
      78: invokespecial #54                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      81: astore        12
      83: iconst_0
      84: istore        13
      86: aload         12
      88: aload         11
      90: iload         13
      92: invokevirtual #58                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      95: checkcast     #31                 // class java/lang/Iterable
      98: astore        11
     100: nop
     101: iconst_0
     102: istore        12
     104: aload         11
     106: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     111: astore        13
     113: aload         13
     115: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     120: ifeq          186
     123: aload         13
     125: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     130: astore        14
     132: aload         14
     134: checkcast     #47                 // class java/lang/String
     137: astore        15
     139: iconst_0
     140: istore        16
     142: aload         15
     144: invokestatic  #63                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     147: istore        17
     149: iload         9
     151: ifeq          161
     154: iload         9
     156: iload         17
     158: if_icmple     165
     161: iload         17
     163: istore        9
     165: iload         10
     167: ifeq          177
     170: iload         10
     172: iload         17
     174: if_icmpge     181
     177: iload         17
     179: istore        10
     181: nop
     182: nop
     183: goto          113
     186: nop
     187: iload_2
     188: iload         10
     190: iload         9
     192: isub
     193: iadd
     194: istore_2
     195: nop
     196: nop
     197: goto          30
     200: nop
     201: iload_2
     202: ireturn

  public final int part2(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_2
       8: aload_1
       9: checkcast     #23                 // class java/lang/CharSequence
      12: invokestatic  #29                 // Method kotlin/text/StringsKt.lines:(Ljava/lang/CharSequence;)Ljava/util/List;
      15: checkcast     #31                 // class java/lang/Iterable
      18: astore_3
      19: iconst_0
      20: istore        4
      22: aload_3
      23: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      28: astore        5
      30: aload         5
      32: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      37: ifeq          427
      40: aload         5
      42: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      47: astore        6
      49: aload         6
      51: checkcast     #47                 // class java/lang/String
      54: astore        7
      56: iconst_0
      57: istore        8
      59: iconst_0
      60: istore        9
      62: aload         7
      64: checkcast     #23                 // class java/lang/CharSequence
      67: astore        10
      69: new           #49                 // class kotlin/text/Regex
      72: dup
      73: ldc           #81                 // String \\s
      75: invokespecial #54                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      78: astore        11
      80: iconst_0
      81: istore        12
      83: aload         11
      85: aload         10
      87: iload         12
      89: invokevirtual #58                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      92: astore        13
      94: iconst_0
      95: istore        10
      97: aload         13
      99: invokeinterface #87,  1           // InterfaceMethod java/util/List.size:()I
     104: iconst_1
     105: isub
     106: istore        11
     108: iload         10
     110: iload         11
     112: if_icmpge     417
     115: iload         10
     117: iconst_1
     118: iadd
     119: aload         13
     121: invokeinterface #87,  1           // InterfaceMethod java/util/List.size:()I
     126: invokestatic  #93                 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     129: checkcast     #31                 // class java/lang/Iterable
     132: astore        12
     134: nop
     135: iconst_0
     136: istore        14
     138: aload         12
     140: astore        15
     142: new           #95                 // class java/util/ArrayList
     145: dup
     146: invokespecial #96                 // Method java/util/ArrayList."<init>":()V
     149: checkcast     #98                 // class java/util/Collection
     152: astore        16
     154: iconst_0
     155: istore        17
     157: aload         15
     159: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     164: astore        18
     166: aload         18
     168: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     173: ifeq          285
     176: aload         18
     178: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     183: astore        19
     185: aload         19
     187: checkcast     #100                // class java/lang/Number
     190: invokevirtual #103                // Method java/lang/Number.intValue:()I
     193: istore        20
     195: iconst_0
     196: istore        21
     198: aload         13
     200: iload         10
     202: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     207: checkcast     #47                 // class java/lang/String
     210: invokestatic  #63                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     213: istore        22
     215: aload         13
     217: iload         20
     219: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     224: checkcast     #47                 // class java/lang/String
     227: invokestatic  #63                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     230: istore        23
     232: iload         22
     234: iload         23
     236: if_icmple     255
     239: iload         22
     241: iload         23
     243: irem
     244: ifne          251
     247: iconst_1
     248: goto          268
     251: iconst_0
     252: goto          268
     255: iload         23
     257: iload         22
     259: irem
     260: ifne          267
     263: iconst_1
     264: goto          268
     267: iconst_0
     268: nop
     269: ifeq          166
     272: aload         16
     274: aload         19
     276: invokeinterface #111,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     281: pop
     282: goto          166
     285: aload         16
     287: checkcast     #83                 // class java/util/List
     290: nop
     291: checkcast     #31                 // class java/lang/Iterable
     294: astore        12
     296: nop
     297: iconst_0
     298: istore        14
     300: aload         12
     302: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     307: astore        15
     309: aload         15
     311: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     316: ifeq          410
     319: aload         15
     321: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     326: astore        16
     328: aload         16
     330: checkcast     #100                // class java/lang/Number
     333: invokevirtual #103                // Method java/lang/Number.intValue:()I
     336: istore        17
     338: iconst_0
     339: istore        18
     341: aload         13
     343: iload         10
     345: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     350: checkcast     #47                 // class java/lang/String
     353: invokestatic  #63                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     356: istore        19
     358: aload         13
     360: iload         17
     362: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     367: checkcast     #47                 // class java/lang/String
     370: invokestatic  #63                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     373: istore        20
     375: iload         19
     377: iload         20
     379: if_icmple     395
     382: iload         9
     384: iload         19
     386: iload         20
     388: idiv
     389: iadd
     390: istore        9
     392: goto          405
     395: iload         9
     397: iload         20
     399: iload         19
     401: idiv
     402: iadd
     403: istore        9
     405: nop
     406: nop
     407: goto          309
     410: nop
     411: iinc          10, 1
     414: goto          108
     417: iload_2
     418: iload         9
     420: iadd
     421: istore_2
     422: nop
     423: nop
     424: goto          30
     427: nop
     428: iload_2
     429: ireturn

  static {};
    Code:
       0: new           #2                  // class Day02
       3: dup
       4: invokespecial #129                // Method "<init>":()V
       7: putstatic     #132                // Field INSTANCE:LDay02;
      10: return
}


object RomanNumeral {
    fun value(x: Int): String {
        val result = StringBuilder()
        var remainder = x

        while (remainder > 0) {
            val next = firstNotExceeding(remainder)
            result.append(next.literal)
            remainder -= next.value
        }

        return result.toString()
    }
}

private fun firstNotExceeding(x: Int): Term {
    for (i in 0 until atoms.size - 1) {
        val candidates = if (i % 2 == 0)
            listOf(
                atoms[i],
                atoms[i] - atoms[i + 2]
            )
        else
            listOf(
                atoms[i] + atoms[i + 1] + atoms[i + 1] + atoms[i + 1],
                atoms[i] + atoms[i + 1] + atoms[i + 1],
                atoms[i] + atoms[i + 1],
                atoms[i],
                atoms[i] - atoms[i + 1]
            )

        val result = candidates.find {it.value <= x}
        if (result != null) return result
    }

    return atoms.last()
}

private val atoms = listOf(
    Term(1000, "M"),
    Term(500, "D"),
    Term(100, "C"),
    Term(50, "L"),
    Term(10, "X"),
    Term(5, "V"),
    Term(1, "I")
)

private data class Term(val value: Int, val literal: String) {
    operator fun plus(other: Term): Term {
        return Term(value + other.value, literal + other.literal)
    }

    operator fun minus(other: Term): Term {
        return Term(value - other.value, other.literal + literal)
    }
}

Compiled from "RomanNumeral.kt"
public final class RomanNumeral {
  public static final RomanNumeral INSTANCE;

  private RomanNumeral();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final java.lang.String value(int);
    Code:
       0: new           #15                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #16                 // Method java/lang/StringBuilder."<init>":()V
       7: astore_2
       8: iload_1
       9: istore_3
      10: iload_3
      11: ifle          41
      14: iload_3
      15: invokestatic  #22                 // Method RomanNumeralKt.access$firstNotExceeding:(I)LTerm;
      18: astore        4
      20: aload_2
      21: aload         4
      23: invokevirtual #28                 // Method Term.getLiteral:()Ljava/lang/String;
      26: invokevirtual #32                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      29: pop
      30: iload_3
      31: aload         4
      33: invokevirtual #36                 // Method Term.getValue:()I
      36: isub
      37: istore_3
      38: goto          10
      41: aload_2
      42: invokevirtual #39                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      45: dup
      46: ldc           #41                 // String toString(...)
      48: invokestatic  #47                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      51: areturn

  static {};
    Code:
       0: new           #2                  // class RomanNumeral
       3: dup
       4: invokespecial #56                 // Method "<init>":()V
       7: putstatic     #59                 // Field INSTANCE:LRomanNumeral;
      10: return
}

Compiled from "RomanNumeral.kt"
public final class RomanNumeralKt {
  private static final java.util.List<Term> atoms;

  private static final Term firstNotExceeding(int);
    Code:
       0: iconst_0
       1: istore_1
       2: getstatic     #10                 // Field atoms:Ljava/util/List;
       5: invokeinterface #16,  1           // InterfaceMethod java/util/List.size:()I
      10: iconst_1
      11: isub
      12: istore_2
      13: iload_1
      14: iload_2
      15: if_icmpge     378
      18: iload_1
      19: iconst_2
      20: irem
      21: ifne          84
      24: iconst_2
      25: anewarray     #18                 // class Term
      28: astore        4
      30: aload         4
      32: iconst_0
      33: getstatic     #10                 // Field atoms:Ljava/util/List;
      36: iload_1
      37: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      42: aastore
      43: aload         4
      45: iconst_1
      46: getstatic     #10                 // Field atoms:Ljava/util/List;
      49: iload_1
      50: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      55: checkcast     #18                 // class Term
      58: getstatic     #10                 // Field atoms:Ljava/util/List;
      61: iload_1
      62: iconst_2
      63: iadd
      64: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      69: checkcast     #18                 // class Term
      72: invokevirtual #26                 // Method Term.minus:(LTerm;)LTerm;
      75: aastore
      76: aload         4
      78: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      81: goto          291
      84: iconst_5
      85: anewarray     #18                 // class Term
      88: astore        4
      90: aload         4
      92: iconst_0
      93: getstatic     #10                 // Field atoms:Ljava/util/List;
      96: iload_1
      97: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     102: checkcast     #18                 // class Term
     105: getstatic     #10                 // Field atoms:Ljava/util/List;
     108: iload_1
     109: iconst_1
     110: iadd
     111: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     116: checkcast     #18                 // class Term
     119: invokevirtual #35                 // Method Term.plus:(LTerm;)LTerm;
     122: getstatic     #10                 // Field atoms:Ljava/util/List;
     125: iload_1
     126: iconst_1
     127: iadd
     128: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     133: checkcast     #18                 // class Term
     136: invokevirtual #35                 // Method Term.plus:(LTerm;)LTerm;
     139: getstatic     #10                 // Field atoms:Ljava/util/List;
     142: iload_1
     143: iconst_1
     144: iadd
     145: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     150: checkcast     #18                 // class Term
     153: invokevirtual #35                 // Method Term.plus:(LTerm;)LTerm;
     156: aastore
     157: aload         4
     159: iconst_1
     160: getstatic     #10                 // Field atoms:Ljava/util/List;
     163: iload_1
     164: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     169: checkcast     #18                 // class Term
     172: getstatic     #10                 // Field atoms:Ljava/util/List;
     175: iload_1
     176: iconst_1
     177: iadd
     178: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     183: checkcast     #18                 // class Term
     186: invokevirtual #35                 // Method Term.plus:(LTerm;)LTerm;
     189: getstatic     #10                 // Field atoms:Ljava/util/List;
     192: iload_1
     193: iconst_1
     194: iadd
     195: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     200: checkcast     #18                 // class Term
     203: invokevirtual #35                 // Method Term.plus:(LTerm;)LTerm;
     206: aastore
     207: aload         4
     209: iconst_2
     210: getstatic     #10                 // Field atoms:Ljava/util/List;
     213: iload_1
     214: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     219: checkcast     #18                 // class Term
     222: getstatic     #10                 // Field atoms:Ljava/util/List;
     225: iload_1
     226: iconst_1
     227: iadd
     228: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     233: checkcast     #18                 // class Term
     236: invokevirtual #35                 // Method Term.plus:(LTerm;)LTerm;
     239: aastore
     240: aload         4
     242: iconst_3
     243: getstatic     #10                 // Field atoms:Ljava/util/List;
     246: iload_1
     247: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     252: aastore
     253: aload         4
     255: iconst_4
     256: getstatic     #10                 // Field atoms:Ljava/util/List;
     259: iload_1
     260: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     265: checkcast     #18                 // class Term
     268: getstatic     #10                 // Field atoms:Ljava/util/List;
     271: iload_1
     272: iconst_1
     273: iadd
     274: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     279: checkcast     #18                 // class Term
     282: invokevirtual #26                 // Method Term.minus:(LTerm;)LTerm;
     285: aastore
     286: aload         4
     288: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     291: astore_3
     292: aload_3
     293: checkcast     #37                 // class java/lang/Iterable
     296: astore        5
     298: aload         5
     300: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     305: astore        6
     307: aload         6
     309: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     314: ifeq          358
     317: aload         6
     319: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     324: astore        7
     326: aload         7
     328: checkcast     #18                 // class Term
     331: astore        8
     333: iconst_0
     334: istore        9
     336: aload         8
     338: invokevirtual #54                 // Method Term.getValue:()I
     341: iload_0
     342: if_icmpgt     349
     345: iconst_1
     346: goto          350
     349: iconst_0
     350: ifeq          307
     353: aload         7
     355: goto          359
     358: aconst_null
     359: checkcast     #18                 // class Term
     362: astore        4
     364: aload         4
     366: dup
     367: ifnull        371
     370: areturn
     371: pop
     372: iinc          1, 1
     375: goto          13
     378: getstatic     #10                 // Field atoms:Ljava/util/List;
     381: invokestatic  #58                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     384: checkcast     #18                 // class Term
     387: areturn

  public static final Term access$firstNotExceeding(int);
    Code:
       0: iload_0
       1: invokestatic  #71                 // Method firstNotExceeding:(I)LTerm;
       4: areturn

  static {};
    Code:
       0: bipush        7
       2: anewarray     #18                 // class Term
       5: astore_0
       6: aload_0
       7: iconst_0
       8: new           #18                 // class Term
      11: dup
      12: sipush        1000
      15: ldc           #75                 // String M
      17: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
      20: aastore
      21: aload_0
      22: iconst_1
      23: new           #18                 // class Term
      26: dup
      27: sipush        500
      30: ldc           #81                 // String D
      32: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
      35: aastore
      36: aload_0
      37: iconst_2
      38: new           #18                 // class Term
      41: dup
      42: bipush        100
      44: ldc           #83                 // String C
      46: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
      49: aastore
      50: aload_0
      51: iconst_3
      52: new           #18                 // class Term
      55: dup
      56: bipush        50
      58: ldc           #85                 // String L
      60: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
      63: aastore
      64: aload_0
      65: iconst_4
      66: new           #18                 // class Term
      69: dup
      70: bipush        10
      72: ldc           #87                 // String X
      74: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
      77: aastore
      78: aload_0
      79: iconst_5
      80: new           #18                 // class Term
      83: dup
      84: iconst_5
      85: ldc           #89                 // String V
      87: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
      90: aastore
      91: aload_0
      92: bipush        6
      94: new           #18                 // class Term
      97: dup
      98: iconst_1
      99: ldc           #90                 // String I
     101: invokespecial #79                 // Method Term."<init>":(ILjava/lang/String;)V
     104: aastore
     105: aload_0
     106: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     109: putstatic     #10                 // Field atoms:Ljava/util/List;
     112: return
}


data class Series(val s: String) {
    init {
        require(Regex("^[0-9]*$") matches s)
    }

    fun getLargestProduct(length: Int): Int {
        require(length <= s.length)

        val subSeqs = s.split("0").filter {it != ""}
        val subSolutions = subSeqs.map {largestProductOfNonZeroes(digits(it), length)}
        return subSolutions.max() ?: if (length == 0) 1 else 0
    }
}

private fun largestProductOfNonZeroes(ds: List<Int>, length: Int): Int {
    if (ds.size < length) return 0

    var result = product(ds.take(length))
    var runningProd = result

    for (i in length..(ds.size - 1)) {
        runningProd = (runningProd / (ds[i - length])) * ds[i]

        if (runningProd > result) {
            result = runningProd
        }
    }

    return result
}

private fun digits(s: String) =
    s.map {it.toString().toInt()}

private fun product(xs: List<Int>): Int =
    xs.fold(1, {m, x -> m * x})

Compiled from "Series.kt"
public final class Series {
  private final java.lang.String s;

  public Series(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String s
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #21                 // Field s:Ljava/lang/String;
      15: nop
      16: new           #23                 // class kotlin/text/Regex
      19: dup
      20: ldc           #25                 // String ^[0-9]*$
      22: invokespecial #27                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      25: aload_0
      26: getfield      #21                 // Field s:Ljava/lang/String;
      29: checkcast     #29                 // class java/lang/CharSequence
      32: invokevirtual #33                 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z
      35: ifne          53
      38: ldc           #35                 // String Failed requirement.
      40: astore_2
      41: new           #37                 // class java/lang/IllegalArgumentException
      44: dup
      45: aload_2
      46: invokevirtual #41                 // Method java/lang/Object.toString:()Ljava/lang/String;
      49: invokespecial #42                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      52: athrow
      53: nop
      54: return

  public final java.lang.String getS();
    Code:
       0: aload_0
       1: getfield      #21                 // Field s:Ljava/lang/String;
       4: areturn

  public final int getLargestProduct(int);
    Code:
       0: iload_1
       1: aload_0
       2: getfield      #21                 // Field s:Ljava/lang/String;
       5: invokevirtual #53                 // Method java/lang/String.length:()I
       8: if_icmpgt     15
      11: iconst_1
      12: goto          16
      15: iconst_0
      16: ifne          34
      19: ldc           #35                 // String Failed requirement.
      21: astore_3
      22: new           #37                 // class java/lang/IllegalArgumentException
      25: dup
      26: aload_3
      27: invokevirtual #41                 // Method java/lang/Object.toString:()Ljava/lang/String;
      30: invokespecial #42                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      33: athrow
      34: aload_0
      35: getfield      #21                 // Field s:Ljava/lang/String;
      38: checkcast     #29                 // class java/lang/CharSequence
      41: iconst_1
      42: anewarray     #46                 // class java/lang/String
      45: astore_3
      46: aload_3
      47: iconst_0
      48: ldc           #55                 // String 0
      50: aastore
      51: aload_3
      52: iconst_0
      53: iconst_0
      54: bipush        6
      56: aconst_null
      57: invokestatic  #61                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      60: checkcast     #63                 // class java/lang/Iterable
      63: astore_3
      64: iconst_0
      65: istore        4
      67: aload_3
      68: astore        5
      70: new           #65                 // class java/util/ArrayList
      73: dup
      74: invokespecial #66                 // Method java/util/ArrayList."<init>":()V
      77: checkcast     #68                 // class java/util/Collection
      80: astore        6
      82: iconst_0
      83: istore        7
      85: aload         5
      87: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      92: astore        8
      94: aload         8
      96: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     101: ifeq          154
     104: aload         8
     106: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     111: astore        9
     113: aload         9
     115: checkcast     #46                 // class java/lang/String
     118: astore        10
     120: iconst_0
     121: istore        11
     123: aload         10
     125: ldc           #84                 // String
     127: invokestatic  #88                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     130: ifne          137
     133: iconst_1
     134: goto          138
     137: iconst_0
     138: ifeq          94
     141: aload         6
     143: aload         9
     145: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     150: pop
     151: goto          94
     154: aload         6
     156: checkcast     #94                 // class java/util/List
     159: nop
     160: astore_2
     161: aload_2
     162: checkcast     #63                 // class java/lang/Iterable
     165: astore        4
     167: iconst_0
     168: istore        5
     170: aload         4
     172: astore        6
     174: new           #65                 // class java/util/ArrayList
     177: dup
     178: aload         4
     180: bipush        10
     182: invokestatic  #100                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     185: invokespecial #103                // Method java/util/ArrayList."<init>":(I)V
     188: checkcast     #68                 // class java/util/Collection
     191: astore        7
     193: iconst_0
     194: istore        8
     196: aload         6
     198: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     203: astore        9
     205: aload         9
     207: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     212: ifeq          262
     215: aload         9
     217: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     222: astore        10
     224: aload         7
     226: aload         10
     228: checkcast     #46                 // class java/lang/String
     231: astore        11
     233: astore        13
     235: iconst_0
     236: istore        12
     238: aload         11
     240: invokestatic  #109                // Method SeriesKt.access$digits:(Ljava/lang/String;)Ljava/util/List;
     243: iload_1
     244: invokestatic  #113                // Method SeriesKt.access$largestProductOfNonZeroes:(Ljava/util/List;I)I
     247: invokestatic  #119                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     250: aload         13
     252: swap
     253: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     258: pop
     259: goto          205
     262: aload         7
     264: checkcast     #94                 // class java/util/List
     267: nop
     268: astore_3
     269: aload_3
     270: checkcast     #63                 // class java/lang/Iterable
     273: invokestatic  #123                // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     276: checkcast     #125                // class java/lang/Number
     279: invokevirtual #128                // Method java/lang/Number.intValue:()I
     282: ireturn

  public final java.lang.String component1();
    Code:
       0: aload_0
       1: getfield      #21                 // Field s:Ljava/lang/String;
       4: areturn

  public final Series copy(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String s
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Series
       9: dup
      10: aload_1
      11: invokespecial #153                // Method "<init>":(Ljava/lang/String;)V
      14: areturn

  public static Series copy$default(Series, java.lang.String, int, java.lang.Object);
    Code:
       0: iload_2
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #21                 // Field s:Ljava/lang/String;
      10: astore_1
      11: aload_0
      12: aload_1
      13: invokevirtual #157                // Method copy:(Ljava/lang/String;)LSeries;
      16: areturn

  public java.lang.String toString();
    Code:
       0: new           #159                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #160                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #162                // String Series(s=
       9: invokevirtual #166                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #21                 // Field s:Ljava/lang/String;
      16: invokevirtual #166                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      19: bipush        41
      21: invokevirtual #169                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      24: invokevirtual #170                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      27: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #21                 // Field s:Ljava/lang/String;
       4: invokevirtual #173                // Method java/lang/String.hashCode:()I
       7: 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 Series
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Series
      20: astore_2
      21: aload_0
      22: getfield      #21                 // Field s:Ljava/lang/String;
      25: aload_2
      26: getfield      #21                 // Field s:Ljava/lang/String;
      29: invokestatic  #88                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      32: ifne          37
      35: iconst_0
      36: ireturn
      37: iconst_1
      38: ireturn
}

Compiled from "Series.kt"
public final class SeriesKt {
  private static final int largestProductOfNonZeroes(java.util.List<java.lang.Integer>, int);
    Code:
       0: aload_0
       1: invokeinterface #13,  1           // InterfaceMethod java/util/List.size:()I
       6: iload_1
       7: if_icmpge     12
      10: iconst_0
      11: ireturn
      12: aload_0
      13: checkcast     #15                 // class java/lang/Iterable
      16: iload_1
      17: invokestatic  #21                 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
      20: invokestatic  #25                 // Method product:(Ljava/util/List;)I
      23: istore_2
      24: iload_2
      25: istore_3
      26: iload_1
      27: istore        4
      29: aload_0
      30: invokeinterface #13,  1           // InterfaceMethod java/util/List.size:()I
      35: istore        5
      37: iload         4
      39: iload         5
      41: if_icmpge     91
      44: iload_3
      45: aload_0
      46: iload         4
      48: iload_1
      49: isub
      50: invokeinterface #29,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      55: checkcast     #31                 // class java/lang/Number
      58: invokevirtual #34                 // Method java/lang/Number.intValue:()I
      61: idiv
      62: aload_0
      63: iload         4
      65: invokeinterface #29,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      70: checkcast     #31                 // class java/lang/Number
      73: invokevirtual #34                 // Method java/lang/Number.intValue:()I
      76: imul
      77: istore_3
      78: iload_3
      79: iload_2
      80: if_icmple     85
      83: iload_3
      84: istore_2
      85: iinc          4, 1
      88: goto          37
      91: iload_2
      92: ireturn

  private static final java.util.List<java.lang.Integer> digits(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #46                 // class java/lang/CharSequence
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #48                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: invokeinterface #50,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      19: invokespecial #54                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #56                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: iconst_0
      31: istore        6
      33: iload         6
      35: aload_3
      36: invokeinterface #50,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      41: if_icmpge     92
      44: aload_3
      45: iload         6
      47: invokeinterface #60,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      52: istore        7
      54: aload         4
      56: iload         7
      58: istore        8
      60: astore        10
      62: iconst_0
      63: istore        9
      65: iload         8
      67: invokestatic  #66                 // Method java/lang/String.valueOf:(C)Ljava/lang/String;
      70: invokestatic  #72                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      73: nop
      74: invokestatic  #75                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      77: aload         10
      79: swap
      80: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      85: pop
      86: iinc          6, 1
      89: goto          33
      92: aload         4
      94: checkcast     #9                  // class java/util/List
      97: nop
      98: areturn

  private static final int product(java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: checkcast     #15                 // class java/lang/Iterable
       4: astore_1
       5: iconst_1
       6: istore_2
       7: iconst_0
       8: istore_3
       9: iload_2
      10: istore        4
      12: aload_1
      13: invokeinterface #97,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      18: astore        5
      20: aload         5
      22: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      27: ifeq          66
      30: aload         5
      32: invokeinterface #107,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      37: astore        6
      39: iload         4
      41: aload         6
      43: checkcast     #31                 // class java/lang/Number
      46: invokevirtual #34                 // Method java/lang/Number.intValue:()I
      49: istore        7
      51: istore        8
      53: iconst_0
      54: istore        9
      56: iload         8
      58: iload         7
      60: imul
      61: istore        4
      63: goto          20
      66: iload         4
      68: ireturn

  public static final int access$largestProductOfNonZeroes(java.util.List, int);
    Code:
       0: aload_0
       1: iload_1
       2: invokestatic  #121                // Method largestProductOfNonZeroes:(Ljava/util/List;I)I
       5: ireturn

  public static final java.util.List access$digits(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #124                // Method digits:(Ljava/lang/String;)Ljava/util/List;
       4: areturn
}


import java.io.File
import java.math.BigInteger
import java.security.MessageDigest
import kotlin.math.abs

typealias Vector2D = Coord2D

/**
 * Reads lines from the given input txt file.
 */
fun readInput(name: String) = File("src", "$name.txt")
    .readLines()

/**
 * Read whole input txt file as one string.
 */
fun readWholeInput(name: String) = File("src", "$name.txt")
    .readText()

/**
 * Converts string to md5 hash.
 */
fun String.md5() = BigInteger(1, MessageDigest.getInstance("MD5").digest(toByteArray()))
    .toString(16)
    .padStart(32, '0')

data class Coord2D(val x: Int, val y: Int) {
    fun adjacentTo(coord2D: Coord2D): Boolean {
        return abs(x - coord2D.x) <= 1 && abs(y - coord2D.y) <= 1
    }

    operator fun minus(other: Coord2D): Coord2D {
        return Coord2D(this.x - other.x, this.y - other.y)
    }

    operator fun plus(other: Coord2D): Coord2D {
        return Coord2D(this.x + other.x, this.y + other.y)
    }

    fun moved(byX: Int, byY: Int): Coord2D {
        return Coord2D(x + byX, y + byY)
    }

    fun manhattenDistance(other: Vector2D): Int {
        return abs(this.x - other.x) + abs(this.y - other.y)
    }
}

/**
 * Returns the product (multiplication) of all elements in the collection.
 */
fun List<Int>.product(): Int {
    return this.reduce { acc, i -> acc * i }
}

/**
 * All permutations of a list
 * Source: https://rosettacode.org/wiki/Permutations#Kotlin
 */
fun <T> permute(input: List<T>): List<List<T>> {
    if (input.size == 1) return listOf(input)
    val perms = mutableListOf<List<T>>()
    val toInsert = input[0]
    for (perm in permute(input.drop(1))) {
        for (i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, toInsert)
            perms.add(newPerm)
        }
    }
    return perms
}

Compiled from "Utils.kt"
public final class UtilsKt {
  public static final java.util.List<java.lang.String> readInput(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #10                 // String name
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #18                 // class java/io/File
       9: dup
      10: ldc           #20                 // String src
      12: new           #22                 // class java/lang/StringBuilder
      15: dup
      16: invokespecial #26                 // Method java/lang/StringBuilder."<init>":()V
      19: aload_0
      20: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      23: ldc           #32                 // String .txt
      25: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      28: invokevirtual #36                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      31: invokespecial #39                 // Method java/io/File."<init>":(Ljava/lang/String;Ljava/lang/String;)V
      34: aconst_null
      35: iconst_1
      36: aconst_null
      37: invokestatic  #45                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      40: areturn

  public static final java.lang.String readWholeInput(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #10                 // String name
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #18                 // class java/io/File
       9: dup
      10: ldc           #20                 // String src
      12: new           #22                 // class java/lang/StringBuilder
      15: dup
      16: invokespecial #26                 // Method java/lang/StringBuilder."<init>":()V
      19: aload_0
      20: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      23: ldc           #32                 // String .txt
      25: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      28: invokevirtual #36                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      31: invokespecial #39                 // Method java/io/File."<init>":(Ljava/lang/String;Ljava/lang/String;)V
      34: aconst_null
      35: iconst_1
      36: aconst_null
      37: invokestatic  #52                 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;
      40: areturn

  public static final java.lang.String md5(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #55                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #57                 // class java/math/BigInteger
       9: dup
      10: iconst_1
      11: ldc           #59                 // String MD5
      13: invokestatic  #65                 // Method java/security/MessageDigest.getInstance:(Ljava/lang/String;)Ljava/security/MessageDigest;
      16: aload_0
      17: astore_1
      18: getstatic     #71                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      21: aload_1
      22: swap
      23: invokevirtual #77                 // Method java/lang/String.getBytes:(Ljava/nio/charset/Charset;)[B
      26: dup
      27: ldc           #79                 // String getBytes(...)
      29: invokestatic  #82                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      32: invokevirtual #86                 // Method java/security/MessageDigest.digest:([B)[B
      35: invokespecial #89                 // Method java/math/BigInteger."<init>":(I[B)V
      38: bipush        16
      40: invokevirtual #92                 // Method java/math/BigInteger.toString:(I)Ljava/lang/String;
      43: dup
      44: ldc           #94                 // String toString(...)
      46: invokestatic  #82                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      49: bipush        32
      51: bipush        48
      53: invokestatic  #100                // Method kotlin/text/StringsKt.padStart:(Ljava/lang/String;IC)Ljava/lang/String;
      56: areturn

  public static final int product(java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #55                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #106                // class java/lang/Iterable
      10: astore_1
      11: iconst_0
      12: istore_2
      13: aload_1
      14: invokeinterface #110,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      19: astore_3
      20: aload_3
      21: invokeinterface #116,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      26: ifne          39
      29: new           #118                // class java/lang/UnsupportedOperationException
      32: dup
      33: ldc           #120                // String Empty collection can\'t be reduced.
      35: invokespecial #123                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
      38: athrow
      39: aload_3
      40: invokeinterface #127,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: astore        4
      47: aload_3
      48: invokeinterface #116,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          96
      56: aload         4
      58: aload_3
      59: invokeinterface #127,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      64: checkcast     #129                // class java/lang/Number
      67: invokevirtual #133                // Method java/lang/Number.intValue:()I
      70: istore        5
      72: checkcast     #129                // class java/lang/Number
      75: invokevirtual #133                // Method java/lang/Number.intValue:()I
      78: istore        6
      80: iconst_0
      81: istore        7
      83: iload         6
      85: iload         5
      87: imul
      88: invokestatic  #139                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      91: astore        4
      93: goto          47
      96: aload         4
      98: checkcast     #129                // class java/lang/Number
     101: invokevirtual #133                // Method java/lang/Number.intValue:()I
     104: ireturn

  public static final <T> java.util.List<java.util.List<T>> permute(java.util.List<? extends T>);
    Code:
       0: aload_0
       1: ldc           #157                // String input
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokeinterface #162,  1          // InterfaceMethod java/util/List.size:()I
      12: iconst_1
      13: if_icmpne     21
      16: aload_0
      17: invokestatic  #168                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      20: areturn
      21: new           #170                // class java/util/ArrayList
      24: dup
      25: invokespecial #171                // Method java/util/ArrayList."<init>":()V
      28: checkcast     #159                // class java/util/List
      31: astore_1
      32: aload_0
      33: iconst_0
      34: invokeinterface #175,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      39: astore_2
      40: aload_0
      41: checkcast     #106                // class java/lang/Iterable
      44: iconst_1
      45: invokestatic  #179                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
      48: invokestatic  #181                // Method permute:(Ljava/util/List;)Ljava/util/List;
      51: invokeinterface #182,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      56: astore_3
      57: aload_3
      58: invokeinterface #116,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      63: ifeq          138
      66: aload_3
      67: invokeinterface #127,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      72: checkcast     #159                // class java/util/List
      75: astore        4
      77: iconst_0
      78: istore        5
      80: aload         4
      82: invokeinterface #162,  1          // InterfaceMethod java/util/List.size:()I
      87: istore        6
      89: iload         5
      91: iload         6
      93: if_icmpgt     57
      96: aload         4
      98: checkcast     #184                // class java/util/Collection
     101: invokestatic  #188                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     104: astore        7
     106: aload         7
     108: iload         5
     110: aload_2
     111: invokeinterface #192,  3          // InterfaceMethod java/util/List.add:(ILjava/lang/Object;)V
     116: aload_1
     117: aload         7
     119: invokeinterface #195,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     124: pop
     125: iload         5
     127: iload         6
     129: if_icmpeq     57
     132: iinc          5, 1
     135: goto          96
     138: aload_1
     139: areturn
}


fun main() {

    fun part1(input: List<List<Int>>): Int {
        return input.count { list ->
            (list[0] <= list[2] && list[1] >= list[3])
                    || (list[0] >= list[2] && list[1] <= list[3])
        }
    }

    fun part2(input: List<List<Int>>): Int {
        return input.count { list ->
            (list[0] <= list[2] && list[2] <= list[1])
                    || (list[2] <= list[0] && list[0] <= list[3])
        }
    }

    val input = readInput("Day04")
        .map { line ->
            line.split(',', '-')
                .map { it.toInt() }
        }

    println(part1(input))
    println(part2(input))
}

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day04
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: checkcast     #16                 // class java/lang/Iterable
       8: astore_1
       9: nop
      10: iconst_0
      11: istore_2
      12: aload_1
      13: astore_3
      14: new           #18                 // class java/util/ArrayList
      17: dup
      18: aload_1
      19: bipush        10
      21: invokestatic  #24                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      24: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      27: checkcast     #30                 // class java/util/Collection
      30: astore        4
      32: iconst_0
      33: istore        5
      35: aload_3
      36: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        6
      43: aload         6
      45: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          225
      53: aload         6
      55: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        7
      62: aload         4
      64: aload         7
      66: checkcast     #46                 // class java/lang/String
      69: astore        8
      71: astore        20
      73: iconst_0
      74: istore        9
      76: aload         8
      78: checkcast     #48                 // class java/lang/CharSequence
      81: iconst_2
      82: newarray       char
      84: astore        10
      86: aload         10
      88: iconst_0
      89: bipush        44
      91: castore
      92: aload         10
      94: iconst_1
      95: bipush        45
      97: castore
      98: aload         10
     100: iconst_0
     101: iconst_0
     102: bipush        6
     104: aconst_null
     105: invokestatic  #54                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;
     108: checkcast     #16                 // class java/lang/Iterable
     111: astore        10
     113: nop
     114: iconst_0
     115: istore        11
     117: aload         10
     119: astore        12
     121: new           #18                 // class java/util/ArrayList
     124: dup
     125: aload         10
     127: bipush        10
     129: invokestatic  #24                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     132: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     135: checkcast     #30                 // class java/util/Collection
     138: astore        13
     140: iconst_0
     141: istore        14
     143: aload         12
     145: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     150: astore        15
     152: aload         15
     154: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     159: ifeq          206
     162: aload         15
     164: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     169: astore        16
     171: aload         13
     173: aload         16
     175: checkcast     #46                 // class java/lang/String
     178: astore        17
     180: astore        18
     182: iconst_0
     183: istore        19
     185: aload         17
     187: invokestatic  #60                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     190: nop
     191: invokestatic  #64                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     194: aload         18
     196: swap
     197: invokeinterface #68,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     202: pop
     203: goto          152
     206: aload         13
     208: checkcast     #70                 // class java/util/List
     211: nop
     212: nop
     213: aload         20
     215: swap
     216: invokeinterface #68,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     221: pop
     222: goto          43
     225: aload         4
     227: checkcast     #70                 // class java/util/List
     230: nop
     231: astore_0
     232: aload_0
     233: invokestatic  #74                 // Method main$part1:(Ljava/util/List;)I
     236: istore_1
     237: getstatic     #80                 // Field java/lang/System.out:Ljava/io/PrintStream;
     240: iload_1
     241: invokevirtual #85                 // Method java/io/PrintStream.println:(I)V
     244: aload_0
     245: invokestatic  #88                 // Method main$part2:(Ljava/util/List;)I
     248: istore_1
     249: getstatic     #80                 // Field java/lang/System.out:Ljava/io/PrintStream;
     252: iload_1
     253: invokevirtual #85                 // Method java/io/PrintStream.println:(I)V
     256: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #108                // Method main:()V
       3: return

  private static final int main$part1(java.util.List<? extends java.util.List<java.lang.Integer>>);
    Code:
       0: aload_0
       1: checkcast     #16                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: instanceof    #30                 // class java/util/Collection
      11: ifeq          30
      14: aload_1
      15: checkcast     #30                 // class java/util/Collection
      18: invokeinterface #114,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      23: ifeq          30
      26: iconst_0
      27: goto          215
      30: iconst_0
      31: istore_3
      32: aload_1
      33: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        4
      40: aload         4
      42: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          214
      50: aload         4
      52: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        5
      59: aload         5
      61: checkcast     #70                 // class java/util/List
      64: astore        6
      66: iconst_0
      67: istore        7
      69: aload         6
      71: iconst_0
      72: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      77: checkcast     #120                // class java/lang/Number
      80: invokevirtual #124                // Method java/lang/Number.intValue:()I
      83: aload         6
      85: iconst_2
      86: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      91: checkcast     #120                // class java/lang/Number
      94: invokevirtual #124                // Method java/lang/Number.intValue:()I
      97: if_icmpgt     131
     100: aload         6
     102: iconst_1
     103: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     108: checkcast     #120                // class java/lang/Number
     111: invokevirtual #124                // Method java/lang/Number.intValue:()I
     114: aload         6
     116: iconst_3
     117: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     122: checkcast     #120                // class java/lang/Number
     125: invokevirtual #124                // Method java/lang/Number.intValue:()I
     128: if_icmpge     193
     131: aload         6
     133: iconst_0
     134: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     139: checkcast     #120                // class java/lang/Number
     142: invokevirtual #124                // Method java/lang/Number.intValue:()I
     145: aload         6
     147: iconst_2
     148: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     153: checkcast     #120                // class java/lang/Number
     156: invokevirtual #124                // Method java/lang/Number.intValue:()I
     159: if_icmplt     197
     162: aload         6
     164: iconst_1
     165: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     170: checkcast     #120                // class java/lang/Number
     173: invokevirtual #124                // Method java/lang/Number.intValue:()I
     176: aload         6
     178: iconst_3
     179: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     184: checkcast     #120                // class java/lang/Number
     187: invokevirtual #124                // Method java/lang/Number.intValue:()I
     190: if_icmpgt     197
     193: iconst_1
     194: goto          198
     197: iconst_0
     198: ifeq          40
     201: iinc          3, 1
     204: iload_3
     205: ifge          40
     208: invokestatic  #127                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     211: goto          40
     214: iload_3
     215: ireturn

  private static final int main$part2(java.util.List<? extends java.util.List<java.lang.Integer>>);
    Code:
       0: aload_0
       1: checkcast     #16                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: instanceof    #30                 // class java/util/Collection
      11: ifeq          30
      14: aload_1
      15: checkcast     #30                 // class java/util/Collection
      18: invokeinterface #114,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      23: ifeq          30
      26: iconst_0
      27: goto          215
      30: iconst_0
      31: istore_3
      32: aload_1
      33: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        4
      40: aload         4
      42: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          214
      50: aload         4
      52: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        5
      59: aload         5
      61: checkcast     #70                 // class java/util/List
      64: astore        6
      66: iconst_0
      67: istore        7
      69: aload         6
      71: iconst_0
      72: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      77: checkcast     #120                // class java/lang/Number
      80: invokevirtual #124                // Method java/lang/Number.intValue:()I
      83: aload         6
      85: iconst_2
      86: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      91: checkcast     #120                // class java/lang/Number
      94: invokevirtual #124                // Method java/lang/Number.intValue:()I
      97: if_icmpgt     131
     100: aload         6
     102: iconst_2
     103: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     108: checkcast     #120                // class java/lang/Number
     111: invokevirtual #124                // Method java/lang/Number.intValue:()I
     114: aload         6
     116: iconst_1
     117: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     122: checkcast     #120                // class java/lang/Number
     125: invokevirtual #124                // Method java/lang/Number.intValue:()I
     128: if_icmple     193
     131: aload         6
     133: iconst_2
     134: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     139: checkcast     #120                // class java/lang/Number
     142: invokevirtual #124                // Method java/lang/Number.intValue:()I
     145: aload         6
     147: iconst_0
     148: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     153: checkcast     #120                // class java/lang/Number
     156: invokevirtual #124                // Method java/lang/Number.intValue:()I
     159: if_icmpgt     197
     162: aload         6
     164: iconst_0
     165: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     170: checkcast     #120                // class java/lang/Number
     173: invokevirtual #124                // Method java/lang/Number.intValue:()I
     176: aload         6
     178: iconst_3
     179: invokeinterface #118,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     184: checkcast     #120                // class java/lang/Number
     187: invokevirtual #124                // Method java/lang/Number.intValue:()I
     190: if_icmpgt     197
     193: iconst_1
     194: goto          198
     197: iconst_0
     198: ifeq          40
     201: iinc          3, 1
     204: iload_3
     205: ifge          40
     208: invokestatic  #127                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     211: goto          40
     214: iload_3
     215: ireturn
}