import kotlin.String
import kotlin.collections.List
import kotlin.math.pow

object Day4 {
    data class CardData(val cardIndex: Int, val winningNumberCount: Int) {
        companion object {
            fun parseCardData(input: String): CardData {
                val (cardInformation, numberInformation) = input.split(":")
                val cardIndex = cardInformation.trimStart(*"Card ".toCharArray()).toInt()
                val (winningNumberInformation, cardNumberInformation) = numberInformation.split("|")
                val winningNumbers = parseNumbers(winningNumberInformation)
                val cardNumbers = parseNumbers(cardNumberInformation)
                val winningNumberCount = cardNumbers.filter { winningNumbers.contains(it) }.count()
                return CardData(cardIndex, winningNumberCount)
            }

            private fun parseNumbers(numbers: String): List<Int> {
                return numbers.trimStart(*" ".toCharArray())
                    .trimEnd(*" ".toCharArray())
                    .split(" ")
                    .filter(String::isNotEmpty)
                    .map { it.toInt() }
            }
        }

        fun score(): Int {
            val exp = winningNumberCount - 1
            return 2.0.pow(exp.toDouble()).toInt()
        }

        fun cardIndexesToCopy(): IntRange {
            return (cardIndex + 1..cardIndex + winningNumberCount)
        }
    }

    fun part1(input: List<String>): String = input.map(CardData::parseCardData).map(CardData::score).sum().toString()

    fun part2(input: List<String>): String = findTotalCards(input.map(CardData::parseCardData)).toString()

    private fun findTotalCards(cards: List<CardData>): Int {
        val cardMultiplierCount = mutableMapOf<Int, Int>()
        return cards.map {
            val multiplier = (cardMultiplierCount[it.cardIndex] ?: 0) + 1
            it.cardIndexesToCopy().forEach {
                cardMultiplierCount.merge(it, multiplier) { a, b -> a + b }
            }
            multiplier
        }.sum()
    }
}

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

  public final Day4$CardData parseCardData(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_1
       7: checkcast     #23                 // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #25                 // class java/lang/String
      14: astore_3
      15: aload_3
      16: iconst_0
      17: ldc           #27                 // String :
      19: aastore
      20: aload_3
      21: iconst_0
      22: iconst_0
      23: bipush        6
      25: aconst_null
      26: invokestatic  #33                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      29: astore_2
      30: aload_2
      31: iconst_0
      32: invokeinterface #39,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      37: checkcast     #25                 // class java/lang/String
      40: astore_3
      41: aload_2
      42: iconst_1
      43: invokeinterface #39,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      48: checkcast     #25                 // class java/lang/String
      51: astore        4
      53: aload_3
      54: ldc           #41                 // String Card
      56: invokevirtual #45                 // Method java/lang/String.toCharArray:()[C
      59: dup
      60: ldc           #47                 // String toCharArray(...)
      62: invokestatic  #50                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      65: astore        6
      67: aload         6
      69: aload         6
      71: arraylength
      72: invokestatic  #56                 // Method java/util/Arrays.copyOf:([CI)[C
      75: invokestatic  #60                 // Method kotlin/text/StringsKt.trimStart:(Ljava/lang/String;[C)Ljava/lang/String;
      78: invokestatic  #66                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      81: istore        5
      83: aload         4
      85: checkcast     #23                 // class java/lang/CharSequence
      88: iconst_1
      89: anewarray     #25                 // class java/lang/String
      92: astore        7
      94: aload         7
      96: iconst_0
      97: ldc           #68                 // String |
      99: aastore
     100: aload         7
     102: iconst_0
     103: iconst_0
     104: bipush        6
     106: aconst_null
     107: invokestatic  #33                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     110: astore        6
     112: aload         6
     114: iconst_0
     115: invokeinterface #39,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     120: checkcast     #25                 // class java/lang/String
     123: astore        7
     125: aload         6
     127: iconst_1
     128: invokeinterface #39,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     133: checkcast     #25                 // class java/lang/String
     136: astore        8
     138: aload_0
     139: aload         7
     141: invokespecial #72                 // Method parseNumbers:(Ljava/lang/String;)Ljava/util/List;
     144: astore        9
     146: aload_0
     147: aload         8
     149: invokespecial #72                 // Method parseNumbers:(Ljava/lang/String;)Ljava/util/List;
     152: astore        10
     154: aload         10
     156: checkcast     #74                 // class java/lang/Iterable
     159: astore        12
     161: iconst_0
     162: istore        13
     164: aload         12
     166: astore        14
     168: new           #76                 // class java/util/ArrayList
     171: dup
     172: invokespecial #77                 // Method java/util/ArrayList."<init>":()V
     175: checkcast     #79                 // class java/util/Collection
     178: astore        15
     180: iconst_0
     181: istore        16
     183: aload         14
     185: invokeinterface #83,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     190: astore        17
     192: aload         17
     194: invokeinterface #89,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     199: ifeq          252
     202: aload         17
     204: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     209: astore        18
     211: aload         18
     213: checkcast     #95                 // class java/lang/Number
     216: invokevirtual #99                 // Method java/lang/Number.intValue:()I
     219: istore        19
     221: iconst_0
     222: istore        20
     224: aload         9
     226: iload         19
     228: invokestatic  #103                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     231: invokeinterface #107,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     236: ifeq          192
     239: aload         15
     241: aload         18
     243: invokeinterface #110,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     248: pop
     249: goto          192
     252: aload         15
     254: checkcast     #35                 // class java/util/List
     257: nop
     258: checkcast     #79                 // class java/util/Collection
     261: invokeinterface #113,  1          // InterfaceMethod java/util/Collection.size:()I
     266: istore        11
     268: new           #115                // class Day4$CardData
     271: dup
     272: iload         5
     274: iload         11
     276: invokespecial #118                // Method Day4$CardData."<init>":(II)V
     279: areturn

  private final java.util.List<java.lang.Integer> parseNumbers(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #143                // String
       3: invokevirtual #45                 // Method java/lang/String.toCharArray:()[C
       6: dup
       7: ldc           #47                 // String toCharArray(...)
       9: invokestatic  #50                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      12: astore_2
      13: aload_2
      14: aload_2
      15: arraylength
      16: invokestatic  #56                 // Method java/util/Arrays.copyOf:([CI)[C
      19: invokestatic  #60                 // Method kotlin/text/StringsKt.trimStart:(Ljava/lang/String;[C)Ljava/lang/String;
      22: ldc           #143                // String
      24: invokevirtual #45                 // Method java/lang/String.toCharArray:()[C
      27: dup
      28: ldc           #47                 // String toCharArray(...)
      30: invokestatic  #50                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      33: astore_2
      34: aload_2
      35: aload_2
      36: arraylength
      37: invokestatic  #56                 // Method java/util/Arrays.copyOf:([CI)[C
      40: invokestatic  #146                // Method kotlin/text/StringsKt.trimEnd:(Ljava/lang/String;[C)Ljava/lang/String;
      43: checkcast     #23                 // class java/lang/CharSequence
      46: iconst_1
      47: anewarray     #25                 // class java/lang/String
      50: astore_2
      51: aload_2
      52: iconst_0
      53: ldc           #143                // String
      55: aastore
      56: aload_2
      57: iconst_0
      58: iconst_0
      59: bipush        6
      61: aconst_null
      62: invokestatic  #33                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      65: checkcast     #74                 // class java/lang/Iterable
      68: astore_2
      69: nop
      70: iconst_0
      71: istore_3
      72: aload_2
      73: astore        4
      75: new           #76                 // class java/util/ArrayList
      78: dup
      79: invokespecial #77                 // Method java/util/ArrayList."<init>":()V
      82: checkcast     #79                 // class java/util/Collection
      85: astore        5
      87: iconst_0
      88: istore        6
      90: aload         4
      92: invokeinterface #83,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      97: astore        7
      99: aload         7
     101: invokeinterface #89,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     106: ifeq          163
     109: aload         7
     111: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     116: astore        8
     118: aload         8
     120: checkcast     #25                 // class java/lang/String
     123: astore        9
     125: iconst_0
     126: istore        10
     128: aload         9
     130: checkcast     #23                 // class java/lang/CharSequence
     133: invokeinterface #149,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     138: ifle          145
     141: iconst_1
     142: goto          146
     145: iconst_0
     146: nop
     147: ifeq          99
     150: aload         5
     152: aload         8
     154: invokeinterface #110,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     159: pop
     160: goto          99
     163: aload         5
     165: checkcast     #35                 // class java/util/List
     168: nop
     169: checkcast     #74                 // class java/lang/Iterable
     172: astore_2
     173: nop
     174: iconst_0
     175: istore_3
     176: aload_2
     177: astore        4
     179: new           #76                 // class java/util/ArrayList
     182: dup
     183: aload_2
     184: bipush        10
     186: invokestatic  #155                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     189: invokespecial #158                // Method java/util/ArrayList."<init>":(I)V
     192: checkcast     #79                 // class java/util/Collection
     195: astore        5
     197: iconst_0
     198: istore        6
     200: aload         4
     202: invokeinterface #83,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     207: astore        7
     209: aload         7
     211: invokeinterface #89,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     216: ifeq          263
     219: aload         7
     221: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     226: astore        8
     228: aload         5
     230: aload         8
     232: checkcast     #25                 // class java/lang/String
     235: astore        9
     237: astore        11
     239: iconst_0
     240: istore        10
     242: aload         9
     244: invokestatic  #66                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     247: nop
     248: invokestatic  #103                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     251: aload         11
     253: swap
     254: invokeinterface #110,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     259: pop
     260: goto          209
     263: aload         5
     265: checkcast     #35                 // class java/util/List
     268: nop
     269: areturn

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

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

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

  public final java.lang.String 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_1
       7: checkcast     #24                 // class java/lang/Iterable
      10: astore_2
      11: getstatic     #30                 // Field Day4$CardData.Companion:LDay4$CardData$Companion;
      14: astore_3
      15: iconst_0
      16: istore        4
      18: aload_2
      19: astore        5
      21: new           #32                 // class java/util/ArrayList
      24: dup
      25: aload_2
      26: bipush        10
      28: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      31: invokespecial #41                 // Method java/util/ArrayList."<init>":(I)V
      34: checkcast     #43                 // class java/util/Collection
      37: astore        6
      39: iconst_0
      40: istore        7
      42: aload         5
      44: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      49: astore        8
      51: aload         8
      53: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      58: ifeq          102
      61: aload         8
      63: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      68: astore        9
      70: aload         6
      72: aload         9
      74: checkcast     #59                 // class java/lang/String
      77: astore        10
      79: astore        12
      81: iconst_0
      82: istore        11
      84: aload_3
      85: aload         10
      87: invokevirtual #65                 // Method Day4$CardData$Companion.parseCardData:(Ljava/lang/String;)LDay4$CardData;
      90: aload         12
      92: swap
      93: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      98: pop
      99: goto          51
     102: aload         6
     104: checkcast     #71                 // class java/util/List
     107: nop
     108: checkcast     #24                 // class java/lang/Iterable
     111: astore_2
     112: nop
     113: iconst_0
     114: istore_3
     115: aload_2
     116: astore        4
     118: new           #32                 // class java/util/ArrayList
     121: dup
     122: aload_2
     123: bipush        10
     125: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     128: invokespecial #41                 // Method java/util/ArrayList."<init>":(I)V
     131: checkcast     #43                 // class java/util/Collection
     134: astore        5
     136: iconst_0
     137: istore        6
     139: aload         4
     141: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     146: astore        7
     148: aload         7
     150: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     155: ifeq          201
     158: aload         7
     160: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     165: astore        8
     167: aload         5
     169: aload         8
     171: checkcast     #26                 // class Day4$CardData
     174: astore        9
     176: astore        12
     178: iconst_0
     179: istore        10
     181: aload         9
     183: invokevirtual #75                 // Method Day4$CardData.score:()I
     186: invokestatic  #81                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     189: aload         12
     191: swap
     192: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     197: pop
     198: goto          148
     201: aload         5
     203: checkcast     #71                 // class java/util/List
     206: nop
     207: checkcast     #24                 // class java/lang/Iterable
     210: invokestatic  #85                 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     213: invokestatic  #88                 // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     216: areturn

  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: aload_0
       7: aload_1
       8: checkcast     #24                 // class java/lang/Iterable
      11: astore_2
      12: getstatic     #30                 // Field Day4$CardData.Companion:LDay4$CardData$Companion;
      15: astore_3
      16: astore        12
      18: iconst_0
      19: istore        4
      21: aload_2
      22: astore        5
      24: new           #32                 // class java/util/ArrayList
      27: dup
      28: aload_2
      29: bipush        10
      31: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      34: invokespecial #41                 // Method java/util/ArrayList."<init>":(I)V
      37: checkcast     #43                 // class java/util/Collection
      40: astore        6
      42: iconst_0
      43: istore        7
      45: aload         5
      47: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      52: astore        8
      54: aload         8
      56: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      61: ifeq          105
      64: aload         8
      66: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      71: astore        9
      73: aload         6
      75: aload         9
      77: checkcast     #59                 // class java/lang/String
      80: astore        10
      82: astore        13
      84: iconst_0
      85: istore        11
      87: aload_3
      88: aload         10
      90: invokevirtual #65                 // Method Day4$CardData$Companion.parseCardData:(Ljava/lang/String;)LDay4$CardData;
      93: aload         13
      95: swap
      96: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     101: pop
     102: goto          54
     105: aload         6
     107: checkcast     #71                 // class java/util/List
     110: nop
     111: aload         12
     113: swap
     114: invokespecial #109                // Method findTotalCards:(Ljava/util/List;)I
     117: invokestatic  #88                 // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     120: areturn

  private final int findTotalCards(java.util.List<Day4$CardData>);
    Code:
       0: new           #113                // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #114                // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #116                // class java/util/Map
      10: astore_2
      11: aload_1
      12: checkcast     #24                 // class java/lang/Iterable
      15: astore_3
      16: iconst_0
      17: istore        4
      19: aload_3
      20: astore        5
      22: new           #32                 // class java/util/ArrayList
      25: dup
      26: aload_3
      27: bipush        10
      29: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      32: invokespecial #41                 // Method java/util/ArrayList."<init>":(I)V
      35: checkcast     #43                 // class java/util/Collection
      38: astore        6
      40: iconst_0
      41: istore        7
      43: aload         5
      45: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        8
      52: aload         8
      54: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          217
      62: aload         8
      64: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        9
      71: aload         6
      73: aload         9
      75: checkcast     #26                 // class Day4$CardData
      78: astore        10
      80: astore        19
      82: iconst_0
      83: istore        11
      85: aload_2
      86: aload         10
      88: invokevirtual #119                // Method Day4$CardData.getCardIndex:()I
      91: invokestatic  #81                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      94: invokeinterface #123,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      99: checkcast     #77                 // class java/lang/Integer
     102: dup
     103: ifnull        112
     106: invokevirtual #126                // Method java/lang/Integer.intValue:()I
     109: goto          114
     112: pop
     113: iconst_0
     114: iconst_1
     115: iadd
     116: istore        12
     118: aload         10
     120: invokevirtual #130                // Method Day4$CardData.cardIndexesToCopy:()Lkotlin/ranges/IntRange;
     123: checkcast     #24                 // class java/lang/Iterable
     126: astore        13
     128: iconst_0
     129: istore        14
     131: aload         13
     133: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     138: astore        15
     140: aload         15
     142: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     147: ifeq          199
     150: aload         15
     152: checkcast     #132                // class kotlin/collections/IntIterator
     155: invokevirtual #135                // Method kotlin/collections/IntIterator.nextInt:()I
     158: istore        16
     160: iload         16
     162: istore        17
     164: iconst_0
     165: istore        18
     167: aload_2
     168: iload         17
     170: invokestatic  #81                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     173: iload         12
     175: invokestatic  #81                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     178: invokedynamic #154,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;
     183: invokedynamic #165,  0            // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiFunction;
     188: invokeinterface #169,  4          // InterfaceMethod java/util/Map.merge:(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
     193: pop
     194: nop
     195: nop
     196: goto          140
     199: nop
     200: iload         12
     202: invokestatic  #81                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     205: aload         19
     207: swap
     208: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     213: pop
     214: goto          52
     217: aload         6
     219: checkcast     #71                 // class java/util/List
     222: nop
     223: checkcast     #24                 // class java/lang/Iterable
     226: invokestatic  #85                 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     229: ireturn

  private static final java.lang.Integer findTotalCards$lambda$5$lambda$4$lambda$2(java.lang.Integer, java.lang.Integer);
    Code:
       0: aload_0
       1: ldc           #181                // String a
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #183                // String b
       9: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokevirtual #126                // Method java/lang/Integer.intValue:()I
      16: aload_1
      17: invokevirtual #126                // Method java/lang/Integer.intValue:()I
      20: iadd
      21: invokestatic  #81                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      24: areturn

  private static final java.lang.Integer findTotalCards$lambda$5$lambda$4$lambda$3(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #188,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #77                 // class java/lang/Integer
      11: areturn

  static {};
    Code:
       0: new           #2                  // class Day4
       3: dup
       4: invokespecial #193                // Method "<init>":()V
       7: putstatic     #196                // Field INSTANCE:LDay4;
      10: return
}

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

  private final int cardIndex;

  private final int winningNumberCount;

  public Day4$CardData(int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field cardIndex:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field winningNumberCount:I
      14: return

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

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

  public final int score();
    Code:
       0: aload_0
       1: getfield      #16                 // Field winningNumberCount:I
       4: iconst_1
       5: isub
       6: istore_1
       7: ldc2_w        #23                 // double 2.0d
      10: iload_1
      11: i2d
      12: invokestatic  #30                 // Method java/lang/Math.pow:(DD)D
      15: d2i
      16: ireturn

  public final kotlin.ranges.IntRange cardIndexesToCopy();
    Code:
       0: new           #36                 // class kotlin/ranges/IntRange
       3: dup
       4: aload_0
       5: getfield      #13                 // Field cardIndex:I
       8: iconst_1
       9: iadd
      10: aload_0
      11: getfield      #13                 // Field cardIndex:I
      14: aload_0
      15: getfield      #16                 // Field winningNumberCount:I
      18: iadd
      19: invokespecial #38                 // Method kotlin/ranges/IntRange."<init>":(II)V
      22: areturn

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

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

  public final Day4$CardData copy(int, int);
    Code:
       0: new           #2                  // class Day4$CardData
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #43                 // Method "<init>":(II)V
       9: areturn

  public static Day4$CardData copy$default(Day4$CardData, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field cardIndex:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field winningNumberCount:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #47                 // Method copy:(II)LDay4$CardData;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #51                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #52                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #54                 // String CardData(cardIndex=
       9: invokevirtual #58                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field cardIndex:I
      16: invokevirtual #61                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #63                 // String , winningNumberCount=
      21: invokevirtual #58                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field winningNumberCount:I
      28: invokevirtual #61                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #66                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #68                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

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

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

  static {};
    Code:
       0: new           #83                 // class Day4$CardData$Companion
       3: dup
       4: aconst_null
       5: invokespecial #86                 // Method Day4$CardData$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #90                 // Field Companion:LDay4$CardData$Companion;
      11: return
}


import Day13.transpose
import kotlin.String
import kotlin.collections.List

object Day14 {
    private const val ROUNDED = 'O'
    fun part1(input: List<String>): String {
        val transposedDish = transpose(input)
        return transposedDish.sumOf { row ->
            val rolled = roll(row)
            rolled.reversed().withIndex().filter { (_, char) -> char == ROUNDED }.sumOf { (idx, _) -> idx + 1 }
        }.toString()
    }

    private fun roll(row: String): String {
        if (row.isBlank()) {
            return row
        }
        if (row[0] == ROUNDED) {
            return row[0] + roll(row.substring(1))
        }
        val indexToSwap = row.withIndex().dropWhile { (_, char) -> char == '.' }.firstOrNull()
        if (indexToSwap == null) {
            return row
        }
        val (idx, _) = indexToSwap
        return if (row[idx] == ROUNDED) {
            ROUNDED.toString() + roll(row.substring(1, idx) + "." + row.substring(idx + 1))
        } else {
            row.substring(0, idx + 1) + roll(row.substring(idx + 1))
        }
    }

    fun part2(input: List<String>): String {
        val cycled = cycleUntil(transpose(input), 1_000_000_000)
        return cycled
            .sumOf { row ->
                val rowSum =
                    row.reversed().withIndex().filter { (_, char) -> char == ROUNDED }.sumOf { (idx, _) -> idx + 1 }
                rowSum
            }
            .toString()
    }

    private fun cycleUntil(grid: List<String>, targetCycles: Int): List<String> {
        val seenMap = mutableMapOf<List<String>, Long>()
        var cycles = 0L
        var cycled = cycle(grid)
        while (cycles < targetCycles) {
            cycled = cycle(cycled)
            cycles++
            if (seenMap.containsKey(cycled)) {
                val firstSeen = seenMap[cycled]!!
                val cyclesSince = cycles - firstSeen
                var remainingCycles = (targetCycles - cycles) % cyclesSince - 1

                while (remainingCycles > 0) {
                    cycled = cycle(cycled)
                    remainingCycles--
                }
                break
            } else {
                seenMap[cycled] = cycles
            }
        }
        return cycled
    }

    private fun cycle(grid: List<String>): List<String> {
        val northRoll = grid.map { roll(it) }
        val west = transpose(northRoll)
        val westRoll = west.map { roll(it) }
        val south = transpose(westRoll).map { it.reversed() }
        val southRoll = south.map { roll(it) }
        val east = transpose(southRoll.map { it.reversed() }).map { it.reversed() }
        val eastRoll = east.map { roll(it) }
        val backNorth = transpose(eastRoll.map { it.reversed() })
        return backNorth
    }
}

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

  private static final char ROUNDED;

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

  public final java.lang.String 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: getstatic     #28                 // Field Day13.INSTANCE:LDay13;
       9: aload_1
      10: invokevirtual #32                 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;
      13: astore_2
      14: aload_2
      15: checkcast     #34                 // class java/lang/Iterable
      18: astore_3
      19: iconst_0
      20: istore        4
      22: aload_3
      23: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      28: astore        5
      30: aload         5
      32: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      37: ifeq          287
      40: aload         5
      42: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      47: astore        6
      49: iload         4
      51: aload         6
      53: checkcast     #50                 // class java/lang/String
      56: astore        7
      58: istore        22
      60: iconst_0
      61: istore        8
      63: getstatic     #52                 // Field INSTANCE:LDay14;
      66: aload         7
      68: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
      71: astore        9
      73: aload         9
      75: checkcast     #58                 // class java/lang/CharSequence
      78: invokestatic  #64                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      81: invokevirtual #68                 // Method java/lang/Object.toString:()Ljava/lang/String;
      84: checkcast     #58                 // class java/lang/CharSequence
      87: invokestatic  #72                 // Method kotlin/text/StringsKt.withIndex:(Ljava/lang/CharSequence;)Ljava/lang/Iterable;
      90: astore        10
      92: iconst_0
      93: istore        11
      95: aload         10
      97: astore        12
      99: new           #74                 // class java/util/ArrayList
     102: dup
     103: invokespecial #75                 // Method java/util/ArrayList."<init>":()V
     106: checkcast     #77                 // class java/util/Collection
     109: astore        13
     111: iconst_0
     112: istore        14
     114: aload         12
     116: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     121: astore        15
     123: aload         15
     125: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     130: ifeq          193
     133: aload         15
     135: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     140: astore        16
     142: aload         16
     144: checkcast     #79                 // class kotlin/collections/IndexedValue
     147: astore        17
     149: iconst_0
     150: istore        18
     152: aload         17
     154: invokevirtual #82                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     157: checkcast     #84                 // class java/lang/Character
     160: invokevirtual #88                 // Method java/lang/Character.charValue:()C
     163: istore        19
     165: iload         19
     167: bipush        79
     169: if_icmpne     176
     172: iconst_1
     173: goto          177
     176: iconst_0
     177: ifeq          123
     180: aload         13
     182: aload         16
     184: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     189: pop
     190: goto          123
     193: aload         13
     195: checkcast     #94                 // class java/util/List
     198: nop
     199: checkcast     #34                 // class java/lang/Iterable
     202: astore        10
     204: iconst_0
     205: istore        11
     207: aload         10
     209: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     214: astore        12
     216: aload         12
     218: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     223: ifeq          272
     226: aload         12
     228: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     233: astore        13
     235: iload         11
     237: aload         13
     239: checkcast     #79                 // class kotlin/collections/IndexedValue
     242: astore        14
     244: istore        20
     246: iconst_0
     247: istore        15
     249: aload         14
     251: invokevirtual #98                 // Method kotlin/collections/IndexedValue.component1:()I
     254: istore        16
     256: iload         16
     258: iconst_1
     259: iadd
     260: istore        21
     262: iload         20
     264: iload         21
     266: iadd
     267: istore        11
     269: goto          216
     272: iload         11
     274: nop
     275: istore        23
     277: iload         22
     279: iload         23
     281: iadd
     282: istore        4
     284: goto          30
     287: iload         4
     289: invokestatic  #102                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     292: areturn

  private final java.lang.String roll(java.lang.String);
    Code:
       0: aload_1
       1: checkcast     #58                 // class java/lang/CharSequence
       4: invokestatic  #127                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
       7: ifeq          12
      10: aload_1
      11: areturn
      12: aload_1
      13: iconst_0
      14: invokevirtual #131                // Method java/lang/String.charAt:(I)C
      17: bipush        79
      19: if_icmpne     63
      22: aload_1
      23: iconst_0
      24: invokevirtual #131                // Method java/lang/String.charAt:(I)C
      27: istore_2
      28: aload_0
      29: aload_1
      30: iconst_1
      31: invokevirtual #134                // Method java/lang/String.substring:(I)Ljava/lang/String;
      34: dup
      35: ldc           #136                // String substring(...)
      37: invokestatic  #139                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      40: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
      43: astore_3
      44: new           #141                // class java/lang/StringBuilder
      47: dup
      48: invokespecial #142                // Method java/lang/StringBuilder."<init>":()V
      51: iload_2
      52: invokevirtual #146                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      55: aload_3
      56: invokevirtual #149                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      59: invokevirtual #150                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      62: areturn
      63: aload_1
      64: checkcast     #58                 // class java/lang/CharSequence
      67: invokestatic  #72                 // Method kotlin/text/StringsKt.withIndex:(Ljava/lang/CharSequence;)Ljava/lang/Iterable;
      70: astore_3
      71: iconst_0
      72: istore        4
      74: iconst_0
      75: istore        5
      77: new           #74                 // class java/util/ArrayList
      80: dup
      81: invokespecial #75                 // Method java/util/ArrayList."<init>":()V
      84: astore        6
      86: aload_3
      87: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      92: astore        7
      94: aload         7
      96: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     101: ifeq          181
     104: aload         7
     106: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     111: astore        8
     113: iload         5
     115: ifeq          129
     118: aload         6
     120: aload         8
     122: invokevirtual #151                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     125: pop
     126: goto          94
     129: aload         8
     131: checkcast     #79                 // class kotlin/collections/IndexedValue
     134: astore        9
     136: iconst_0
     137: istore        10
     139: aload         9
     141: invokevirtual #82                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     144: checkcast     #84                 // class java/lang/Character
     147: invokevirtual #88                 // Method java/lang/Character.charValue:()C
     150: istore        11
     152: iload         11
     154: bipush        46
     156: if_icmpne     163
     159: iconst_1
     160: goto          164
     163: iconst_0
     164: ifne          94
     167: aload         6
     169: aload         8
     171: invokevirtual #151                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     174: pop
     175: iconst_1
     176: istore        5
     178: goto          94
     181: aload         6
     183: checkcast     #94                 // class java/util/List
     186: invokestatic  #157                // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;
     189: checkcast     #79                 // class kotlin/collections/IndexedValue
     192: astore_2
     193: aload_2
     194: ifnonnull     199
     197: aload_1
     198: areturn
     199: aload_2
     200: invokevirtual #98                 // Method kotlin/collections/IndexedValue.component1:()I
     203: istore_3
     204: aload_1
     205: iload_3
     206: invokevirtual #131                // Method java/lang/String.charAt:(I)C
     209: bipush        79
     211: if_icmpne     285
     214: new           #141                // class java/lang/StringBuilder
     217: dup
     218: invokespecial #142                // Method java/lang/StringBuilder."<init>":()V
     221: bipush        79
     223: invokevirtual #146                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     226: aload_0
     227: new           #141                // class java/lang/StringBuilder
     230: dup
     231: invokespecial #142                // Method java/lang/StringBuilder."<init>":()V
     234: aload_1
     235: iconst_1
     236: iload_3
     237: invokevirtual #160                // Method java/lang/String.substring:(II)Ljava/lang/String;
     240: dup
     241: ldc           #136                // String substring(...)
     243: invokestatic  #139                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     246: invokevirtual #149                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     249: bipush        46
     251: invokevirtual #146                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     254: aload_1
     255: iload_3
     256: iconst_1
     257: iadd
     258: invokevirtual #134                // Method java/lang/String.substring:(I)Ljava/lang/String;
     261: dup
     262: ldc           #136                // String substring(...)
     264: invokestatic  #139                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     267: invokevirtual #149                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     270: invokevirtual #150                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     273: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
     276: invokevirtual #149                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     279: invokevirtual #150                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     282: goto          332
     285: new           #141                // class java/lang/StringBuilder
     288: dup
     289: invokespecial #142                // Method java/lang/StringBuilder."<init>":()V
     292: aload_1
     293: iconst_0
     294: iload_3
     295: iconst_1
     296: iadd
     297: invokevirtual #160                // Method java/lang/String.substring:(II)Ljava/lang/String;
     300: dup
     301: ldc           #136                // String substring(...)
     303: invokestatic  #139                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     306: invokevirtual #149                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     309: aload_0
     310: aload_1
     311: iload_3
     312: iconst_1
     313: iadd
     314: invokevirtual #134                // Method java/lang/String.substring:(I)Ljava/lang/String;
     317: dup
     318: ldc           #136                // String substring(...)
     320: invokestatic  #139                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     323: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
     326: invokevirtual #149                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     329: invokevirtual #150                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     332: areturn

  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: aload_0
       7: getstatic     #28                 // Field Day13.INSTANCE:LDay13;
      10: aload_1
      11: invokevirtual #32                 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;
      14: ldc           #172                // int 1000000000
      16: invokespecial #176                // Method cycleUntil:(Ljava/util/List;I)Ljava/util/List;
      19: astore_2
      20: aload_2
      21: checkcast     #34                 // class java/lang/Iterable
      24: astore_3
      25: iconst_0
      26: istore        4
      28: aload_3
      29: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      34: astore        5
      36: aload         5
      38: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      43: ifeq          286
      46: aload         5
      48: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      53: astore        6
      55: iload         4
      57: aload         6
      59: checkcast     #50                 // class java/lang/String
      62: astore        7
      64: istore        22
      66: iconst_0
      67: istore        8
      69: aload         7
      71: checkcast     #58                 // class java/lang/CharSequence
      74: invokestatic  #64                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      77: invokevirtual #68                 // Method java/lang/Object.toString:()Ljava/lang/String;
      80: checkcast     #58                 // class java/lang/CharSequence
      83: invokestatic  #72                 // Method kotlin/text/StringsKt.withIndex:(Ljava/lang/CharSequence;)Ljava/lang/Iterable;
      86: astore        9
      88: iconst_0
      89: istore        10
      91: aload         9
      93: astore        11
      95: new           #74                 // class java/util/ArrayList
      98: dup
      99: invokespecial #75                 // Method java/util/ArrayList."<init>":()V
     102: checkcast     #77                 // class java/util/Collection
     105: astore        12
     107: iconst_0
     108: istore        13
     110: aload         11
     112: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     117: astore        14
     119: aload         14
     121: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     126: ifeq          189
     129: aload         14
     131: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     136: astore        15
     138: aload         15
     140: checkcast     #79                 // class kotlin/collections/IndexedValue
     143: astore        16
     145: iconst_0
     146: istore        17
     148: aload         16
     150: invokevirtual #82                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     153: checkcast     #84                 // class java/lang/Character
     156: invokevirtual #88                 // Method java/lang/Character.charValue:()C
     159: istore        18
     161: iload         18
     163: bipush        79
     165: if_icmpne     172
     168: iconst_1
     169: goto          173
     172: iconst_0
     173: ifeq          119
     176: aload         12
     178: aload         15
     180: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     185: pop
     186: goto          119
     189: aload         12
     191: checkcast     #94                 // class java/util/List
     194: nop
     195: checkcast     #34                 // class java/lang/Iterable
     198: astore        9
     200: iconst_0
     201: istore        10
     203: aload         9
     205: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     210: astore        11
     212: aload         11
     214: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     219: ifeq          268
     222: aload         11
     224: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     229: astore        12
     231: iload         10
     233: aload         12
     235: checkcast     #79                 // class kotlin/collections/IndexedValue
     238: astore        13
     240: istore        19
     242: iconst_0
     243: istore        14
     245: aload         13
     247: invokevirtual #98                 // Method kotlin/collections/IndexedValue.component1:()I
     250: istore        15
     252: iload         15
     254: iconst_1
     255: iadd
     256: istore        20
     258: iload         19
     260: iload         20
     262: iadd
     263: istore        10
     265: goto          212
     268: iload         10
     270: istore        21
     272: iload         21
     274: istore        23
     276: iload         22
     278: iload         23
     280: iadd
     281: istore        4
     283: goto          36
     286: iload         4
     288: invokestatic  #102                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     291: areturn

  private final java.util.List<java.lang.String> cycleUntil(java.util.List<java.lang.String>, int);
    Code:
       0: new           #184                // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #185                // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #187                // class java/util/Map
      10: astore_3
      11: lconst_0
      12: lstore        4
      14: aload_0
      15: aload_1
      16: invokespecial #190                // Method cycle:(Ljava/util/List;)Ljava/util/List;
      19: astore        6
      21: lload         4
      23: iload_2
      24: i2l
      25: lcmp
      26: ifge          151
      29: aload_0
      30: aload         6
      32: invokespecial #190                // Method cycle:(Ljava/util/List;)Ljava/util/List;
      35: astore        6
      37: lload         4
      39: lstore        7
      41: lload         7
      43: lconst_1
      44: ladd
      45: lstore        4
      47: aload_3
      48: aload         6
      50: invokeinterface #193,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
      55: ifeq          130
      58: aload_3
      59: aload         6
      61: invokeinterface #197,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      66: dup
      67: invokestatic  #201                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      70: checkcast     #203                // class java/lang/Number
      73: invokevirtual #207                // Method java/lang/Number.longValue:()J
      76: lstore        7
      78: lload         4
      80: lload         7
      82: lsub
      83: lstore        9
      85: iload_2
      86: i2l
      87: lload         4
      89: lsub
      90: lload         9
      92: lrem
      93: lconst_1
      94: lsub
      95: lstore        11
      97: lload         11
      99: lconst_0
     100: lcmp
     101: ifle          127
     104: aload_0
     105: aload         6
     107: invokespecial #190                // Method cycle:(Ljava/util/List;)Ljava/util/List;
     110: astore        6
     112: lload         11
     114: lstore        13
     116: lload         13
     118: ldc2_w        #208                // long -1l
     121: ladd
     122: lstore        11
     124: goto          97
     127: goto          151
     130: lload         4
     132: invokestatic  #214                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     135: astore        8
     137: aload_3
     138: aload         6
     140: aload         8
     142: invokeinterface #218,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     147: pop
     148: goto          21
     151: aload         6
     153: areturn

  private final java.util.List<java.lang.String> cycle(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: checkcast     #34                 // class java/lang/Iterable
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: astore        5
      11: new           #74                 // class java/util/ArrayList
      14: dup
      15: aload_3
      16: bipush        10
      18: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #77                 // class java/util/Collection
      27: astore        6
      29: iconst_0
      30: istore        7
      32: aload         5
      34: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      39: astore        8
      41: aload         8
      43: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      48: ifeq          94
      51: aload         8
      53: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      58: astore        9
      60: aload         6
      62: aload         9
      64: checkcast     #50                 // class java/lang/String
      67: astore        10
      69: astore        19
      71: iconst_0
      72: istore        11
      74: getstatic     #52                 // Field INSTANCE:LDay14;
      77: aload         10
      79: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
      82: aload         19
      84: swap
      85: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      90: pop
      91: goto          41
      94: aload         6
      96: checkcast     #94                 // class java/util/List
      99: nop
     100: astore_2
     101: getstatic     #28                 // Field Day13.INSTANCE:LDay13;
     104: aload_2
     105: invokevirtual #32                 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;
     108: astore_3
     109: aload_3
     110: checkcast     #34                 // class java/lang/Iterable
     113: astore        5
     115: iconst_0
     116: istore        6
     118: aload         5
     120: astore        7
     122: new           #74                 // class java/util/ArrayList
     125: dup
     126: aload         5
     128: bipush        10
     130: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     133: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     136: checkcast     #77                 // class java/util/Collection
     139: astore        8
     141: iconst_0
     142: istore        9
     144: aload         7
     146: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     151: astore        10
     153: aload         10
     155: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     160: ifeq          206
     163: aload         10
     165: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     170: astore        11
     172: aload         8
     174: aload         11
     176: checkcast     #50                 // class java/lang/String
     179: astore        12
     181: astore        19
     183: iconst_0
     184: istore        13
     186: getstatic     #52                 // Field INSTANCE:LDay14;
     189: aload         12
     191: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
     194: aload         19
     196: swap
     197: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     202: pop
     203: goto          153
     206: aload         8
     208: checkcast     #94                 // class java/util/List
     211: nop
     212: astore        4
     214: getstatic     #28                 // Field Day13.INSTANCE:LDay13;
     217: aload         4
     219: invokevirtual #32                 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;
     222: checkcast     #34                 // class java/lang/Iterable
     225: astore        6
     227: iconst_0
     228: istore        7
     230: aload         6
     232: astore        8
     234: new           #74                 // class java/util/ArrayList
     237: dup
     238: aload         6
     240: bipush        10
     242: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     245: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     248: checkcast     #77                 // class java/util/Collection
     251: astore        9
     253: iconst_0
     254: istore        10
     256: aload         8
     258: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     263: astore        11
     265: aload         11
     267: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     272: ifeq          322
     275: aload         11
     277: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     282: astore        12
     284: aload         9
     286: aload         12
     288: checkcast     #50                 // class java/lang/String
     291: astore        13
     293: astore        19
     295: iconst_0
     296: istore        14
     298: aload         13
     300: checkcast     #58                 // class java/lang/CharSequence
     303: invokestatic  #64                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     306: invokevirtual #68                 // Method java/lang/Object.toString:()Ljava/lang/String;
     309: nop
     310: aload         19
     312: swap
     313: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     318: pop
     319: goto          265
     322: aload         9
     324: checkcast     #94                 // class java/util/List
     327: nop
     328: astore        5
     330: aload         5
     332: checkcast     #34                 // class java/lang/Iterable
     335: astore        7
     337: iconst_0
     338: istore        8
     340: aload         7
     342: astore        9
     344: new           #74                 // class java/util/ArrayList
     347: dup
     348: aload         7
     350: bipush        10
     352: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     355: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     358: checkcast     #77                 // class java/util/Collection
     361: astore        10
     363: iconst_0
     364: istore        11
     366: aload         9
     368: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     373: astore        12
     375: aload         12
     377: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     382: ifeq          428
     385: aload         12
     387: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     392: astore        13
     394: aload         10
     396: aload         13
     398: checkcast     #50                 // class java/lang/String
     401: astore        14
     403: astore        19
     405: iconst_0
     406: istore        15
     408: getstatic     #52                 // Field INSTANCE:LDay14;
     411: aload         14
     413: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
     416: aload         19
     418: swap
     419: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     424: pop
     425: goto          375
     428: aload         10
     430: checkcast     #94                 // class java/util/List
     433: nop
     434: astore        6
     436: getstatic     #28                 // Field Day13.INSTANCE:LDay13;
     439: aload         6
     441: checkcast     #34                 // class java/lang/Iterable
     444: astore        8
     446: astore        19
     448: iconst_0
     449: istore        9
     451: aload         8
     453: astore        10
     455: new           #74                 // class java/util/ArrayList
     458: dup
     459: aload         8
     461: bipush        10
     463: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     466: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     469: checkcast     #77                 // class java/util/Collection
     472: astore        11
     474: iconst_0
     475: istore        12
     477: aload         10
     479: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     484: astore        13
     486: aload         13
     488: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     493: ifeq          543
     496: aload         13
     498: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     503: astore        14
     505: aload         11
     507: aload         14
     509: checkcast     #50                 // class java/lang/String
     512: astore        15
     514: astore        20
     516: iconst_0
     517: istore        16
     519: aload         15
     521: checkcast     #58                 // class java/lang/CharSequence
     524: invokestatic  #64                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     527: invokevirtual #68                 // Method java/lang/Object.toString:()Ljava/lang/String;
     530: nop
     531: aload         20
     533: swap
     534: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     539: pop
     540: goto          486
     543: aload         11
     545: checkcast     #94                 // class java/util/List
     548: nop
     549: aload         19
     551: swap
     552: invokevirtual #32                 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;
     555: checkcast     #34                 // class java/lang/Iterable
     558: astore        8
     560: iconst_0
     561: istore        9
     563: aload         8
     565: astore        10
     567: new           #74                 // class java/util/ArrayList
     570: dup
     571: aload         8
     573: bipush        10
     575: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     578: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     581: checkcast     #77                 // class java/util/Collection
     584: astore        11
     586: iconst_0
     587: istore        12
     589: aload         10
     591: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     596: astore        13
     598: aload         13
     600: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     605: ifeq          655
     608: aload         13
     610: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     615: astore        14
     617: aload         11
     619: aload         14
     621: checkcast     #50                 // class java/lang/String
     624: astore        15
     626: astore        19
     628: iconst_0
     629: istore        16
     631: aload         15
     633: checkcast     #58                 // class java/lang/CharSequence
     636: invokestatic  #64                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     639: invokevirtual #68                 // Method java/lang/Object.toString:()Ljava/lang/String;
     642: nop
     643: aload         19
     645: swap
     646: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     651: pop
     652: goto          598
     655: aload         11
     657: checkcast     #94                 // class java/util/List
     660: nop
     661: astore        7
     663: aload         7
     665: checkcast     #34                 // class java/lang/Iterable
     668: astore        9
     670: iconst_0
     671: istore        10
     673: aload         9
     675: astore        11
     677: new           #74                 // class java/util/ArrayList
     680: dup
     681: aload         9
     683: bipush        10
     685: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     688: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     691: checkcast     #77                 // class java/util/Collection
     694: astore        12
     696: iconst_0
     697: istore        13
     699: aload         11
     701: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     706: astore        14
     708: aload         14
     710: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     715: ifeq          761
     718: aload         14
     720: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     725: astore        15
     727: aload         12
     729: aload         15
     731: checkcast     #50                 // class java/lang/String
     734: astore        16
     736: astore        19
     738: iconst_0
     739: istore        17
     741: getstatic     #52                 // Field INSTANCE:LDay14;
     744: aload         16
     746: invokespecial #56                 // Method roll:(Ljava/lang/String;)Ljava/lang/String;
     749: aload         19
     751: swap
     752: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     757: pop
     758: goto          708
     761: aload         12
     763: checkcast     #94                 // class java/util/List
     766: nop
     767: astore        8
     769: getstatic     #28                 // Field Day13.INSTANCE:LDay13;
     772: aload         8
     774: checkcast     #34                 // class java/lang/Iterable
     777: astore        10
     779: astore        19
     781: iconst_0
     782: istore        11
     784: aload         10
     786: astore        12
     788: new           #74                 // class java/util/ArrayList
     791: dup
     792: aload         10
     794: bipush        10
     796: invokestatic  #232                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     799: invokespecial #235                // Method java/util/ArrayList."<init>":(I)V
     802: checkcast     #77                 // class java/util/Collection
     805: astore        13
     807: iconst_0
     808: istore        14
     810: aload         12
     812: invokeinterface #38,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     817: astore        15
     819: aload         15
     821: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     826: ifeq          876
     829: aload         15
     831: invokeinterface #48,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     836: astore        16
     838: aload         13
     840: aload         16
     842: checkcast     #50                 // class java/lang/String
     845: astore        17
     847: astore        20
     849: iconst_0
     850: istore        18
     852: aload         17
     854: checkcast     #58                 // class java/lang/CharSequence
     857: invokestatic  #64                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     860: invokevirtual #68                 // Method java/lang/Object.toString:()Ljava/lang/String;
     863: nop
     864: aload         20
     866: swap
     867: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     872: pop
     873: goto          819
     876: aload         13
     878: checkcast     #94                 // class java/util/List
     881: nop
     882: aload         19
     884: swap
     885: invokevirtual #32                 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;
     888: astore        9
     890: aload         9
     892: areturn

  static {};
    Code:
       0: new           #2                  // class Day14
       3: dup
       4: invokespecial #259                // Method "<init>":()V
       7: putstatic     #52                 // Field INSTANCE:LDay14;
      10: return
}


import kotlin.String
import kotlin.collections.List
import kotlin.math.*

object Day6 {
    fun part1(input: List<String>): String {
        val parseNumbers: (String, String) -> List<Int> = { str: String, prefix: String ->
            str.replace(prefix, "")
                .trim()
                .split("\\s+".toRegex())
                .map { it.toInt() }
        }
        val times = parseNumbers(input.first(), "Time:")
        val distances = parseNumbers(input.last(), "Distance:")

        return times.zip(distances)
            .map { (time, distance) ->
                val (maxTime, minTime) = maxAndMinTimes(time.toLong(), distance.toLong())
                maxTime - minTime + 1
            }.reduce { a, b -> a * b }.toString()
    }

    fun part2(input: List<String>): String {
        val parseNumber: (String, String) -> Long = { str: String, prefix: String ->
            str.replace(prefix, "")
                .trim()
                .replace(" ", "")
                .toLong()
        }
        val time = parseNumber(input.first(), "Time:")
        val distance = parseNumber(input.last(), "Distance:")
        val (maxTime, minTime) = maxAndMinTimes(time, distance)
        // Add 1 to count the upper as inclusive
        return (maxTime - minTime + 1).toString()
    }

    /**
     * If we look at the equation for distance, we get:
     * distance = holdTime * (time - holdTime)
     * Turning this into a quadratic equation, we get:
     * 0 = -holdTime^2 + time * holdTime - distance
     *
     * We can then use the quadratic formula to find the holdTime:
     * holdTime = (-time +- sqrt(time^2 - 4 * -(distance + 1))) / -2
     *
     * Note, we set distance + 1 because we have to exceed the target distance
     */
    private fun maxAndMinTimes(time: Long, distance: Long): Pair<Long, Long> {
        val squareRoot = sqrt(time.toDouble().pow(2) - 4 * (distance + 1))
        val upper = (-time - squareRoot) / -2
        val lower = (-time + squareRoot) / -2
        // We have to floor the upper because we cannot hold fractional seconds, and have to ceil the lower
        return floor(upper).toLong() to ceil(lower).toLong()
    }
}

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

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

  public final java.lang.String 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: invokedynamic #41,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;
      11: astore_2
      12: aload_2
      13: aload_1
      14: invokestatic  #47                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      17: ldc           #49                 // String Time:
      19: invokeinterface #53,  3           // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      24: checkcast     #55                 // class java/util/List
      27: astore_3
      28: aload_2
      29: aload_1
      30: invokestatic  #58                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      33: ldc           #60                 // String Distance:
      35: invokeinterface #53,  3           // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      40: checkcast     #55                 // class java/util/List
      43: astore        4
      45: aload_3
      46: checkcast     #62                 // class java/lang/Iterable
      49: aload         4
      51: checkcast     #62                 // class java/lang/Iterable
      54: invokestatic  #66                 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
      57: checkcast     #62                 // class java/lang/Iterable
      60: astore        5
      62: nop
      63: iconst_0
      64: istore        6
      66: aload         5
      68: astore        7
      70: new           #68                 // class java/util/ArrayList
      73: dup
      74: aload         5
      76: bipush        10
      78: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      81: invokespecial #75                 // Method java/util/ArrayList."<init>":(I)V
      84: checkcast     #77                 // class java/util/Collection
      87: astore        8
      89: iconst_0
      90: istore        9
      92: aload         7
      94: invokeinterface #81,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      99: astore        10
     101: aload         10
     103: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     108: ifeq          222
     111: aload         10
     113: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     118: astore        11
     120: aload         8
     122: aload         11
     124: checkcast     #93                 // class kotlin/Pair
     127: astore        12
     129: astore        21
     131: iconst_0
     132: istore        13
     134: aload         12
     136: invokevirtual #96                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
     139: checkcast     #98                 // class java/lang/Number
     142: invokevirtual #102                // Method java/lang/Number.intValue:()I
     145: istore        14
     147: aload         12
     149: invokevirtual #105                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     152: checkcast     #98                 // class java/lang/Number
     155: invokevirtual #102                // Method java/lang/Number.intValue:()I
     158: istore        15
     160: getstatic     #108                // Field INSTANCE:LDay6;
     163: iload         14
     165: i2l
     166: iload         15
     168: i2l
     169: invokespecial #112                // Method maxAndMinTimes:(JJ)Lkotlin/Pair;
     172: astore        16
     174: aload         16
     176: invokevirtual #96                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
     179: checkcast     #98                 // class java/lang/Number
     182: invokevirtual #116                // Method java/lang/Number.longValue:()J
     185: lstore        17
     187: aload         16
     189: invokevirtual #105                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     192: checkcast     #98                 // class java/lang/Number
     195: invokevirtual #116                // Method java/lang/Number.longValue:()J
     198: lstore        19
     200: lload         17
     202: lload         19
     204: lsub
     205: lconst_1
     206: ladd
     207: invokestatic  #122                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     210: aload         21
     212: swap
     213: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     218: pop
     219: goto          101
     222: aload         8
     224: checkcast     #55                 // class java/util/List
     227: nop
     228: checkcast     #62                 // class java/lang/Iterable
     231: astore        5
     233: nop
     234: iconst_0
     235: istore        6
     237: aload         5
     239: invokeinterface #81,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     244: astore        7
     246: aload         7
     248: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     253: ifne          266
     256: new           #128                // class java/lang/UnsupportedOperationException
     259: dup
     260: ldc           #130                // String Empty collection can\'t be reduced.
     262: invokespecial #133                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     265: athrow
     266: aload         7
     268: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     273: astore        8
     275: aload         7
     277: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     282: ifeq          326
     285: aload         8
     287: aload         7
     289: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     294: checkcast     #98                 // class java/lang/Number
     297: invokevirtual #116                // Method java/lang/Number.longValue:()J
     300: lstore        9
     302: checkcast     #98                 // class java/lang/Number
     305: invokevirtual #116                // Method java/lang/Number.longValue:()J
     308: lstore        11
     310: iconst_0
     311: istore        13
     313: lload         11
     315: lload         9
     317: lmul
     318: invokestatic  #122                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     321: astore        8
     323: goto          275
     326: aload         8
     328: checkcast     #98                 // class java/lang/Number
     331: invokevirtual #116                // Method java/lang/Number.longValue:()J
     334: invokestatic  #138                // Method java/lang/String.valueOf:(J)Ljava/lang/String;
     337: areturn

  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: invokedynamic #176,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function2;
      11: astore_2
      12: aload_2
      13: aload_1
      14: invokestatic  #47                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      17: ldc           #49                 // String Time:
      19: invokeinterface #53,  3           // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      24: checkcast     #98                 // class java/lang/Number
      27: invokevirtual #116                // Method java/lang/Number.longValue:()J
      30: lstore_3
      31: aload_2
      32: aload_1
      33: invokestatic  #58                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      36: ldc           #60                 // String Distance:
      38: invokeinterface #53,  3           // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      43: checkcast     #98                 // class java/lang/Number
      46: invokevirtual #116                // Method java/lang/Number.longValue:()J
      49: lstore        5
      51: aload_0
      52: lload_3
      53: lload         5
      55: invokespecial #112                // Method maxAndMinTimes:(JJ)Lkotlin/Pair;
      58: astore        7
      60: aload         7
      62: invokevirtual #96                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      65: checkcast     #98                 // class java/lang/Number
      68: invokevirtual #116                // Method java/lang/Number.longValue:()J
      71: lstore        8
      73: aload         7
      75: invokevirtual #105                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      78: checkcast     #98                 // class java/lang/Number
      81: invokevirtual #116                // Method java/lang/Number.longValue:()J
      84: lstore        10
      86: lload         8
      88: lload         10
      90: lsub
      91: lconst_1
      92: ladd
      93: invokestatic  #138                // Method java/lang/String.valueOf:(J)Ljava/lang/String;
      96: areturn

  private final kotlin.Pair<java.lang.Long, java.lang.Long> maxAndMinTimes(long, long);
    Code:
       0: lload_1
       1: l2d
       2: iconst_2
       3: i2d
       4: invokestatic  #184                // Method java/lang/Math.pow:(DD)D
       7: iconst_4
       8: i2l
       9: lload_3
      10: lconst_1
      11: ladd
      12: lmul
      13: l2d
      14: dsub
      15: invokestatic  #188                // Method java/lang/Math.sqrt:(D)D
      18: dstore        5
      20: lload_1
      21: lneg
      22: l2d
      23: dload         5
      25: dsub
      26: bipush        -2
      28: i2d
      29: ddiv
      30: dstore        7
      32: lload_1
      33: lneg
      34: l2d
      35: dload         5
      37: dadd
      38: bipush        -2
      40: i2d
      41: ddiv
      42: dstore        9
      44: dload         7
      46: invokestatic  #191                // Method java/lang/Math.floor:(D)D
      49: d2l
      50: invokestatic  #122                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      53: dload         9
      55: invokestatic  #194                // Method java/lang/Math.ceil:(D)D
      58: d2l
      59: invokestatic  #122                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      62: invokestatic  #200                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      65: areturn

  private static final java.util.List part1$lambda$1(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: ldc           #206                // String str
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #208                // String prefix
       9: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: nop
      13: aload_0
      14: aload_1
      15: ldc           #210                // String
      17: iconst_0
      18: iconst_4
      19: aconst_null
      20: invokestatic  #216                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      23: checkcast     #218                // class java/lang/CharSequence
      26: invokestatic  #222                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      29: invokevirtual #226                // Method java/lang/Object.toString:()Ljava/lang/String;
      32: checkcast     #218                // class java/lang/CharSequence
      35: astore_2
      36: new           #228                // class kotlin/text/Regex
      39: dup
      40: ldc           #230                // String \\s+
      42: invokespecial #231                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      45: astore_3
      46: iconst_0
      47: istore        4
      49: aload_3
      50: aload_2
      51: iload         4
      53: invokevirtual #235                // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      56: checkcast     #62                 // class java/lang/Iterable
      59: astore_2
      60: nop
      61: iconst_0
      62: istore_3
      63: aload_2
      64: astore        4
      66: new           #68                 // class java/util/ArrayList
      69: dup
      70: aload_2
      71: bipush        10
      73: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      76: invokespecial #75                 // Method java/util/ArrayList."<init>":(I)V
      79: checkcast     #77                 // class java/util/Collection
      82: astore        5
      84: iconst_0
      85: istore        6
      87: aload         4
      89: invokeinterface #81,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      94: astore        7
      96: aload         7
      98: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     103: ifeq          150
     106: aload         7
     108: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     113: astore        8
     115: aload         5
     117: aload         8
     119: checkcast     #135                // class java/lang/String
     122: astore        9
     124: astore        11
     126: iconst_0
     127: istore        10
     129: aload         9
     131: invokestatic  #241                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     134: nop
     135: invokestatic  #244                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     138: aload         11
     140: swap
     141: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     146: pop
     147: goto          96
     150: aload         5
     152: checkcast     #55                 // class java/util/List
     155: nop
     156: areturn

  private static final long part2$lambda$4(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: ldc           #206                // String str
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #208                // String prefix
       9: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: nop
      13: nop
      14: aload_0
      15: aload_1
      16: ldc           #210                // String
      18: iconst_0
      19: iconst_4
      20: aconst_null
      21: invokestatic  #216                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      24: checkcast     #218                // class java/lang/CharSequence
      27: invokestatic  #222                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      30: invokevirtual #226                // Method java/lang/Object.toString:()Ljava/lang/String;
      33: ldc           #249                // String
      35: ldc           #210                // String
      37: iconst_0
      38: iconst_4
      39: aconst_null
      40: invokestatic  #216                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      43: invokestatic  #253                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      46: lreturn

  static {};
    Code:
       0: new           #2                  // class Day6
       3: dup
       4: invokespecial #255                // Method "<init>":()V
       7: putstatic     #108                // Field INSTANCE:LDay6;
      10: return
}