package main.kotlin2023

class Day001 {
    fun part1(input: String): Int {
        val data = parseInput(input)
        return data.map { row -> row.find { it.isDigit() }.toString() + row.findLast { it.isDigit() }.toString() }
            .sumOf { it.toInt() }
    }

    fun part2(input: String): Int {
        val data = parseInput(input)
        val mapped = data
            .map { row -> row.replace("nine", "n9e", false) }
            .map { row -> row.replace("eight", "e8t", false) }
            .map { row -> row.replace("seven", "s7n", false) }
            .map { row -> row.replace("six", "s6x", false) }
            .map { row -> row.replace("five", "f5e", false) }
            .map { row -> row.replace("four", "f4r", false) }
            .map { row -> row.replace("three", "t3e", false) }
            .map { row -> row.replace("two", "t2o", false) }
            .map { row -> row.replace("one", "o1e", false) }
            .map { row -> row.find { it.isDigit() }.toString() + row.findLast { it.isDigit() }.toString() }
            .sumOf { it.toInt() }

        return mapped
    }
    private fun parseInput(input: String) = input.split("\n")
}

Compiled from "Day001.kt"
public final class main.kotlin2023.Day001 {
  public main.kotlin2023.Day001();
    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: aload_0
       7: aload_1
       8: invokespecial #25                 // Method parseInput:(Ljava/lang/String;)Ljava/util/List;
      11: astore_2
      12: aload_2
      13: checkcast     #27                 // class java/lang/Iterable
      16: astore_3
      17: iconst_0
      18: istore        4
      20: aload_3
      21: astore        5
      23: new           #29                 // class java/util/ArrayList
      26: dup
      27: aload_3
      28: bipush        10
      30: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      33: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
      36: checkcast     #40                 // class java/util/Collection
      39: astore        6
      41: iconst_0
      42: istore        7
      44: aload         5
      46: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      51: astore        8
      53: aload         8
      55: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      60: ifeq          269
      63: aload         8
      65: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      70: astore        9
      72: aload         6
      74: aload         9
      76: checkcast     #56                 // class java/lang/String
      79: astore        10
      81: astore        20
      83: iconst_0
      84: istore        11
      86: new           #58                 // class java/lang/StringBuilder
      89: dup
      90: invokespecial #59                 // Method java/lang/StringBuilder."<init>":()V
      93: aload         10
      95: checkcast     #61                 // class java/lang/CharSequence
      98: astore        12
     100: astore        13
     102: aload         12
     104: astore        14
     106: iconst_0
     107: istore        15
     109: iload         15
     111: aload         14
     113: invokeinterface #65,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     118: if_icmpge     162
     121: aload         14
     123: iload         15
     125: invokeinterface #69,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     130: istore        16
     132: iload         16
     134: istore        17
     136: iconst_0
     137: istore        18
     139: iload         17
     141: invokestatic  #75                 // Method java/lang/Character.isDigit:(C)Z
     144: nop
     145: ifeq          156
     148: iload         16
     150: invokestatic  #79                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     153: goto          163
     156: iinc          15, 1
     159: goto          109
     162: aconst_null
     163: aload         13
     165: swap
     166: invokevirtual #83                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     169: aload         10
     171: checkcast     #61                 // class java/lang/CharSequence
     174: astore        12
     176: astore        13
     178: aload         12
     180: astore        14
     182: aload         14
     184: invokeinterface #65,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     189: iconst_m1
     190: iadd
     191: istore        15
     193: iconst_0
     194: iload         15
     196: if_icmpgt     247
     199: iload         15
     201: istore        16
     203: iinc          15, -1
     206: aload         14
     208: iload         16
     210: invokeinterface #69,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     215: istore        17
     217: iload         17
     219: istore        18
     221: iconst_0
     222: istore        19
     224: iload         18
     226: invokestatic  #75                 // Method java/lang/Character.isDigit:(C)Z
     229: nop
     230: ifeq          241
     233: iload         17
     235: invokestatic  #79                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     238: goto          248
     241: iconst_0
     242: iload         15
     244: if_icmple     199
     247: aconst_null
     248: aload         13
     250: swap
     251: invokevirtual #83                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     254: invokevirtual #87                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     257: aload         20
     259: swap
     260: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     265: pop
     266: goto          53
     269: aload         6
     271: checkcast     #93                 // class java/util/List
     274: nop
     275: checkcast     #27                 // class java/lang/Iterable
     278: astore_3
     279: iconst_0
     280: istore        4
     282: aload_3
     283: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     288: astore        5
     290: aload         5
     292: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     297: ifeq          341
     300: aload         5
     302: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     307: astore        6
     309: iload         4
     311: aload         6
     313: checkcast     #56                 // class java/lang/String
     316: astore        7
     318: istore        20
     320: iconst_0
     321: istore        8
     323: aload         7
     325: invokestatic  #98                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     328: nop
     329: istore        21
     331: iload         20
     333: iload         21
     335: iadd
     336: istore        4
     338: goto          290
     341: iload         4
     343: 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: aload_0
       7: aload_1
       8: invokespecial #25                 // Method parseInput:(Ljava/lang/String;)Ljava/util/List;
      11: astore_2
      12: aload_2
      13: checkcast     #27                 // class java/lang/Iterable
      16: astore        4
      18: nop
      19: iconst_0
      20: istore        5
      22: aload         4
      24: astore        6
      26: new           #29                 // class java/util/ArrayList
      29: dup
      30: aload         4
      32: bipush        10
      34: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      37: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
      40: checkcast     #40                 // class java/util/Collection
      43: astore        7
      45: iconst_0
      46: istore        8
      48: aload         6
      50: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      55: astore        9
      57: aload         9
      59: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      64: ifeq          112
      67: aload         9
      69: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      74: astore        10
      76: aload         7
      78: aload         10
      80: checkcast     #56                 // class java/lang/String
      83: astore        11
      85: astore        21
      87: iconst_0
      88: istore        12
      90: aload         11
      92: ldc           #121                // String nine
      94: ldc           #123                // String n9e
      96: iconst_0
      97: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     100: aload         21
     102: swap
     103: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     108: pop
     109: goto          57
     112: aload         7
     114: checkcast     #93                 // class java/util/List
     117: nop
     118: checkcast     #27                 // class java/lang/Iterable
     121: astore        4
     123: nop
     124: iconst_0
     125: istore        5
     127: aload         4
     129: astore        6
     131: new           #29                 // class java/util/ArrayList
     134: dup
     135: aload         4
     137: bipush        10
     139: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     142: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     145: checkcast     #40                 // class java/util/Collection
     148: astore        7
     150: iconst_0
     151: istore        8
     153: aload         6
     155: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     160: astore        9
     162: aload         9
     164: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     169: ifeq          217
     172: aload         9
     174: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     179: astore        10
     181: aload         7
     183: aload         10
     185: checkcast     #56                 // class java/lang/String
     188: astore        11
     190: astore        21
     192: iconst_0
     193: istore        12
     195: aload         11
     197: ldc           #131                // String eight
     199: ldc           #133                // String e8t
     201: iconst_0
     202: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     205: aload         21
     207: swap
     208: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     213: pop
     214: goto          162
     217: aload         7
     219: checkcast     #93                 // class java/util/List
     222: nop
     223: checkcast     #27                 // class java/lang/Iterable
     226: astore        4
     228: nop
     229: iconst_0
     230: istore        5
     232: aload         4
     234: astore        6
     236: new           #29                 // class java/util/ArrayList
     239: dup
     240: aload         4
     242: bipush        10
     244: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     247: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     250: checkcast     #40                 // class java/util/Collection
     253: astore        7
     255: iconst_0
     256: istore        8
     258: aload         6
     260: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     265: astore        9
     267: aload         9
     269: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     274: ifeq          322
     277: aload         9
     279: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     284: astore        10
     286: aload         7
     288: aload         10
     290: checkcast     #56                 // class java/lang/String
     293: astore        11
     295: astore        21
     297: iconst_0
     298: istore        12
     300: aload         11
     302: ldc           #135                // String seven
     304: ldc           #137                // String s7n
     306: iconst_0
     307: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     310: aload         21
     312: swap
     313: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     318: pop
     319: goto          267
     322: aload         7
     324: checkcast     #93                 // class java/util/List
     327: nop
     328: checkcast     #27                 // class java/lang/Iterable
     331: astore        4
     333: nop
     334: iconst_0
     335: istore        5
     337: aload         4
     339: astore        6
     341: new           #29                 // class java/util/ArrayList
     344: dup
     345: aload         4
     347: bipush        10
     349: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     352: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     355: checkcast     #40                 // class java/util/Collection
     358: astore        7
     360: iconst_0
     361: istore        8
     363: aload         6
     365: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     370: astore        9
     372: aload         9
     374: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     379: ifeq          427
     382: aload         9
     384: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     389: astore        10
     391: aload         7
     393: aload         10
     395: checkcast     #56                 // class java/lang/String
     398: astore        11
     400: astore        21
     402: iconst_0
     403: istore        12
     405: aload         11
     407: ldc           #139                // String six
     409: ldc           #141                // String s6x
     411: iconst_0
     412: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     415: aload         21
     417: swap
     418: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     423: pop
     424: goto          372
     427: aload         7
     429: checkcast     #93                 // class java/util/List
     432: nop
     433: checkcast     #27                 // class java/lang/Iterable
     436: astore        4
     438: nop
     439: iconst_0
     440: istore        5
     442: aload         4
     444: astore        6
     446: new           #29                 // class java/util/ArrayList
     449: dup
     450: aload         4
     452: bipush        10
     454: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     457: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     460: checkcast     #40                 // class java/util/Collection
     463: astore        7
     465: iconst_0
     466: istore        8
     468: aload         6
     470: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     475: astore        9
     477: aload         9
     479: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     484: ifeq          532
     487: aload         9
     489: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     494: astore        10
     496: aload         7
     498: aload         10
     500: checkcast     #56                 // class java/lang/String
     503: astore        11
     505: astore        21
     507: iconst_0
     508: istore        12
     510: aload         11
     512: ldc           #143                // String five
     514: ldc           #145                // String f5e
     516: iconst_0
     517: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     520: aload         21
     522: swap
     523: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     528: pop
     529: goto          477
     532: aload         7
     534: checkcast     #93                 // class java/util/List
     537: nop
     538: checkcast     #27                 // class java/lang/Iterable
     541: astore        4
     543: nop
     544: iconst_0
     545: istore        5
     547: aload         4
     549: astore        6
     551: new           #29                 // class java/util/ArrayList
     554: dup
     555: aload         4
     557: bipush        10
     559: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     562: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     565: checkcast     #40                 // class java/util/Collection
     568: astore        7
     570: iconst_0
     571: istore        8
     573: aload         6
     575: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     580: astore        9
     582: aload         9
     584: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     589: ifeq          637
     592: aload         9
     594: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     599: astore        10
     601: aload         7
     603: aload         10
     605: checkcast     #56                 // class java/lang/String
     608: astore        11
     610: astore        21
     612: iconst_0
     613: istore        12
     615: aload         11
     617: ldc           #147                // String four
     619: ldc           #149                // String f4r
     621: iconst_0
     622: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     625: aload         21
     627: swap
     628: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     633: pop
     634: goto          582
     637: aload         7
     639: checkcast     #93                 // class java/util/List
     642: nop
     643: checkcast     #27                 // class java/lang/Iterable
     646: astore        4
     648: nop
     649: iconst_0
     650: istore        5
     652: aload         4
     654: astore        6
     656: new           #29                 // class java/util/ArrayList
     659: dup
     660: aload         4
     662: bipush        10
     664: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     667: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     670: checkcast     #40                 // class java/util/Collection
     673: astore        7
     675: iconst_0
     676: istore        8
     678: aload         6
     680: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     685: astore        9
     687: aload         9
     689: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     694: ifeq          742
     697: aload         9
     699: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     704: astore        10
     706: aload         7
     708: aload         10
     710: checkcast     #56                 // class java/lang/String
     713: astore        11
     715: astore        21
     717: iconst_0
     718: istore        12
     720: aload         11
     722: ldc           #151                // String three
     724: ldc           #153                // String t3e
     726: iconst_0
     727: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     730: aload         21
     732: swap
     733: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     738: pop
     739: goto          687
     742: aload         7
     744: checkcast     #93                 // class java/util/List
     747: nop
     748: checkcast     #27                 // class java/lang/Iterable
     751: astore        4
     753: nop
     754: iconst_0
     755: istore        5
     757: aload         4
     759: astore        6
     761: new           #29                 // class java/util/ArrayList
     764: dup
     765: aload         4
     767: bipush        10
     769: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     772: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     775: checkcast     #40                 // class java/util/Collection
     778: astore        7
     780: iconst_0
     781: istore        8
     783: aload         6
     785: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     790: astore        9
     792: aload         9
     794: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     799: ifeq          847
     802: aload         9
     804: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     809: astore        10
     811: aload         7
     813: aload         10
     815: checkcast     #56                 // class java/lang/String
     818: astore        11
     820: astore        21
     822: iconst_0
     823: istore        12
     825: aload         11
     827: ldc           #155                // String two
     829: ldc           #157                // String t2o
     831: iconst_0
     832: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     835: aload         21
     837: swap
     838: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     843: pop
     844: goto          792
     847: aload         7
     849: checkcast     #93                 // class java/util/List
     852: nop
     853: checkcast     #27                 // class java/lang/Iterable
     856: astore        4
     858: nop
     859: iconst_0
     860: istore        5
     862: aload         4
     864: astore        6
     866: new           #29                 // class java/util/ArrayList
     869: dup
     870: aload         4
     872: bipush        10
     874: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     877: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     880: checkcast     #40                 // class java/util/Collection
     883: astore        7
     885: iconst_0
     886: istore        8
     888: aload         6
     890: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     895: astore        9
     897: aload         9
     899: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     904: ifeq          952
     907: aload         9
     909: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     914: astore        10
     916: aload         7
     918: aload         10
     920: checkcast     #56                 // class java/lang/String
     923: astore        11
     925: astore        21
     927: iconst_0
     928: istore        12
     930: aload         11
     932: ldc           #159                // String one
     934: ldc           #161                // String o1e
     936: iconst_0
     937: invokestatic  #129                // Method kotlin/text/StringsKt.replace:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
     940: aload         21
     942: swap
     943: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     948: pop
     949: goto          897
     952: aload         7
     954: checkcast     #93                 // class java/util/List
     957: nop
     958: checkcast     #27                 // class java/lang/Iterable
     961: astore        4
     963: nop
     964: iconst_0
     965: istore        5
     967: aload         4
     969: astore        6
     971: new           #29                 // class java/util/ArrayList
     974: dup
     975: aload         4
     977: bipush        10
     979: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     982: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
     985: checkcast     #40                 // class java/util/Collection
     988: astore        7
     990: iconst_0
     991: istore        8
     993: aload         6
     995: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1000: astore        9
    1002: aload         9
    1004: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1009: ifeq          1218
    1012: aload         9
    1014: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1019: astore        10
    1021: aload         7
    1023: aload         10
    1025: checkcast     #56                 // class java/lang/String
    1028: astore        11
    1030: astore        21
    1032: iconst_0
    1033: istore        12
    1035: new           #58                 // class java/lang/StringBuilder
    1038: dup
    1039: invokespecial #59                 // Method java/lang/StringBuilder."<init>":()V
    1042: aload         11
    1044: checkcast     #61                 // class java/lang/CharSequence
    1047: astore        13
    1049: astore        14
    1051: aload         13
    1053: astore        15
    1055: iconst_0
    1056: istore        16
    1058: iload         16
    1060: aload         15
    1062: invokeinterface #65,  1           // InterfaceMethod java/lang/CharSequence.length:()I
    1067: if_icmpge     1111
    1070: aload         15
    1072: iload         16
    1074: invokeinterface #69,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
    1079: istore        17
    1081: iload         17
    1083: istore        18
    1085: iconst_0
    1086: istore        19
    1088: iload         18
    1090: invokestatic  #75                 // Method java/lang/Character.isDigit:(C)Z
    1093: nop
    1094: ifeq          1105
    1097: iload         17
    1099: invokestatic  #79                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
    1102: goto          1112
    1105: iinc          16, 1
    1108: goto          1058
    1111: aconst_null
    1112: aload         14
    1114: swap
    1115: invokevirtual #83                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    1118: aload         11
    1120: checkcast     #61                 // class java/lang/CharSequence
    1123: astore        13
    1125: astore        14
    1127: aload         13
    1129: astore        15
    1131: aload         15
    1133: invokeinterface #65,  1           // InterfaceMethod java/lang/CharSequence.length:()I
    1138: iconst_m1
    1139: iadd
    1140: istore        16
    1142: iconst_0
    1143: iload         16
    1145: if_icmpgt     1196
    1148: iload         16
    1150: istore        17
    1152: iinc          16, -1
    1155: aload         15
    1157: iload         17
    1159: invokeinterface #69,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
    1164: istore        18
    1166: iload         18
    1168: istore        19
    1170: iconst_0
    1171: istore        20
    1173: iload         19
    1175: invokestatic  #75                 // Method java/lang/Character.isDigit:(C)Z
    1178: nop
    1179: ifeq          1190
    1182: iload         18
    1184: invokestatic  #79                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
    1187: goto          1197
    1190: iconst_0
    1191: iload         16
    1193: if_icmple     1148
    1196: aconst_null
    1197: aload         14
    1199: swap
    1200: invokevirtual #83                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    1203: invokevirtual #87                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1206: aload         21
    1208: swap
    1209: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1214: pop
    1215: goto          1002
    1218: aload         7
    1220: checkcast     #93                 // class java/util/List
    1223: nop
    1224: checkcast     #27                 // class java/lang/Iterable
    1227: astore        4
    1229: iconst_0
    1230: istore        5
    1232: aload         4
    1234: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1239: astore        6
    1241: aload         6
    1243: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1248: ifeq          1292
    1251: aload         6
    1253: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1258: astore        7
    1260: iload         5
    1262: aload         7
    1264: checkcast     #56                 // class java/lang/String
    1267: astore        8
    1269: istore        21
    1271: iconst_0
    1272: istore        9
    1274: aload         8
    1276: invokestatic  #98                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
    1279: nop
    1280: istore        22
    1282: iload         21
    1284: iload         22
    1286: iadd
    1287: istore        5
    1289: goto          1241
    1292: iload         5
    1294: istore_3
    1295: iload_3
    1296: ireturn

  private final java.util.List<java.lang.String> parseInput(java.lang.String);
    Code:
       0: aload_1
       1: checkcast     #61                 // class java/lang/CharSequence
       4: iconst_1
       5: anewarray     #56                 // class java/lang/String
       8: astore_2
       9: aload_2
      10: iconst_0
      11: ldc           #178                // String \n
      13: aastore
      14: aload_2
      15: iconst_0
      16: iconst_0
      17: bipush        6
      19: aconst_null
      20: invokestatic  #182                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      23: areturn
}


package com.yt8492.indikate

class RoutingPath(val parts: List<RoutingPathSegment>) {

    fun evaluate(path: String): PathEvaluationResult {
        val pathParts = path.splitToSequence("/")
            .filter { it.isNotBlank() }
            .toList()
        if (pathParts.size != parts.size) {
            return PathEvaluationResult(
                false,
                PathEvaluationResult.QUALITY_FAILED,
                emptyMap()
            )
        }
        var quality = PathEvaluationResult.QUALITY_CONSTANT
        val parameters = mutableMapOf<String, String>()
        pathParts.zip(parts).forEach { (pathPart, part) ->
            when (part) {
                is RoutingPathSegment.Constant -> {
                    if (part.value != pathPart) {
                        return PathEvaluationResult(
                            false,
                            PathEvaluationResult.QUALITY_FAILED,
                            emptyMap()
                        )
                    }
                }
                is RoutingPathSegment.Parameter -> {
                    quality *= PathEvaluationResult.QUALITY_PARAMETER
                    parameters[part.value] = pathPart
                }
                is RoutingPathSegment.WildCard -> {
                    quality *= PathEvaluationResult.QUALITY_WILDCARD
                }
            }
        }
        return PathEvaluationResult(
            true,
            quality,
            parameters
        )
    }

    companion object {
        private val ROOT: RoutingPath = RoutingPath(listOf())

        fun parse(path: String): RoutingPath {
            if (path == "/") return ROOT
            val parts = path.splitToSequence("/")
                .filter { it.isNotBlank() }
                .map {
                    when {
                        it == "*" -> RoutingPathSegment.WildCard
                        it.startsWith(":") -> RoutingPathSegment.Parameter(it.drop(1))
                        else -> RoutingPathSegment.Constant(it)
                    }
                }
                .toList()
            return RoutingPath(parts)
        }
    }

    override fun toString(): String = parts.joinToString("/", "/") { it.value }
}

sealed class RoutingPathSegment {
    abstract val value: String

    data class Constant(override val value: String) : RoutingPathSegment()
    data class Parameter(override val value: String) : RoutingPathSegment()
    object WildCard : RoutingPathSegment() {
        override val value: String = "*"
    }
}

data class PathEvaluationResult(
    val succeeded: Boolean,
    val quality: Double,
    val parameters: Map<String, String>
) {
    companion object {
        const val QUALITY_CONSTANT = 1.0
        const val QUALITY_PARAMETER = 0.8
        const val QUALITY_WILDCARD = 0.5
        const val QUALITY_FAILED = 0.0
    }
}

Compiled from "RoutingPath.kt"
public final class com.yt8492.indikate.RoutingPath {
  public static final com.yt8492.indikate.RoutingPath$Companion Companion;

  private final java.util.List<com.yt8492.indikate.RoutingPathSegment> parts;

  private static final com.yt8492.indikate.RoutingPath ROOT;

  public com.yt8492.indikate.RoutingPath(java.util.List<? extends com.yt8492.indikate.RoutingPathSegment>);
    Code:
       0: aload_1
       1: ldc           #10                 // String parts
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #19                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #22                 // Field parts:Ljava/util/List;
      15: return

  public final java.util.List<com.yt8492.indikate.RoutingPathSegment> getParts();
    Code:
       0: aload_0
       1: getfield      #22                 // Field parts:Ljava/util/List;
       4: areturn

  public final com.yt8492.indikate.PathEvaluationResult evaluate(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #31                 // String path
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #33                 // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #35                 // class java/lang/String
      14: astore_3
      15: aload_3
      16: iconst_0
      17: ldc           #37                 // String /
      19: aastore
      20: aload_3
      21: iconst_0
      22: iconst_0
      23: bipush        6
      25: aconst_null
      26: invokestatic  #43                 // Method kotlin/text/StringsKt.splitToSequence$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Lkotlin/sequences/Sequence;
      29: invokedynamic #63,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      34: invokestatic  #69                 // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      37: invokestatic  #73                 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      40: astore_2
      41: aload_2
      42: invokeinterface #79,  1           // InterfaceMethod java/util/List.size:()I
      47: aload_0
      48: getfield      #22                 // Field parts:Ljava/util/List;
      51: invokeinterface #79,  1           // InterfaceMethod java/util/List.size:()I
      56: if_icmpeq     72
      59: new           #81                 // class com/yt8492/indikate/PathEvaluationResult
      62: dup
      63: iconst_0
      64: dconst_0
      65: invokestatic  #87                 // Method kotlin/collections/MapsKt.emptyMap:()Ljava/util/Map;
      68: invokespecial #90                 // Method com/yt8492/indikate/PathEvaluationResult."<init>":(ZDLjava/util/Map;)V
      71: areturn
      72: dconst_0
      73: dstore        14
      75: dconst_1
      76: dstore        14
      78: new           #92                 // class java/util/LinkedHashMap
      81: dup
      82: invokespecial #93                 // Method java/util/LinkedHashMap."<init>":()V
      85: checkcast     #95                 // class java/util/Map
      88: astore        4
      90: aload_2
      91: checkcast     #97                 // class java/lang/Iterable
      94: aload_0
      95: getfield      #22                 // Field parts:Ljava/util/List;
      98: checkcast     #97                 // class java/lang/Iterable
     101: invokestatic  #103                // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
     104: checkcast     #97                 // class java/lang/Iterable
     107: astore        5
     109: iconst_0
     110: istore        6
     112: aload         5
     114: invokeinterface #107,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     119: astore        7
     121: aload         7
     123: invokeinterface #113,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     128: ifeq          280
     131: aload         7
     133: invokeinterface #117,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     138: astore        8
     140: aload         8
     142: checkcast     #119                // class kotlin/Pair
     145: astore        9
     147: iconst_0
     148: istore        10
     150: aload         9
     152: invokevirtual #122                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     155: checkcast     #35                 // class java/lang/String
     158: astore        11
     160: aload         9
     162: invokevirtual #125                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     165: checkcast     #127                // class com/yt8492/indikate/RoutingPathSegment
     168: astore        12
     170: aload         12
     172: astore        13
     174: aload         13
     176: instanceof    #129                // class com/yt8492/indikate/RoutingPathSegment$Constant
     179: ifeq          211
     182: aload         12
     184: checkcast     #129                // class com/yt8492/indikate/RoutingPathSegment$Constant
     187: invokevirtual #133                // Method com/yt8492/indikate/RoutingPathSegment$Constant.getValue:()Ljava/lang/String;
     190: aload         11
     192: invokestatic  #137                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     195: ifne          275
     198: new           #81                 // class com/yt8492/indikate/PathEvaluationResult
     201: dup
     202: iconst_0
     203: dconst_0
     204: invokestatic  #87                 // Method kotlin/collections/MapsKt.emptyMap:()Ljava/util/Map;
     207: invokespecial #90                 // Method com/yt8492/indikate/PathEvaluationResult."<init>":(ZDLjava/util/Map;)V
     210: areturn
     211: aload         13
     213: instanceof    #139                // class com/yt8492/indikate/RoutingPathSegment$Parameter
     216: ifeq          248
     219: dload         14
     221: ldc2_w        #140                // double 0.8d
     224: dmul
     225: dstore        14
     227: aload         4
     229: aload         12
     231: checkcast     #139                // class com/yt8492/indikate/RoutingPathSegment$Parameter
     234: invokevirtual #142                // Method com/yt8492/indikate/RoutingPathSegment$Parameter.getValue:()Ljava/lang/String;
     237: aload         11
     239: invokeinterface #146,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     244: pop
     245: goto          275
     248: aload         13
     250: instanceof    #148                // class com/yt8492/indikate/RoutingPathSegment$WildCard
     253: ifeq          267
     256: dload         14
     258: ldc2_w        #149                // double 0.5d
     261: dmul
     262: dstore        14
     264: goto          275
     267: new           #152                // class kotlin/NoWhenBranchMatchedException
     270: dup
     271: invokespecial #153                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     274: athrow
     275: nop
     276: nop
     277: goto          121
     280: nop
     281: new           #81                 // class com/yt8492/indikate/PathEvaluationResult
     284: dup
     285: iconst_1
     286: dload         14
     288: aload         4
     290: invokespecial #90                 // Method com/yt8492/indikate/PathEvaluationResult."<init>":(ZDLjava/util/Map;)V
     293: areturn

  public java.lang.String toString();
    Code:
       0: aload_0
       1: getfield      #22                 // Field parts:Ljava/util/List;
       4: checkcast     #97                 // class java/lang/Iterable
       7: ldc           #37                 // String /
       9: checkcast     #33                 // class java/lang/CharSequence
      12: ldc           #37                 // String /
      14: checkcast     #33                 // class java/lang/CharSequence
      17: aconst_null
      18: iconst_0
      19: aconst_null
      20: invokedynamic #179,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
      25: bipush        28
      27: aconst_null
      28: invokestatic  #183                // 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;
      31: areturn

  private static final boolean evaluate$lambda$0(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #185                // String it
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #33                 // class java/lang/CharSequence
      10: invokestatic  #189                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      13: ifne          20
      16: iconst_1
      17: goto          21
      20: iconst_0
      21: ireturn

  private static final java.lang.CharSequence toString$lambda$2(com.yt8492.indikate.RoutingPathSegment);
    Code:
       0: aload_0
       1: ldc           #185                // String it
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokevirtual #190                // Method com/yt8492/indikate/RoutingPathSegment.getValue:()Ljava/lang/String;
      10: checkcast     #33                 // class java/lang/CharSequence
      13: areturn

  public static final com.yt8492.indikate.RoutingPath access$getROOT$cp();
    Code:
       0: getstatic     #195                // Field ROOT:Lcom/yt8492/indikate/RoutingPath;
       3: areturn

  static {};
    Code:
       0: new           #198                // class com/yt8492/indikate/RoutingPath$Companion
       3: dup
       4: aconst_null
       5: invokespecial #201                // Method com/yt8492/indikate/RoutingPath$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #205                // Field Companion:Lcom/yt8492/indikate/RoutingPath$Companion;
      11: new           #2                  // class com/yt8492/indikate/RoutingPath
      14: dup
      15: invokestatic  #208                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      18: invokespecial #210                // Method "<init>":(Ljava/util/List;)V
      21: putstatic     #195                // Field ROOT:Lcom/yt8492/indikate/RoutingPath;
      24: return
}

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

  public final com.yt8492.indikate.RoutingPath parse(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String path
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #23                 // String /
       9: invokestatic  #27                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      12: ifeq          19
      15: invokestatic  #33                 // Method com/yt8492/indikate/RoutingPath.access$getROOT$cp:()Lcom/yt8492/indikate/RoutingPath;
      18: areturn
      19: aload_1
      20: checkcast     #35                 // class java/lang/CharSequence
      23: iconst_1
      24: anewarray     #37                 // class java/lang/String
      27: astore_3
      28: aload_3
      29: iconst_0
      30: ldc           #23                 // String /
      32: aastore
      33: aload_3
      34: iconst_0
      35: iconst_0
      36: bipush        6
      38: aconst_null
      39: invokestatic  #43                 // Method kotlin/text/StringsKt.splitToSequence$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Lkotlin/sequences/Sequence;
      42: invokedynamic #63,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      47: invokestatic  #69                 // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      50: invokedynamic #76,  0             // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
      55: invokestatic  #79                 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      58: invokestatic  #83                 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      61: astore_2
      62: new           #29                 // class com/yt8492/indikate/RoutingPath
      65: dup
      66: aload_2
      67: invokespecial #86                 // Method com/yt8492/indikate/RoutingPath."<init>":(Ljava/util/List;)V
      70: areturn

  private static final boolean parse$lambda$0(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #91                 // String it
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #35                 // class java/lang/CharSequence
      10: invokestatic  #95                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      13: ifne          20
      16: iconst_1
      17: goto          21
      20: iconst_0
      21: ireturn

  private static final com.yt8492.indikate.RoutingPathSegment parse$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #91                 // String it
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: nop
       7: aload_0
       8: ldc           #97                 // String *
      10: invokestatic  #27                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      13: ifeq          25
      16: getstatic     #103                // Field com/yt8492/indikate/RoutingPathSegment$WildCard.INSTANCE:Lcom/yt8492/indikate/RoutingPathSegment$WildCard;
      19: checkcast     #105                // class com/yt8492/indikate/RoutingPathSegment
      22: goto          66
      25: aload_0
      26: ldc           #107                // String :
      28: iconst_0
      29: iconst_2
      30: aconst_null
      31: invokestatic  #111                // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
      34: ifeq          55
      37: new           #113                // class com/yt8492/indikate/RoutingPathSegment$Parameter
      40: dup
      41: aload_0
      42: iconst_1
      43: invokestatic  #117                // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;
      46: invokespecial #120                // Method com/yt8492/indikate/RoutingPathSegment$Parameter."<init>":(Ljava/lang/String;)V
      49: checkcast     #105                // class com/yt8492/indikate/RoutingPathSegment
      52: goto          66
      55: new           #122                // class com/yt8492/indikate/RoutingPathSegment$Constant
      58: dup
      59: aload_0
      60: invokespecial #123                // Method com/yt8492/indikate/RoutingPathSegment$Constant."<init>":(Ljava/lang/String;)V
      63: checkcast     #105                // class com/yt8492/indikate/RoutingPathSegment
      66: areturn

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


package academy.learnprogramming.challenges

fun main(args: Array<String>) {
    val mtb = KotlinMountainBike(33, 1000, 25, 7)
    mtb.printDescription()
    val bike = KotlinBicycle(1, 1)
    bike.printDescription()

    val bike2 = KotlinMountainBike("green",1, 2, 1)
    bike2.printDescription()
    println("===")
    println(KotlinMountainBike.availableColors)
    println("===")
    KotlinMountainBike.availableColors.forEach(::println)
}

open class KotlinBicycle(var cadence: Int, var speed: Int, var gear: Int = 1, val type: String = "") {

    fun applyBrake(decrement: Int) {
        speed -= decrement
    }

    fun speedUp(increment: Int) {
        speed += increment
    }

    open fun printDescription() = println("""
        The $type bike is in gear $gear
        with a cadence of $cadence
        travelling at the speed of $speed.
    """.trimIndent())
}

class KotlinMountainBike(var seatHeight: Int, cadence: Int, speed: Int, gear: Int = 1):
    KotlinBicycle(cadence, speed, gear, "mountain") {
        constructor(color: String, seatHeight: Int, cadence: Int, speed: Int, gear: Int = 1):
            this(seatHeight, cadence, speed, gear) {
            println("mtb color is $color")
        }

    override fun printDescription(){
            super.printDescription()
            println("The seat hight is $seatHeight mm.")
        }

    companion object {
        val availableColors: List<String> = listOf("blue", "red", "green", "black")
    }
}

class KotlinRoadBike(val tireWidth: Int, cadence: Int, speed: Int, gear: Int):
    KotlinBicycle(cadence, speed, gear, "road") {
        override fun printDescription(){
            super.printDescription()
            println("The tire width is $tireWidth mm.")
        }
    }

Compiled from "KotlinOOBicycles.kt"
public final class academy.learnprogramming.challenges.KotlinOOBicyclesKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #17                 // class academy/learnprogramming/challenges/KotlinMountainBike
       9: dup
      10: bipush        33
      12: sipush        1000
      15: bipush        25
      17: bipush        7
      19: invokespecial #21                 // Method academy/learnprogramming/challenges/KotlinMountainBike."<init>":(IIII)V
      22: astore_1
      23: aload_1
      24: invokevirtual #25                 // Method academy/learnprogramming/challenges/KotlinMountainBike.printDescription:()V
      27: new           #27                 // class academy/learnprogramming/challenges/KotlinBicycle
      30: dup
      31: iconst_1
      32: iconst_1
      33: iconst_0
      34: aconst_null
      35: bipush        12
      37: aconst_null
      38: invokespecial #30                 // Method academy/learnprogramming/challenges/KotlinBicycle."<init>":(IIILjava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
      41: astore_2
      42: aload_2
      43: invokevirtual #31                 // Method academy/learnprogramming/challenges/KotlinBicycle.printDescription:()V
      46: new           #17                 // class academy/learnprogramming/challenges/KotlinMountainBike
      49: dup
      50: ldc           #33                 // String green
      52: iconst_1
      53: iconst_2
      54: iconst_1
      55: iconst_0
      56: bipush        16
      58: aconst_null
      59: invokespecial #36                 // Method academy/learnprogramming/challenges/KotlinMountainBike."<init>":(Ljava/lang/String;IIIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
      62: astore_3
      63: aload_3
      64: invokevirtual #25                 // Method academy/learnprogramming/challenges/KotlinMountainBike.printDescription:()V
      67: ldc           #38                 // String ===
      69: getstatic     #44                 // Field java/lang/System.out:Ljava/io/PrintStream;
      72: swap
      73: invokevirtual #50                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      76: getstatic     #54                 // Field academy/learnprogramming/challenges/KotlinMountainBike.Companion:Lacademy/learnprogramming/challenges/KotlinMountainBike$Companion;
      79: invokevirtual #60                 // Method academy/learnprogramming/challenges/KotlinMountainBike$Companion.getAvailableColors:()Ljava/util/List;
      82: getstatic     #44                 // Field java/lang/System.out:Ljava/io/PrintStream;
      85: swap
      86: invokevirtual #50                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      89: ldc           #38                 // String ===
      91: getstatic     #44                 // Field java/lang/System.out:Ljava/io/PrintStream;
      94: swap
      95: invokevirtual #50                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      98: getstatic     #54                 // Field academy/learnprogramming/challenges/KotlinMountainBike.Companion:Lacademy/learnprogramming/challenges/KotlinMountainBike$Companion;
     101: invokevirtual #60                 // Method academy/learnprogramming/challenges/KotlinMountainBike$Companion.getAvailableColors:()Ljava/util/List;
     104: checkcast     #62                 // class java/lang/Iterable
     107: astore        4
     109: iconst_0
     110: istore        5
     112: aload         4
     114: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     119: astore        6
     121: aload         6
     123: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     128: ifeq          160
     131: aload         6
     133: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     138: astore        7
     140: aload         7
     142: astore        8
     144: iconst_0
     145: istore        9
     147: getstatic     #44                 // Field java/lang/System.out:Ljava/io/PrintStream;
     150: aload         8
     152: invokevirtual #50                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     155: nop
     156: nop
     157: goto          121
     160: nop
     161: return
}


package day07

import java.io.File

fun main() {
    val data = parse("src/main/kotlin/day07/Day07-Sample.txt")

    val answer1 = part1(data)
    val answer2 = part2(data)

    println("🎄 Day 07 🎄")

    println()

    println("[Part 1]")
    println("Answer: $answer1")

    println()

    println("[Part 2]")
    println("Answer: $answer2")
}

@Suppress("SameParameterValue")
private fun parse(path: String): List<Long> {
    var node = "/"
    val dirs = mutableMapOf(node to 0L)

    File(path).forEachLine { line ->
        val tokens = line.split(" ")
        if (tokens[0] == "$" && tokens[1] == "cd") {
            val name = tokens[2]
            node = when (name) {
                "/" -> "/"
                ".." -> node.substringBeforeLast('/')
                else -> "$node/$name"
            }
        } else {
            tokens[0].toLongOrNull()?.let { size ->
                var current = node
                while (current.isNotBlank()) {
                    dirs.merge(current, size, Long::plus)
                    current = current.substringBeforeLast('/')
                }
            }
        }
    }

    return dirs.map { it.value }
}

private fun part1(data: List<Long>): Long {
    return data.filter { it <= 100000L }.sum()
}

private fun part2(data: List<Long>): Long {
    val required = 30_000_000 - (70_000_000 - data.first())
    return data.sorted().first { it >= required }
}

Compiled from "Day07.kt"
public final class day07.Day07Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String src/main/kotlin/day07/Day07-Sample.txt
       2: invokestatic  #12                 // Method parse:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #16                 // Method part1:(Ljava/util/List;)J
      10: lstore_1
      11: aload_0
      12: invokestatic  #19                 // Method part2:(Ljava/util/List;)J
      15: lstore_3
      16: ldc           #21                 // String 🎄 Day 07 🎄
      18: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
      21: swap
      22: invokevirtual #33                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      25: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
      28: invokevirtual #35                 // Method java/io/PrintStream.println:()V
      31: ldc           #37                 // String [Part 1]
      33: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
      36: swap
      37: invokevirtual #33                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      40: new           #39                 // class java/lang/StringBuilder
      43: dup
      44: invokespecial #42                 // Method java/lang/StringBuilder."<init>":()V
      47: ldc           #44                 // String Answer:
      49: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      52: lload_1
      53: invokevirtual #51                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      56: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      59: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
      62: swap
      63: invokevirtual #33                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      66: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
      69: invokevirtual #35                 // Method java/io/PrintStream.println:()V
      72: ldc           #57                 // String [Part 2]
      74: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
      77: swap
      78: invokevirtual #33                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      81: new           #39                 // class java/lang/StringBuilder
      84: dup
      85: invokespecial #42                 // Method java/lang/StringBuilder."<init>":()V
      88: ldc           #44                 // String Answer:
      90: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      93: lload_3
      94: invokevirtual #51                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      97: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     100: getstatic     #27                 // Field java/lang/System.out:Ljava/io/PrintStream;
     103: swap
     104: invokevirtual #33                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     107: return

  private static final java.util.List<java.lang.Long> parse(java.lang.String);
    Code:
       0: new           #65                 // class kotlin/jvm/internal/Ref$ObjectRef
       3: dup
       4: invokespecial #66                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
       7: astore_1
       8: aload_1
       9: ldc           #68                 // String /
      11: putfield      #72                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      14: iconst_1
      15: anewarray     #74                 // class kotlin/Pair
      18: astore_3
      19: aload_3
      20: iconst_0
      21: aload_1
      22: getfield      #72                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      25: lconst_0
      26: invokestatic  #80                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      29: invokestatic  #86                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      32: aastore
      33: aload_3
      34: invokestatic  #92                 // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
      37: astore_2
      38: new           #94                 // class java/io/File
      41: dup
      42: aload_0
      43: invokespecial #97                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      46: aconst_null
      47: aload_1
      48: aload_2
      49: invokedynamic #117,  0            // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;Ljava/util/Map;)Lkotlin/jvm/functions/Function1;
      54: iconst_1
      55: aconst_null
      56: invokestatic  #123                // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
      59: aload_2
      60: astore_3
      61: iconst_0
      62: istore        4
      64: aload_3
      65: astore        5
      67: new           #125                // class java/util/ArrayList
      70: dup
      71: aload_3
      72: invokeinterface #131,  1          // InterfaceMethod java/util/Map.size:()I
      77: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
      80: checkcast     #136                // class java/util/Collection
      83: astore        6
      85: iconst_0
      86: istore        7
      88: aload         5
      90: invokeinterface #140,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      95: invokeinterface #146,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     100: astore        8
     102: aload         8
     104: invokeinterface #152,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          163
     112: aload         8
     114: invokeinterface #156,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: checkcast     #158                // class java/util/Map$Entry
     122: astore        9
     124: aload         6
     126: aload         9
     128: astore        10
     130: astore        12
     132: iconst_0
     133: istore        11
     135: aload         10
     137: invokeinterface #161,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     142: checkcast     #163                // class java/lang/Number
     145: invokevirtual #167                // Method java/lang/Number.longValue:()J
     148: invokestatic  #80                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     151: aload         12
     153: swap
     154: invokeinterface #171,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     159: pop
     160: goto          102
     163: aload         6
     165: checkcast     #173                // class java/util/List
     168: nop
     169: areturn

  private static final long part1(java.util.List<java.lang.Long>);
    Code:
       0: aload_0
       1: checkcast     #195                // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #125                // class java/util/ArrayList
      12: dup
      13: invokespecial #196                // Method java/util/ArrayList."<init>":()V
      16: checkcast     #136                // class java/util/Collection
      19: astore        4
      21: iconst_0
      22: istore        5
      24: aload_3
      25: invokeinterface #197,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      30: astore        6
      32: aload         6
      34: invokeinterface #152,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      39: ifeq          94
      42: aload         6
      44: invokeinterface #156,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      49: astore        7
      51: aload         7
      53: checkcast     #163                // class java/lang/Number
      56: invokevirtual #167                // Method java/lang/Number.longValue:()J
      59: lstore        8
      61: iconst_0
      62: istore        10
      64: lload         8
      66: ldc2_w        #198                // long 100000l
      69: lcmp
      70: ifgt          77
      73: iconst_1
      74: goto          78
      77: iconst_0
      78: ifeq          32
      81: aload         4
      83: aload         7
      85: invokeinterface #171,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      90: pop
      91: goto          32
      94: aload         4
      96: checkcast     #173                // class java/util/List
      99: nop
     100: checkcast     #195                // class java/lang/Iterable
     103: invokestatic  #205                // Method kotlin/collections/CollectionsKt.sumOfLong:(Ljava/lang/Iterable;)J
     106: lreturn

  private static final long part2(java.util.List<java.lang.Long>);
    Code:
       0: ldc           #213                // int 30000000
       2: i2l
       3: ldc           #214                // int 70000000
       5: i2l
       6: aload_0
       7: invokestatic  #218                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      10: checkcast     #163                // class java/lang/Number
      13: invokevirtual #167                // Method java/lang/Number.longValue:()J
      16: lsub
      17: lsub
      18: lstore_1
      19: aload_0
      20: checkcast     #195                // class java/lang/Iterable
      23: invokestatic  #222                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      26: checkcast     #195                // class java/lang/Iterable
      29: astore_3
      30: iconst_0
      31: istore        4
      33: aload_3
      34: invokeinterface #197,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      39: astore        5
      41: aload         5
      43: invokeinterface #152,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      48: ifeq          93
      51: aload         5
      53: invokeinterface #156,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      58: astore        6
      60: aload         6
      62: checkcast     #163                // class java/lang/Number
      65: invokevirtual #167                // Method java/lang/Number.longValue:()J
      68: lstore        7
      70: iconst_0
      71: istore        9
      73: lload         7
      75: lload_1
      76: lcmp
      77: iflt          84
      80: iconst_1
      81: goto          85
      84: iconst_0
      85: ifeq          41
      88: aload         6
      90: goto          103
      93: new           #224                // class java/util/NoSuchElementException
      96: dup
      97: ldc           #226                // String Collection contains no element matching the predicate.
      99: invokespecial #227                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     102: athrow
     103: checkcast     #163                // class java/lang/Number
     106: invokevirtual #167                // Method java/lang/Number.longValue:()J
     109: lreturn

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

  private static final java.lang.Long parse$lambda$2$lambda$1$lambda$0(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #244,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #76                 // class java/lang/Long
      11: areturn

  private static final kotlin.Unit parse$lambda$2(kotlin.jvm.internal.Ref$ObjectRef, java.util.Map, java.lang.String);
    Code:
       0: aload_2
       1: ldc           #250                // String line
       3: invokestatic  #256                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: checkcast     #258                // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #192                // class java/lang/String
      14: astore        4
      16: aload         4
      18: iconst_0
      19: ldc_w         #260                // String
      22: aastore
      23: aload         4
      25: iconst_0
      26: iconst_0
      27: bipush        6
      29: aconst_null
      30: invokestatic  #266                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      33: astore_3
      34: aload_3
      35: iconst_0
      36: invokeinterface #270,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      41: ldc_w         #272                // String $
      44: invokestatic  #276                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      47: ifeq          163
      50: aload_3
      51: iconst_1
      52: invokeinterface #270,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      57: ldc_w         #278                // String cd
      60: invokestatic  #276                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      63: ifeq          163
      66: aload_3
      67: iconst_2
      68: invokeinterface #270,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      73: checkcast     #192                // class java/lang/String
      76: astore        4
      78: aload_0
      79: aload         4
      81: astore        5
      83: aload         5
      85: ldc           #68                 // String /
      87: invokestatic  #276                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      90: ifeq          98
      93: ldc           #68                 // String /
      95: goto          157
      98: aload         5
     100: ldc_w         #280                // String ..
     103: invokestatic  #276                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     106: ifeq          127
     109: aload_0
     110: getfield      #72                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     113: checkcast     #192                // class java/lang/String
     116: bipush        47
     118: aconst_null
     119: iconst_2
     120: aconst_null
     121: invokestatic  #284                // Method kotlin/text/StringsKt.substringBeforeLast$default:(Ljava/lang/String;CLjava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     124: goto          157
     127: new           #39                 // class java/lang/StringBuilder
     130: dup
     131: invokespecial #42                 // Method java/lang/StringBuilder."<init>":()V
     134: aload_0
     135: getfield      #72                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     138: checkcast     #192                // class java/lang/String
     141: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     144: bipush        47
     146: invokevirtual #287                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     149: aload         4
     151: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     154: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     157: putfield      #72                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     160: goto          265
     163: aload_3
     164: iconst_0
     165: invokeinterface #270,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     170: checkcast     #192                // class java/lang/String
     173: invokestatic  #291                // Method kotlin/text/StringsKt.toLongOrNull:(Ljava/lang/String;)Ljava/lang/Long;
     176: dup
     177: ifnull        263
     180: checkcast     #163                // class java/lang/Number
     183: invokevirtual #167                // Method java/lang/Number.longValue:()J
     186: lstore        6
     188: iconst_0
     189: istore        8
     191: aload_0
     192: getfield      #72                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     195: checkcast     #192                // class java/lang/String
     198: astore        9
     200: aload         9
     202: checkcast     #258                // class java/lang/CharSequence
     205: invokestatic  #295                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     208: ifne          215
     211: iconst_1
     212: goto          216
     215: iconst_0
     216: ifeq          259
     219: aload_1
     220: aload         9
     222: lload         6
     224: invokestatic  #80                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     227: getstatic     #301                // Field day07/Day07Kt$parse$1$1$1.INSTANCE:Lday07/Day07Kt$parse$1$1$1;
     230: checkcast     #241                // class kotlin/jvm/functions/Function2
     233: invokedynamic #311,  0            // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiFunction;
     238: invokeinterface #315,  4          // InterfaceMethod java/util/Map.merge:(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
     243: pop
     244: aload         9
     246: bipush        47
     248: aconst_null
     249: iconst_2
     250: aconst_null
     251: invokestatic  #284                // Method kotlin/text/StringsKt.substringBeforeLast$default:(Ljava/lang/String;CLjava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     254: astore        9
     256: goto          200
     259: nop
     260: goto          265
     263: pop
     264: nop
     265: getstatic     #320                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     268: areturn
}

Compiled from "Day07.kt"
final class day07.Day07Kt$parse$1$1$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.Long, java.lang.Long, java.lang.Long> {
  public static final day07.Day07Kt$parse$1$1$1 INSTANCE;

  day07.Day07Kt$parse$1$1$1();
    Code:
       0: aload_0
       1: iconst_2
       2: getstatic     #15                 // Field java/lang/Long.TYPE:Ljava/lang/Class;
       5: ldc           #17                 // String plus
       7: ldc           #19                 // String plus(J)J
       9: iconst_0
      10: invokespecial #22                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      13: return

  public final java.lang.Long invoke(long, long);
    Code:
       0: lload_1
       1: lload_3
       2: ladd
       3: invokestatic  #30                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
       6: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #36                 // class java/lang/Number
       5: invokevirtual #40                 // Method java/lang/Number.longValue:()J
       8: aload_2
       9: checkcast     #36                 // class java/lang/Number
      12: invokevirtual #40                 // Method java/lang/Number.longValue:()J
      15: invokevirtual #42                 // Method invoke:(JJ)Ljava/lang/Long;
      18: areturn

  static {};
    Code:
       0: new           #2                  // class day07/Day07Kt$parse$1$1$1
       3: dup
       4: invokespecial #47                 // Method "<init>":()V
       7: putstatic     #50                 // Field INSTANCE:Lday07/Day07Kt$parse$1$1$1;
      10: return
}