fun main() {
    val input = readInput("Day09")
    println(Day09.part1(input))
    println(Day09.part2(input))
}

data class HeadMovement(val direction: Direction, val steps: Int)

enum class Direction { U, R, D, L, }

class Day09 {
    companion object {
        fun part1(input: List<String>): Int {
            return getTailPositions(input, 2)
        }

        fun part2(input: List<String>): Int {
            return getTailPositions(input, 10)
        }

        fun getTailPositions(input: List<String>, numOfKnots: Int): Int {
            val moves = input.map { it.split(" ") }.map { HeadMovement(Direction.valueOf(it[0]), it[1].toInt()) }
            val knots = (1..numOfKnots.coerceAtLeast(2)).toList().map { Coordinate(0, 0) }
            val tailPositions = mutableSetOf<String>("0,0")

            val head = knots.first()
            val tail = knots.last()
            for (move in moves) {
                for (step in (1..move.steps)) {
                    when (move.direction) {
                        Direction.R -> head.x++
                        Direction.U -> head.y--
                        Direction.D -> head.y++
                        Direction.L -> head.x--
                    }
                    for (index in (1 until knots.size)) {
                        val lead = knots[index - 1]
                        val current = knots[index]
                        if (current.x in (lead.x - 1..lead.x + 1) && current.y in (lead.y - 1..lead.y + 1)) break
                        if (lead.x > current.x) current.x++ else if (lead.x < current.x) current.x--
                        if (lead.y > current.y) current.y++ else if (lead.y < current.y) current.y--
                    }
                    tailPositions.add("${tail.x},${tail.y}")
                }
            }
            return tailPositions.size
        }
    }
}

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

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

  static {};
    Code:
       0: new           #13                 // class Day09$Companion
       3: dup
       4: aconst_null
       5: invokespecial #16                 // Method Day09$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #20                 // Field Companion:LDay09$Companion;
      11: return
}

Compiled from "Day09.kt"
public final class Day09$Companion$WhenMappings {
  public static final int[] $EnumSwitchMapping$0;

  static {};
    Code:
       0: invokestatic  #14                 // Method Direction.values:()[LDirection;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Direction.R:LDirection;
      12: invokevirtual #22                 // Method Direction.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Direction.U:LDirection;
      26: invokevirtual #22                 // Method Direction.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Direction.D:LDirection;
      40: invokevirtual #22                 // Method Direction.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: nop
      50: aload_0
      51: getstatic     #31                 // Field Direction.L:LDirection;
      54: invokevirtual #22                 // Method Direction.ordinal:()I
      57: iconst_4
      58: iastore
      59: goto          63
      62: astore_1
      63: aload_0
      64: putstatic     #35                 // Field $EnumSwitchMapping$0:[I
      67: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
          49    59    62   Class java/lang/NoSuchFieldError
}

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

  public final int part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: iconst_2
       9: invokevirtual #26                 // Method getTailPositions:(Ljava/util/List;I)I
      12: ireturn

  public final int part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: bipush        10
      10: invokevirtual #26                 // Method getTailPositions:(Ljava/util/List;I)I
      13: ireturn

  public final int getTailPositions(java.util.List<java.lang.String>, int);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #31                 // class java/lang/Iterable
      10: astore        4
      12: iconst_0
      13: istore        5
      15: aload         4
      17: astore        6
      19: new           #33                 // class java/util/ArrayList
      22: dup
      23: aload         4
      25: bipush        10
      27: invokestatic  #39                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      30: invokespecial #42                 // Method java/util/ArrayList."<init>":(I)V
      33: checkcast     #44                 // class java/util/Collection
      36: astore        7
      38: iconst_0
      39: istore        8
      41: aload         6
      43: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      48: astore        9
      50: aload         9
      52: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          122
      60: aload         9
      62: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        10
      69: aload         7
      71: aload         10
      73: checkcast     #60                 // class java/lang/String
      76: astore        11
      78: astore        19
      80: iconst_0
      81: istore        12
      83: aload         11
      85: checkcast     #62                 // class java/lang/CharSequence
      88: iconst_1
      89: anewarray     #60                 // class java/lang/String
      92: astore        13
      94: aload         13
      96: iconst_0
      97: ldc           #64                 // String
      99: aastore
     100: aload         13
     102: iconst_0
     103: iconst_0
     104: bipush        6
     106: aconst_null
     107: invokestatic  #70                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     110: aload         19
     112: swap
     113: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     118: pop
     119: goto          50
     122: aload         7
     124: checkcast     #76                 // class java/util/List
     127: nop
     128: checkcast     #31                 // class java/lang/Iterable
     131: astore        4
     133: nop
     134: iconst_0
     135: istore        5
     137: aload         4
     139: astore        6
     141: new           #33                 // class java/util/ArrayList
     144: dup
     145: aload         4
     147: bipush        10
     149: invokestatic  #39                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     152: invokespecial #42                 // Method java/util/ArrayList."<init>":(I)V
     155: checkcast     #44                 // class java/util/Collection
     158: astore        7
     160: iconst_0
     161: istore        8
     163: aload         6
     165: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     170: astore        9
     172: aload         9
     174: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     179: ifeq          252
     182: aload         9
     184: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     189: astore        10
     191: aload         7
     193: aload         10
     195: checkcast     #76                 // class java/util/List
     198: astore        11
     200: astore        19
     202: iconst_0
     203: istore        12
     205: new           #78                 // class HeadMovement
     208: dup
     209: aload         11
     211: iconst_0
     212: invokeinterface #82,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     217: checkcast     #60                 // class java/lang/String
     220: invokestatic  #88                 // Method Direction.valueOf:(Ljava/lang/String;)LDirection;
     223: aload         11
     225: iconst_1
     226: invokeinterface #82,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     231: checkcast     #60                 // class java/lang/String
     234: invokestatic  #94                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     237: invokespecial #97                 // Method HeadMovement."<init>":(LDirection;I)V
     240: aload         19
     242: swap
     243: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     248: pop
     249: goto          172
     252: aload         7
     254: checkcast     #76                 // class java/util/List
     257: nop
     258: astore_3
     259: new           #99                 // class kotlin/ranges/IntRange
     262: dup
     263: iconst_1
     264: iload_2
     265: iconst_2
     266: invokestatic  #105                // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
     269: invokespecial #108                // Method kotlin/ranges/IntRange."<init>":(II)V
     272: checkcast     #31                 // class java/lang/Iterable
     275: invokestatic  #112                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     278: checkcast     #31                 // class java/lang/Iterable
     281: astore        5
     283: iconst_0
     284: istore        6
     286: aload         5
     288: astore        7
     290: new           #33                 // class java/util/ArrayList
     293: dup
     294: aload         5
     296: bipush        10
     298: invokestatic  #39                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     301: invokespecial #42                 // Method java/util/ArrayList."<init>":(I)V
     304: checkcast     #44                 // class java/util/Collection
     307: astore        8
     309: iconst_0
     310: istore        9
     312: aload         7
     314: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     319: astore        10
     321: aload         10
     323: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     328: ifeq          378
     331: aload         10
     333: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     338: astore        11
     340: aload         8
     342: aload         11
     344: checkcast     #114                // class java/lang/Number
     347: invokevirtual #118                // Method java/lang/Number.intValue:()I
     350: istore        12
     352: astore        19
     354: iconst_0
     355: istore        13
     357: new           #120                // class Coordinate
     360: dup
     361: iconst_0
     362: iconst_0
     363: invokespecial #121                // Method Coordinate."<init>":(II)V
     366: aload         19
     368: swap
     369: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     374: pop
     375: goto          321
     378: aload         8
     380: checkcast     #76                 // class java/util/List
     383: nop
     384: astore        4
     386: iconst_1
     387: anewarray     #60                 // class java/lang/String
     390: astore        6
     392: aload         6
     394: iconst_0
     395: ldc           #123                // String 0,0
     397: aastore
     398: aload         6
     400: invokestatic  #129                // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;
     403: astore        5
     405: aload         4
     407: invokestatic  #133                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     410: checkcast     #120                // class Coordinate
     413: astore        6
     415: aload         4
     417: invokestatic  #136                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     420: checkcast     #120                // class Coordinate
     423: astore        7
     425: aload_3
     426: invokeinterface #137,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     431: astore        8
     433: aload         8
     435: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     440: ifeq          931
     443: aload         8
     445: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     450: checkcast     #78                 // class HeadMovement
     453: astore        9
     455: iconst_1
     456: istore        10
     458: aload         9
     460: invokevirtual #140                // Method HeadMovement.getSteps:()I
     463: istore        11
     465: iload         10
     467: iload         11
     469: if_icmpgt     433
     472: aload         9
     474: invokevirtual #144                // Method HeadMovement.getDirection:()LDirection;
     477: getstatic     #150                // Field Day09$Companion$WhenMappings.$EnumSwitchMapping$0:[I
     480: swap
     481: invokevirtual #153                // Method Direction.ordinal:()I
     484: iaload
     485: tableswitch   { // 1 to 4
                     1: 516
                     2: 535
                     3: 554
                     4: 573
               default: 592
          }
     516: aload         6
     518: invokevirtual #156                // Method Coordinate.getX:()I
     521: istore        14
     523: aload         6
     525: iload         14
     527: iconst_1
     528: iadd
     529: invokevirtual #159                // Method Coordinate.setX:(I)V
     532: goto          600
     535: aload         6
     537: invokevirtual #162                // Method Coordinate.getY:()I
     540: istore        14
     542: aload         6
     544: iload         14
     546: iconst_m1
     547: iadd
     548: invokevirtual #165                // Method Coordinate.setY:(I)V
     551: goto          600
     554: aload         6
     556: invokevirtual #162                // Method Coordinate.getY:()I
     559: istore        14
     561: aload         6
     563: iload         14
     565: iconst_1
     566: iadd
     567: invokevirtual #165                // Method Coordinate.setY:(I)V
     570: goto          600
     573: aload         6
     575: invokevirtual #156                // Method Coordinate.getX:()I
     578: istore        14
     580: aload         6
     582: iload         14
     584: iconst_m1
     585: iadd
     586: invokevirtual #159                // Method Coordinate.setX:(I)V
     589: goto          600
     592: new           #167                // class kotlin/NoWhenBranchMatchedException
     595: dup
     596: invokespecial #168                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     599: athrow
     600: iconst_1
     601: istore        12
     603: aload         4
     605: invokeinterface #171,  1          // InterfaceMethod java/util/List.size:()I
     610: istore        13
     612: iload         12
     614: iload         13
     616: if_icmpge     879
     619: aload         4
     621: iload         12
     623: iconst_1
     624: isub
     625: invokeinterface #82,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     630: checkcast     #120                // class Coordinate
     633: astore        14
     635: aload         4
     637: iload         12
     639: invokeinterface #82,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     644: checkcast     #120                // class Coordinate
     647: astore        15
     649: aload         14
     651: invokevirtual #156                // Method Coordinate.getX:()I
     654: iconst_1
     655: isub
     656: istore        16
     658: aload         14
     660: invokevirtual #156                // Method Coordinate.getX:()I
     663: iconst_1
     664: iadd
     665: istore        17
     667: aload         15
     669: invokevirtual #156                // Method Coordinate.getX:()I
     672: istore        18
     674: iload         16
     676: iload         18
     678: if_icmpgt     696
     681: iload         18
     683: iload         17
     685: if_icmpgt     692
     688: iconst_1
     689: goto          697
     692: iconst_0
     693: goto          697
     696: iconst_0
     697: ifeq          751
     700: aload         14
     702: invokevirtual #162                // Method Coordinate.getY:()I
     705: iconst_1
     706: isub
     707: istore        16
     709: aload         14
     711: invokevirtual #162                // Method Coordinate.getY:()I
     714: iconst_1
     715: iadd
     716: istore        17
     718: aload         15
     720: invokevirtual #162                // Method Coordinate.getY:()I
     723: istore        18
     725: iload         16
     727: iload         18
     729: if_icmpgt     747
     732: iload         18
     734: iload         17
     736: if_icmpgt     743
     739: iconst_1
     740: goto          748
     743: iconst_0
     744: goto          748
     747: iconst_0
     748: ifne          879
     751: aload         14
     753: invokevirtual #156                // Method Coordinate.getX:()I
     756: aload         15
     758: invokevirtual #156                // Method Coordinate.getX:()I
     761: if_icmple     783
     764: aload         15
     766: invokevirtual #156                // Method Coordinate.getX:()I
     769: istore        16
     771: aload         15
     773: iload         16
     775: iconst_1
     776: iadd
     777: invokevirtual #159                // Method Coordinate.setX:(I)V
     780: goto          812
     783: aload         14
     785: invokevirtual #156                // Method Coordinate.getX:()I
     788: aload         15
     790: invokevirtual #156                // Method Coordinate.getX:()I
     793: if_icmpge     812
     796: aload         15
     798: invokevirtual #156                // Method Coordinate.getX:()I
     801: istore        16
     803: aload         15
     805: iload         16
     807: iconst_m1
     808: iadd
     809: invokevirtual #159                // Method Coordinate.setX:(I)V
     812: aload         14
     814: invokevirtual #162                // Method Coordinate.getY:()I
     817: aload         15
     819: invokevirtual #162                // Method Coordinate.getY:()I
     822: if_icmple     844
     825: aload         15
     827: invokevirtual #162                // Method Coordinate.getY:()I
     830: istore        16
     832: aload         15
     834: iload         16
     836: iconst_1
     837: iadd
     838: invokevirtual #165                // Method Coordinate.setY:(I)V
     841: goto          873
     844: aload         14
     846: invokevirtual #162                // Method Coordinate.getY:()I
     849: aload         15
     851: invokevirtual #162                // Method Coordinate.getY:()I
     854: if_icmpge     873
     857: aload         15
     859: invokevirtual #162                // Method Coordinate.getY:()I
     862: istore        16
     864: aload         15
     866: iload         16
     868: iconst_m1
     869: iadd
     870: invokevirtual #165                // Method Coordinate.setY:(I)V
     873: iinc          12, 1
     876: goto          612
     879: aload         5
     881: new           #173                // class java/lang/StringBuilder
     884: dup
     885: invokespecial #174                // Method java/lang/StringBuilder."<init>":()V
     888: aload         7
     890: invokevirtual #156                // Method Coordinate.getX:()I
     893: invokevirtual #178                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     896: bipush        44
     898: invokevirtual #181                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     901: aload         7
     903: invokevirtual #162                // Method Coordinate.getY:()I
     906: invokevirtual #178                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     909: invokevirtual #185                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     912: invokeinterface #188,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     917: pop
     918: iload         10
     920: iload         11
     922: if_icmpeq     433
     925: iinc          10, 1
     928: goto          472
     931: aload         5
     933: invokeinterface #189,  1          // InterfaceMethod java/util/Set.size:()I
     938: ireturn

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

Compiled from "Day09.kt"
public final class Day09Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day09
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: getstatic     #19                 // Field Day09.Companion:LDay09$Companion;
       9: aload_0
      10: invokevirtual #25                 // Method Day09$Companion.part1:(Ljava/util/List;)I
      13: istore_1
      14: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      17: iload_1
      18: invokevirtual #37                 // Method java/io/PrintStream.println:(I)V
      21: getstatic     #19                 // Field Day09.Companion:LDay09$Companion;
      24: aload_0
      25: invokevirtual #40                 // Method Day09$Companion.part2:(Ljava/util/List;)I
      28: istore_1
      29: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      32: iload_1
      33: invokevirtual #37                 // Method java/io/PrintStream.println:(I)V
      36: return

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


fun main() {
    val input = readInput("Day10")
    printTime { println(Day10.part1(input)) }
    printTime { println(Day10.part2(input)) }
}

class Day10 {
    companion object {
        fun part1(input: List<String>): Int {
            var signalStrength = 0

            var x = 1
            var cycle = 1

            for (command in input) {
                cycle++
                if ((cycle - 20) % 40 == 0) {
                    signalStrength += cycle * x
                }
                if (command != "noop") {
                    x += command.substring(5).toInt()
                    cycle++
                    if ((cycle - 20) % 40 == 0) {
                        signalStrength += cycle * x
                    }
                }
            }

            return signalStrength
        }

        fun part2(input: List<String>): String {
            var crt = ""

            var x = 1
            var cycle = 1

            for (command in input) {
                val lineOffset = (cycle / 40) * 40
                crt += if (cycle - lineOffset - 1 in (x + -1..x + 1)) "▓" else "░"
                cycle++

                if (command != "noop") {
                    crt += if (cycle - lineOffset - 1 in (x - 1..x + 1)) "▓" else "░"
                    x += command.substring(5).toInt()
                    cycle++
                }
            }

            return crt.chunked(40).joinToString("\n")
        }
    }
}

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

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

  static {};
    Code:
       0: new           #13                 // class Day10$Companion
       3: dup
       4: aconst_null
       5: invokespecial #16                 // Method Day10$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #20                 // Field Companion:LDay10$Companion;
      11: return
}

Compiled from "Day10.kt"
public final class Day10Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day10
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aconst_null
       7: aconst_null
       8: aload_0
       9: invokedynamic #34,  0             // InvokeDynamic #0:invoke:(Ljava/util/List;)Lkotlin/jvm/functions/Function0;
      14: iconst_3
      15: aconst_null
      16: invokestatic  #38                 // Method UtilsKt.printTime$default:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
      19: aconst_null
      20: aconst_null
      21: aload_0
      22: invokedynamic #43,  0             // InvokeDynamic #1:invoke:(Ljava/util/List;)Lkotlin/jvm/functions/Function0;
      27: iconst_3
      28: aconst_null
      29: invokestatic  #38                 // Method UtilsKt.printTime$default:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
      32: return

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

  private static final kotlin.Unit main$lambda$0(java.util.List);
    Code:
       0: getstatic     #55                 // Field Day10.Companion:LDay10$Companion;
       3: aload_0
       4: invokevirtual #61                 // Method Day10$Companion.part1:(Ljava/util/List;)I
       7: istore_1
       8: getstatic     #67                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: iload_1
      12: invokevirtual #73                 // Method java/io/PrintStream.println:(I)V
      15: getstatic     #79                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      18: areturn

  private static final kotlin.Unit main$lambda$1(java.util.List);
    Code:
       0: getstatic     #55                 // Field Day10.Companion:LDay10$Companion;
       3: aload_0
       4: invokevirtual #84                 // Method Day10$Companion.part2:(Ljava/util/List;)Ljava/lang/String;
       7: getstatic     #67                 // Field java/lang/System.out:Ljava/io/PrintStream;
      10: swap
      11: invokevirtual #87                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      14: getstatic     #79                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      17: areturn
}

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

  public final int part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_2
       8: iconst_1
       9: istore_3
      10: iconst_1
      11: istore        4
      13: aload_1
      14: invokeinterface #28,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      19: astore        5
      21: aload         5
      23: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      28: ifeq          116
      31: aload         5
      33: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      38: checkcast     #40                 // class java/lang/String
      41: astore        6
      43: iinc          4, 1
      46: iload         4
      48: bipush        20
      50: isub
      51: bipush        40
      53: irem
      54: ifne          64
      57: iload_2
      58: iload         4
      60: iload_3
      61: imul
      62: iadd
      63: istore_2
      64: aload         6
      66: ldc           #42                 // String noop
      68: invokestatic  #46                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      71: ifne          21
      74: iload_3
      75: aload         6
      77: iconst_5
      78: invokevirtual #50                 // Method java/lang/String.substring:(I)Ljava/lang/String;
      81: dup
      82: ldc           #52                 // String substring(...)
      84: invokestatic  #55                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      87: invokestatic  #61                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      90: iadd
      91: istore_3
      92: iinc          4, 1
      95: iload         4
      97: bipush        20
      99: isub
     100: bipush        40
     102: irem
     103: ifne          21
     106: iload_2
     107: iload         4
     109: iload_3
     110: imul
     111: iadd
     112: istore_2
     113: goto          21
     116: iload_2
     117: ireturn

  public final java.lang.String part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #73                 // String
       8: astore_2
       9: iconst_1
      10: istore_3
      11: iconst_1
      12: istore        4
      14: aload_1
      15: invokeinterface #28,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      20: astore        5
      22: aload         5
      24: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      29: ifeq          231
      32: aload         5
      34: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      39: checkcast     #40                 // class java/lang/String
      42: astore        6
      44: iload         4
      46: bipush        40
      48: idiv
      49: bipush        40
      51: imul
      52: istore        7
      54: new           #75                 // class java/lang/StringBuilder
      57: dup
      58: invokespecial #76                 // Method java/lang/StringBuilder."<init>":()V
      61: aload_2
      62: invokevirtual #80                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      65: iload_3
      66: iconst_m1
      67: iadd
      68: istore        8
      70: iload_3
      71: iconst_1
      72: iadd
      73: istore        9
      75: iload         4
      77: iload         7
      79: isub
      80: iconst_1
      81: isub
      82: istore        10
      84: iload         8
      86: iload         10
      88: if_icmpgt     106
      91: iload         10
      93: iload         9
      95: if_icmpgt     102
      98: iconst_1
      99: goto          107
     102: iconst_0
     103: goto          107
     106: iconst_0
     107: ifeq          115
     110: ldc           #82                 // String ▓
     112: goto          117
     115: ldc           #84                 // String ░
     117: invokevirtual #80                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     120: invokevirtual #88                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     123: astore_2
     124: iinc          4, 1
     127: aload         6
     129: ldc           #42                 // String noop
     131: invokestatic  #46                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     134: ifne          22
     137: new           #75                 // class java/lang/StringBuilder
     140: dup
     141: invokespecial #76                 // Method java/lang/StringBuilder."<init>":()V
     144: aload_2
     145: invokevirtual #80                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     148: iload_3
     149: iconst_1
     150: isub
     151: istore        8
     153: iload_3
     154: iconst_1
     155: iadd
     156: istore        9
     158: iload         4
     160: iload         7
     162: isub
     163: iconst_1
     164: isub
     165: istore        10
     167: iload         8
     169: iload         10
     171: if_icmpgt     189
     174: iload         10
     176: iload         9
     178: if_icmpgt     185
     181: iconst_1
     182: goto          190
     185: iconst_0
     186: goto          190
     189: iconst_0
     190: ifeq          198
     193: ldc           #82                 // String ▓
     195: goto          200
     198: ldc           #84                 // String ░
     200: invokevirtual #80                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     203: invokevirtual #88                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     206: astore_2
     207: iload_3
     208: aload         6
     210: iconst_5
     211: invokevirtual #50                 // Method java/lang/String.substring:(I)Ljava/lang/String;
     214: dup
     215: ldc           #52                 // String substring(...)
     217: invokestatic  #55                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     220: invokestatic  #61                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     223: iadd
     224: istore_3
     225: iinc          4, 1
     228: goto          22
     231: aload_2
     232: checkcast     #90                 // class java/lang/CharSequence
     235: bipush        40
     237: invokestatic  #96                 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
     240: checkcast     #98                 // class java/lang/Iterable
     243: ldc           #100                // String \n
     245: checkcast     #90                 // class java/lang/CharSequence
     248: aconst_null
     249: aconst_null
     250: iconst_0
     251: aconst_null
     252: aconst_null
     253: bipush        62
     255: aconst_null
     256: invokestatic  #106                // 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;
     259: areturn

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