package problems.day7.part2

import java.io.File

private const val inputFile = "input/day7/input.txt"
//private const val testFile = "input/day7/test.txt"

fun main() {
    val scoreSum = File(inputFile).bufferedReader().useLines { sumScores(it) }
    println("Sum of scores is $scoreSum")
}

private fun sumScores(lines: Sequence<String>): Int {
    return lines.map { it.toHand() }
        .sorted()
        .foldIndexed(0) { index, acc, hand -> acc + ((index + 1) * hand.bid) }
}

private data class Hand(val cards: List<Card>, val bid: Int, val handType: HandType) : Comparable<Hand> {
    override fun compareTo(other: Hand): Int {
        if (this.handType == other.handType) {
            return this.cards.compareTo(other.cards)
        }

        return this.handType.compareTo(other.handType)
    }
}

private fun List<Card>.compareTo(other: List<Card>): Int {
    for (pair in this.asSequence().zip(other.asSequence())) {
        if (pair.first != pair.second) {
            return pair.first.compareTo(pair.second)
        }
    }

    return 0
}

private fun String.toHand(): Hand {
    val cards = this.substringBefore(" ").map { it.toCard() }
    val bid = this.substringAfter(" ").toInt()
    val handType = cards.toHandType()
    return Hand(cards, bid, handType)
}

private enum class HandType {
    HIGH_CARD,
    ONE_PAIR,
    TWO_PAIR,
    THREE_OF_A_KIND,
    FULL_HOUSE,
    FOUR_OF_A_KIND,
    FIVE_OF_A_KIND,
}

private fun List<Card>.toHandType(): HandType {
    val typeHistogram = mutableMapOf<Card, UInt>()
    for (card in this) {
        typeHistogram[card] = typeHistogram.getOrDefault(card, 0u) + 1u
    }
    return strongestHandType(typeHistogram)
}

private fun strongestHandType(typeHistogram: Map<Card, UInt>): HandType = when (typeHistogram[Card.JOKER]) {
    null -> simpleHandType(typeHistogram)
    0u -> simpleHandType(typeHistogram)
    5u -> HandType.FIVE_OF_A_KIND
    else -> typeHistogram.keys.filter { it != Card.JOKER }.maxOf {
        val possibleHistogram = typeHistogram.toMutableMap()
        possibleHistogram[Card.JOKER] = possibleHistogram[Card.JOKER]!! - 1u
        possibleHistogram[it] = possibleHistogram[it]!! + 1u
        strongestHandType(possibleHistogram)
    }
}

private fun simpleHandType(typeHistogram: Map<Card, UInt>): HandType = when {
    typeHistogram.any { it.value == 5u } -> HandType.FIVE_OF_A_KIND
    typeHistogram.any { it.value == 4u } -> HandType.FOUR_OF_A_KIND
    typeHistogram.any { it.value == 3u } and typeHistogram.any { it.value == 2u } -> HandType.FULL_HOUSE
    typeHistogram.any { it.value == 3u } -> HandType.THREE_OF_A_KIND
    typeHistogram.filter { it.value == 2u }.count() == 2 -> HandType.TWO_PAIR
    typeHistogram.any { it.value == 2u } -> HandType.ONE_PAIR
    else -> HandType.HIGH_CARD
}

private enum class Card {
    JOKER,
    TWO,
    THREE,
    FOUR,
    FIVE,
    SIX,
    SEVEN,
    EIGHT,
    NINE,
    TEN,
    QUEEN,
    KING,
    ACE,
}

private fun Char.toCard() = when (this) {
    'J' -> Card.JOKER
    '2' -> Card.TWO
    '3' -> Card.THREE
    '4' -> Card.FOUR
    '5' -> Card.FIVE
    '6' -> Card.SIX
    '7' -> Card.SEVEN
    '8' -> Card.EIGHT
    '9' -> Card.NINE
    'T' -> Card.TEN
    'Q' -> Card.QUEEN
    'K' -> Card.KING
    'A' -> Card.ACE
    else -> throw IllegalArgumentException("Char $this does not have a corresponding card")
}

Compiled from "part2.kt"
public final class problems.day7.part2.Part2Kt {
  private static final java.lang.String inputFile;

  public static final void main();
    Code:
       0: new           #10                 // class java/io/File
       3: dup
       4: ldc           #12                 // String input/day7/input.txt
       6: invokespecial #16                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_1
      10: getstatic     #22                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      13: astore_2
      14: sipush        8192
      17: istore_3
      18: aload_1
      19: astore        4
      21: new           #24                 // class java/io/InputStreamReader
      24: dup
      25: new           #26                 // class java/io/FileInputStream
      28: dup
      29: aload         4
      31: invokespecial #29                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      34: checkcast     #31                 // class java/io/InputStream
      37: aload_2
      38: invokespecial #34                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      41: checkcast     #36                 // class java/io/Reader
      44: astore        4
      46: aload         4
      48: instanceof    #38                 // class java/io/BufferedReader
      51: ifeq          62
      54: aload         4
      56: checkcast     #38                 // class java/io/BufferedReader
      59: goto          72
      62: new           #38                 // class java/io/BufferedReader
      65: dup
      66: aload         4
      68: iload_3
      69: invokespecial #41                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      72: checkcast     #36                 // class java/io/Reader
      75: astore_1
      76: nop
      77: iconst_0
      78: istore_2
      79: aload_1
      80: astore_3
      81: sipush        8192
      84: istore        4
      86: aload_3
      87: instanceof    #38                 // class java/io/BufferedReader
      90: ifeq          100
      93: aload_3
      94: checkcast     #38                 // class java/io/BufferedReader
      97: goto          110
     100: new           #38                 // class java/io/BufferedReader
     103: dup
     104: aload_3
     105: iload         4
     107: invokespecial #41                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
     110: checkcast     #43                 // class java/io/Closeable
     113: astore_3
     114: aconst_null
     115: astore        4
     117: nop
     118: aload_3
     119: checkcast     #38                 // class java/io/BufferedReader
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokestatic  #49                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     132: astore        7
     134: iconst_0
     135: istore        8
     137: aload         7
     139: invokestatic  #53                 // Method sumScores:(Lkotlin/sequences/Sequence;)I
     142: istore        5
     144: aload_3
     145: aload         4
     147: invokestatic  #59                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     150: iload         5
     152: goto          175
     155: astore        6
     157: aload         6
     159: astore        4
     161: aload         6
     163: athrow
     164: astore        6
     166: aload_3
     167: aload         4
     169: invokestatic  #59                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     172: aload         6
     174: athrow
     175: nop
     176: istore_0
     177: new           #61                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #63                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc           #65                 // String Sum of scores is
     186: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: iload_0
     190: invokevirtual #72                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     193: invokevirtual #76                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     196: getstatic     #82                 // Field java/lang/System.out:Ljava/io/PrintStream;
     199: swap
     200: invokevirtual #88                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     203: return
    Exception table:
       from    to  target type
         117   144   155   Class java/lang/Throwable
         117   144   164   any
         155   164   164   any
         164   166   164   any

  private static final int sumScores(kotlin.sequences.Sequence<java.lang.String>);
    Code:
       0: aload_0
       1: invokedynamic #123,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
       6: invokestatic  #129                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
       9: invokestatic  #133                // Method kotlin/sequences/SequencesKt.sorted:(Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
      12: astore_1
      13: iconst_0
      14: istore_2
      15: iconst_0
      16: istore_3
      17: iconst_0
      18: istore        4
      20: iload_2
      21: istore        5
      23: aload_1
      24: invokeinterface #137,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      29: astore        6
      31: aload         6
      33: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      38: ifeq          101
      41: aload         6
      43: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      48: astore        7
      50: iload         4
      52: iinc          4, 1
      55: istore        8
      57: iload         8
      59: ifge          65
      62: invokestatic  #152                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      65: iload         8
      67: iload         5
      69: aload         7
      71: checkcast     #154                // class problems/day7/part2/Hand
      74: astore        9
      76: istore        10
      78: istore        11
      80: iconst_0
      81: istore        12
      83: iload         10
      85: iload         11
      87: iconst_1
      88: iadd
      89: aload         9
      91: invokevirtual #158                // Method problems/day7/part2/Hand.getBid:()I
      94: imul
      95: iadd
      96: istore        5
      98: goto          31
     101: iload         5
     103: ireturn

  private static final int compareTo(java.util.List<? extends problems.day7.part2.Card>, java.util.List<? extends problems.day7.part2.Card>);
    Code:
       0: aload_0
       1: checkcast     #176                // class java/lang/Iterable
       4: invokestatic  #180                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
       7: aload_1
       8: checkcast     #176                // class java/lang/Iterable
      11: invokestatic  #180                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      14: invokestatic  #184                // Method kotlin/sequences/SequencesKt.zip:(Lkotlin/sequences/Sequence;Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
      17: invokeinterface #137,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      22: astore_2
      23: aload_2
      24: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      29: ifeq          71
      32: aload_2
      33: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      38: checkcast     #186                // class kotlin/Pair
      41: astore_3
      42: aload_3
      43: invokevirtual #189                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      46: aload_3
      47: invokevirtual #192                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      50: if_acmpeq     23
      53: aload_3
      54: invokevirtual #189                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      57: checkcast     #194                // class problems/day7/part2/Card
      60: aload_3
      61: invokevirtual #192                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      64: checkcast     #196                // class java/lang/Enum
      67: invokevirtual #199                // Method problems/day7/part2/Card.compareTo:(Ljava/lang/Enum;)I
      70: ireturn
      71: iconst_0
      72: ireturn

  private static final problems.day7.part2.Hand toHand(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #207                // String
       3: aconst_null
       4: iconst_2
       5: aconst_null
       6: invokestatic  #213                // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
       9: checkcast     #215                // class java/lang/CharSequence
      12: astore_2
      13: iconst_0
      14: istore_3
      15: aload_2
      16: astore        4
      18: new           #217                // class java/util/ArrayList
      21: dup
      22: aload_2
      23: invokeinterface #220,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      28: invokespecial #223                // Method java/util/ArrayList."<init>":(I)V
      31: checkcast     #225                // class java/util/Collection
      34: astore        5
      36: iconst_0
      37: istore        6
      39: iconst_0
      40: istore        7
      42: iload         7
      44: aload         4
      46: invokeinterface #220,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      51: if_icmpge     96
      54: aload         4
      56: iload         7
      58: invokeinterface #229,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      63: istore        8
      65: aload         5
      67: iload         8
      69: istore        9
      71: astore        11
      73: iconst_0
      74: istore        10
      76: iload         9
      78: invokestatic  #233                // Method toCard:(C)Lproblems/day7/part2/Card;
      81: aload         11
      83: swap
      84: invokeinterface #237,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      89: pop
      90: iinc          7, 1
      93: goto          42
      96: aload         5
      98: checkcast     #239                // class java/util/List
     101: nop
     102: astore_1
     103: aload_0
     104: ldc           #207                // String
     106: aconst_null
     107: iconst_2
     108: aconst_null
     109: invokestatic  #242                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     112: invokestatic  #248                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     115: istore_2
     116: aload_1
     117: invokestatic  #252                // Method toHandType:(Ljava/util/List;)Lproblems/day7/part2/HandType;
     120: astore_3
     121: new           #154                // class problems/day7/part2/Hand
     124: dup
     125: aload_1
     126: iload_2
     127: aload_3
     128: invokespecial #255                // Method problems/day7/part2/Hand."<init>":(Ljava/util/List;ILproblems/day7/part2/HandType;)V
     131: areturn

  private static final problems.day7.part2.HandType toHandType(java.util.List<? extends problems.day7.part2.Card>);
    Code:
       0: new           #276                // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #277                // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #279                // class java/util/Map
      10: astore_1
      11: aload_0
      12: invokeinterface #280,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      17: astore_2
      18: aload_2
      19: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifeq          74
      27: aload_2
      28: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      33: checkcast     #194                // class problems/day7/part2/Card
      36: astore_3
      37: nop
      38: aload_1
      39: aload_3
      40: aload_1
      41: aload_3
      42: iconst_0
      43: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
      46: invokeinterface #290,  3          // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      51: checkcast     #282                // class kotlin/UInt
      54: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
      57: iconst_1
      58: iadd
      59: invokestatic  #297                // Method kotlin/UInt."constructor-impl":(I)I
      62: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
      65: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      70: pop
      71: goto          18
      74: aload_1
      75: invokestatic  #304                // Method strongestHandType:(Ljava/util/Map;)Lproblems/day7/part2/HandType;
      78: areturn

  private static final problems.day7.part2.HandType strongestHandType(java.util.Map<problems.day7.part2.Card, kotlin.UInt>);
    Code:
       0: aload_0
       1: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
       4: invokeinterface #316,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
       9: checkcast     #282                // class kotlin/UInt
      12: astore_1
      13: aload_1
      14: ifnonnull     24
      17: aload_0
      18: invokestatic  #319                // Method simpleHandType:(Ljava/util/Map;)Lproblems/day7/part2/HandType;
      21: goto          446
      24: aload_1
      25: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
      28: ifne          35
      31: iconst_1
      32: goto          36
      35: iconst_0
      36: ifeq          46
      39: aload_0
      40: invokestatic  #319                // Method simpleHandType:(Ljava/util/Map;)Lproblems/day7/part2/HandType;
      43: goto          446
      46: aload_1
      47: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
      50: iconst_5
      51: if_icmpne     58
      54: iconst_1
      55: goto          59
      58: iconst_0
      59: ifeq          68
      62: getstatic     #324                // Field problems/day7/part2/HandType.FIVE_OF_A_KIND:Lproblems/day7/part2/HandType;
      65: goto          446
      68: aload_0
      69: invokeinterface #328,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
      74: checkcast     #176                // class java/lang/Iterable
      77: astore_2
      78: iconst_0
      79: istore_3
      80: aload_2
      81: astore        4
      83: new           #217                // class java/util/ArrayList
      86: dup
      87: invokespecial #329                // Method java/util/ArrayList."<init>":()V
      90: checkcast     #225                // class java/util/Collection
      93: astore        5
      95: iconst_0
      96: istore        6
      98: aload         4
     100: invokeinterface #330,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     105: astore        7
     107: aload         7
     109: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     114: ifeq          165
     117: aload         7
     119: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     124: astore        8
     126: aload         8
     128: checkcast     #194                // class problems/day7/part2/Card
     131: astore        9
     133: iconst_0
     134: istore        10
     136: aload         9
     138: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
     141: if_acmpeq     148
     144: iconst_1
     145: goto          149
     148: iconst_0
     149: ifeq          107
     152: aload         5
     154: aload         8
     156: invokeinterface #237,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     161: pop
     162: goto          107
     165: aload         5
     167: checkcast     #239                // class java/util/List
     170: nop
     171: checkcast     #176                // class java/lang/Iterable
     174: invokeinterface #330,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     179: astore_3
     180: aload_3
     181: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     186: ifne          197
     189: new           #332                // class java/util/NoSuchElementException
     192: dup
     193: invokespecial #333                // Method java/util/NoSuchElementException."<init>":()V
     196: athrow
     197: aload_3
     198: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     203: checkcast     #194                // class problems/day7/part2/Card
     206: astore        4
     208: iconst_0
     209: istore        5
     211: aload_0
     212: invokestatic  #339                // Method kotlin/collections/MapsKt.toMutableMap:(Ljava/util/Map;)Ljava/util/Map;
     215: astore        6
     217: nop
     218: aload         6
     220: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
     223: aload         6
     225: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
     228: invokeinterface #316,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     233: dup
     234: invokestatic  #344                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     237: checkcast     #282                // class kotlin/UInt
     240: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     243: iconst_1
     244: isub
     245: invokestatic  #297                // Method kotlin/UInt."constructor-impl":(I)I
     248: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
     251: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     256: pop
     257: nop
     258: aload         6
     260: aload         4
     262: aload         6
     264: aload         4
     266: invokeinterface #316,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     271: dup
     272: invokestatic  #344                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     275: checkcast     #282                // class kotlin/UInt
     278: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     281: iconst_1
     282: iadd
     283: invokestatic  #297                // Method kotlin/UInt."constructor-impl":(I)I
     286: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
     289: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     294: pop
     295: aload         6
     297: invokestatic  #304                // Method strongestHandType:(Ljava/util/Map;)Lproblems/day7/part2/HandType;
     300: checkcast     #346                // class java/lang/Comparable
     303: astore        4
     305: aload_3
     306: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     311: ifeq          441
     314: aload_3
     315: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     320: checkcast     #194                // class problems/day7/part2/Card
     323: astore        5
     325: iconst_0
     326: istore        6
     328: aload_0
     329: invokestatic  #339                // Method kotlin/collections/MapsKt.toMutableMap:(Ljava/util/Map;)Ljava/util/Map;
     332: astore        7
     334: nop
     335: aload         7
     337: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
     340: aload         7
     342: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
     345: invokeinterface #316,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     350: dup
     351: invokestatic  #344                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     354: checkcast     #282                // class kotlin/UInt
     357: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     360: iconst_1
     361: isub
     362: invokestatic  #297                // Method kotlin/UInt."constructor-impl":(I)I
     365: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
     368: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     373: pop
     374: nop
     375: aload         7
     377: aload         5
     379: aload         7
     381: aload         5
     383: invokeinterface #316,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     388: dup
     389: invokestatic  #344                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     392: checkcast     #282                // class kotlin/UInt
     395: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     398: iconst_1
     399: iadd
     400: invokestatic  #297                // Method kotlin/UInt."constructor-impl":(I)I
     403: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
     406: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     411: pop
     412: aload         7
     414: invokestatic  #304                // Method strongestHandType:(Ljava/util/Map;)Lproblems/day7/part2/HandType;
     417: checkcast     #346                // class java/lang/Comparable
     420: astore        5
     422: aload         4
     424: aload         5
     426: invokeinterface #349,  2          // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     431: ifge          305
     434: aload         5
     436: astore        4
     438: goto          305
     441: aload         4
     443: checkcast     #321                // class problems/day7/part2/HandType
     446: areturn

  private static final problems.day7.part2.HandType simpleHandType(java.util.Map<problems.day7.part2.Card, kotlin.UInt>);
    Code:
       0: nop
       1: aload_0
       2: astore_1
       3: iconst_0
       4: istore_2
       5: aload_1
       6: invokeinterface #361,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
      11: ifeq          18
      14: iconst_0
      15: goto          87
      18: aload_1
      19: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      24: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      29: astore_3
      30: aload_3
      31: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifeq          86
      39: aload_3
      40: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: checkcast     #369                // class java/util/Map$Entry
      48: astore        4
      50: aload         4
      52: astore        5
      54: iconst_0
      55: istore        6
      57: aload         5
      59: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
      64: checkcast     #282                // class kotlin/UInt
      67: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
      70: iconst_5
      71: if_icmpne     78
      74: iconst_1
      75: goto          79
      78: iconst_0
      79: ifeq          30
      82: iconst_1
      83: goto          87
      86: iconst_0
      87: ifeq          96
      90: getstatic     #324                // Field problems/day7/part2/HandType.FIVE_OF_A_KIND:Lproblems/day7/part2/HandType;
      93: goto          705
      96: aload_0
      97: astore_1
      98: iconst_0
      99: istore_2
     100: aload_1
     101: invokeinterface #361,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     106: ifeq          113
     109: iconst_0
     110: goto          182
     113: aload_1
     114: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     119: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     124: astore_3
     125: aload_3
     126: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     131: ifeq          181
     134: aload_3
     135: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     140: checkcast     #369                // class java/util/Map$Entry
     143: astore        4
     145: aload         4
     147: astore        5
     149: iconst_0
     150: istore        6
     152: aload         5
     154: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     159: checkcast     #282                // class kotlin/UInt
     162: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     165: iconst_4
     166: if_icmpne     173
     169: iconst_1
     170: goto          174
     173: iconst_0
     174: ifeq          125
     177: iconst_1
     178: goto          182
     181: iconst_0
     182: ifeq          191
     185: getstatic     #375                // Field problems/day7/part2/HandType.FOUR_OF_A_KIND:Lproblems/day7/part2/HandType;
     188: goto          705
     191: aload_0
     192: astore_1
     193: iconst_0
     194: istore_2
     195: aload_1
     196: invokeinterface #361,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     201: ifeq          208
     204: iconst_0
     205: goto          277
     208: aload_1
     209: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     214: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     219: astore_3
     220: aload_3
     221: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     226: ifeq          276
     229: aload_3
     230: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     235: checkcast     #369                // class java/util/Map$Entry
     238: astore        4
     240: aload         4
     242: astore        5
     244: iconst_0
     245: istore        6
     247: aload         5
     249: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     254: checkcast     #282                // class kotlin/UInt
     257: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     260: iconst_3
     261: if_icmpne     268
     264: iconst_1
     265: goto          269
     268: iconst_0
     269: ifeq          220
     272: iconst_1
     273: goto          277
     276: iconst_0
     277: aload_0
     278: astore_1
     279: istore        10
     281: iconst_0
     282: istore_2
     283: aload_1
     284: invokeinterface #361,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     289: ifeq          296
     292: iconst_0
     293: goto          365
     296: aload_1
     297: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     302: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     307: astore_3
     308: aload_3
     309: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     314: ifeq          364
     317: aload_3
     318: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     323: checkcast     #369                // class java/util/Map$Entry
     326: astore        4
     328: aload         4
     330: astore        5
     332: iconst_0
     333: istore        6
     335: aload         5
     337: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     342: checkcast     #282                // class kotlin/UInt
     345: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     348: iconst_2
     349: if_icmpne     356
     352: iconst_1
     353: goto          357
     356: iconst_0
     357: ifeq          308
     360: iconst_1
     361: goto          365
     364: iconst_0
     365: istore        11
     367: iload         10
     369: iload         11
     371: iand
     372: ifeq          381
     375: getstatic     #378                // Field problems/day7/part2/HandType.FULL_HOUSE:Lproblems/day7/part2/HandType;
     378: goto          705
     381: aload_0
     382: astore_1
     383: iconst_0
     384: istore_2
     385: aload_1
     386: invokeinterface #361,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     391: ifeq          398
     394: iconst_0
     395: goto          467
     398: aload_1
     399: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     404: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     409: astore_3
     410: aload_3
     411: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     416: ifeq          466
     419: aload_3
     420: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     425: checkcast     #369                // class java/util/Map$Entry
     428: astore        4
     430: aload         4
     432: astore        5
     434: iconst_0
     435: istore        6
     437: aload         5
     439: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     444: checkcast     #282                // class kotlin/UInt
     447: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     450: iconst_3
     451: if_icmpne     458
     454: iconst_1
     455: goto          459
     458: iconst_0
     459: ifeq          410
     462: iconst_1
     463: goto          467
     466: iconst_0
     467: ifeq          476
     470: getstatic     #381                // Field problems/day7/part2/HandType.THREE_OF_A_KIND:Lproblems/day7/part2/HandType;
     473: goto          705
     476: aload_0
     477: astore_1
     478: iconst_0
     479: istore_2
     480: aload_1
     481: astore_3
     482: new           #276                // class java/util/LinkedHashMap
     485: dup
     486: invokespecial #277                // Method java/util/LinkedHashMap."<init>":()V
     489: checkcast     #279                // class java/util/Map
     492: astore        4
     494: iconst_0
     495: istore        5
     497: aload_3
     498: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     503: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     508: astore        6
     510: aload         6
     512: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     517: ifeq          589
     520: aload         6
     522: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     527: checkcast     #369                // class java/util/Map$Entry
     530: astore        7
     532: aload         7
     534: astore        8
     536: iconst_0
     537: istore        9
     539: aload         8
     541: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     546: checkcast     #282                // class kotlin/UInt
     549: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     552: iconst_2
     553: if_icmpne     560
     556: iconst_1
     557: goto          561
     560: iconst_0
     561: ifeq          510
     564: aload         4
     566: aload         7
     568: invokeinterface #384,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     573: aload         7
     575: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     580: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     585: pop
     586: goto          510
     589: aload         4
     591: nop
     592: invokeinterface #387,  1          // InterfaceMethod java/util/Map.size:()I
     597: iconst_2
     598: if_icmpne     607
     601: getstatic     #390                // Field problems/day7/part2/HandType.TWO_PAIR:Lproblems/day7/part2/HandType;
     604: goto          705
     607: aload_0
     608: astore_1
     609: iconst_0
     610: istore_2
     611: aload_1
     612: invokeinterface #361,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     617: ifeq          624
     620: iconst_0
     621: goto          693
     624: aload_1
     625: invokeinterface #364,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     630: invokeinterface #367,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     635: astore_3
     636: aload_3
     637: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     642: ifeq          692
     645: aload_3
     646: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     651: checkcast     #369                // class java/util/Map$Entry
     654: astore        4
     656: aload         4
     658: astore        5
     660: iconst_0
     661: istore        6
     663: aload         5
     665: invokeinterface #372,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     670: checkcast     #282                // class kotlin/UInt
     673: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     676: iconst_2
     677: if_icmpne     684
     680: iconst_1
     681: goto          685
     684: iconst_0
     685: ifeq          636
     688: iconst_1
     689: goto          693
     692: iconst_0
     693: ifeq          702
     696: getstatic     #393                // Field problems/day7/part2/HandType.ONE_PAIR:Lproblems/day7/part2/HandType;
     699: goto          705
     702: getstatic     #396                // Field problems/day7/part2/HandType.HIGH_CARD:Lproblems/day7/part2/HandType;
     705: areturn

  private static final problems.day7.part2.Card toCard(char);
    Code:
       0: iload_0
       1: lookupswitch  { // 13
                    50: 122
                    51: 128
                    52: 134
                    53: 140
                    54: 146
                    55: 152
                    56: 158
                    57: 164
                    65: 188
                    74: 116
                    75: 182
                    81: 176
                    84: 170
               default: 194
          }
     116: getstatic     #313                // Field problems/day7/part2/Card.JOKER:Lproblems/day7/part2/Card;
     119: goto          228
     122: getstatic     #409                // Field problems/day7/part2/Card.TWO:Lproblems/day7/part2/Card;
     125: goto          228
     128: getstatic     #412                // Field problems/day7/part2/Card.THREE:Lproblems/day7/part2/Card;
     131: goto          228
     134: getstatic     #415                // Field problems/day7/part2/Card.FOUR:Lproblems/day7/part2/Card;
     137: goto          228
     140: getstatic     #418                // Field problems/day7/part2/Card.FIVE:Lproblems/day7/part2/Card;
     143: goto          228
     146: getstatic     #421                // Field problems/day7/part2/Card.SIX:Lproblems/day7/part2/Card;
     149: goto          228
     152: getstatic     #424                // Field problems/day7/part2/Card.SEVEN:Lproblems/day7/part2/Card;
     155: goto          228
     158: getstatic     #427                // Field problems/day7/part2/Card.EIGHT:Lproblems/day7/part2/Card;
     161: goto          228
     164: getstatic     #430                // Field problems/day7/part2/Card.NINE:Lproblems/day7/part2/Card;
     167: goto          228
     170: getstatic     #433                // Field problems/day7/part2/Card.TEN:Lproblems/day7/part2/Card;
     173: goto          228
     176: getstatic     #436                // Field problems/day7/part2/Card.QUEEN:Lproblems/day7/part2/Card;
     179: goto          228
     182: getstatic     #439                // Field problems/day7/part2/Card.KING:Lproblems/day7/part2/Card;
     185: goto          228
     188: getstatic     #442                // Field problems/day7/part2/Card.ACE:Lproblems/day7/part2/Card;
     191: goto          228
     194: new           #444                // class java/lang/IllegalArgumentException
     197: dup
     198: new           #61                 // class java/lang/StringBuilder
     201: dup
     202: invokespecial #63                 // Method java/lang/StringBuilder."<init>":()V
     205: ldc_w         #446                // String Char
     208: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     211: iload_0
     212: invokevirtual #449                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     215: ldc_w         #451                // String  does not have a corresponding card
     218: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     221: invokevirtual #76                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     224: invokespecial #452                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     227: athrow
     228: areturn

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

  private static final problems.day7.part2.Hand sumScores$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #459                // String it
       4: invokestatic  #463                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokestatic  #465                // Method toHand:(Ljava/lang/String;)Lproblems/day7/part2/Hand;
      11: areturn

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


package problems.day7.part1

import java.io.File

private const val inputFile = "input/day7/input.txt"
//private const val testFile = "input/day7/test.txt"

fun main() {
    val scoreSum = File(inputFile).bufferedReader().useLines { sumScores(it) }
    println("Sum of scores is $scoreSum")
}

private fun sumScores(lines: Sequence<String>): Int {
    return lines.map { it.toHand() }
        .sorted()
        .foldIndexed(0) { index, acc, hand -> acc + ((index + 1) * hand.bid) }
}

private data class Hand(val cards: List<Card>, val bid: Int, val handType: HandType) : Comparable<Hand> {
    override fun compareTo(other: Hand): Int {
        if (this.handType == other.handType) {
            return this.cards.compareTo(other.cards)
        }

        return this.handType.compareTo(other.handType)
    }
}

private fun List<Card>.compareTo(other: List<Card>): Int {
    for (pair in this.asSequence().zip(other.asSequence())) {
        if (pair.first != pair.second) {
            return pair.first.compareTo(pair.second)
        }
    }

    return 0
}

private fun String.toHand(): Hand {
    val cards = this.substringBefore(" ").map { it.toCard() }
    val bid = this.substringAfter(" ").toInt()
    val handType = cards.toHandType()
    return Hand(cards, bid, handType)
}

private enum class HandType {
    HIGH_CARD,
    ONE_PAIR,
    TWO_PAIR,
    THREE_OF_A_KIND,
    FULL_HOUSE,
    FOUR_OF_A_KIND,
    FIVE_OF_A_KIND,
}

private fun List<Card>.toHandType(): HandType {
    val typeHistogram = mutableMapOf<Card, UInt>()
    for (card in this) {
        typeHistogram[card] = typeHistogram.getOrDefault(card, 0u) + 1u
    }
    return when {
        typeHistogram.any { it.value == 5u } -> HandType.FIVE_OF_A_KIND
        typeHistogram.any { it.value == 4u } -> HandType.FOUR_OF_A_KIND
        typeHistogram.any { it.value == 3u } and typeHistogram.any { it.value == 2u } -> HandType.FULL_HOUSE
        typeHistogram.any { it.value == 3u } -> HandType.THREE_OF_A_KIND
        typeHistogram.filter { it.value == 2u }.count() == 2 -> HandType.TWO_PAIR
        typeHistogram.any { it.value == 2u } -> HandType.ONE_PAIR
        else -> HandType.HIGH_CARD
    }
}

private enum class Card {
    TWO,
    THREE,
    FOUR,
    FIVE,
    SIX,
    SEVEN,
    EIGHT,
    NINE,
    TEN,
    JACK,
    QUEEN,
    KING,
    ACE,
}

private fun Char.toCard() = when (this) {
    '2' -> Card.TWO
    '3' -> Card.THREE
    '4' -> Card.FOUR
    '5' -> Card.FIVE
    '6' -> Card.SIX
    '7' -> Card.SEVEN
    '8' -> Card.EIGHT
    '9' -> Card.NINE
    'T' -> Card.TEN
    'J' -> Card.JACK
    'Q' -> Card.QUEEN
    'K' -> Card.KING
    'A' -> Card.ACE
    else -> throw IllegalArgumentException("Char $this does not have a corresponding card")
}

Compiled from "part1.kt"
public final class problems.day7.part1.Part1Kt {
  private static final java.lang.String inputFile;

  public static final void main();
    Code:
       0: new           #10                 // class java/io/File
       3: dup
       4: ldc           #12                 // String input/day7/input.txt
       6: invokespecial #16                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_1
      10: getstatic     #22                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      13: astore_2
      14: sipush        8192
      17: istore_3
      18: aload_1
      19: astore        4
      21: new           #24                 // class java/io/InputStreamReader
      24: dup
      25: new           #26                 // class java/io/FileInputStream
      28: dup
      29: aload         4
      31: invokespecial #29                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      34: checkcast     #31                 // class java/io/InputStream
      37: aload_2
      38: invokespecial #34                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      41: checkcast     #36                 // class java/io/Reader
      44: astore        4
      46: aload         4
      48: instanceof    #38                 // class java/io/BufferedReader
      51: ifeq          62
      54: aload         4
      56: checkcast     #38                 // class java/io/BufferedReader
      59: goto          72
      62: new           #38                 // class java/io/BufferedReader
      65: dup
      66: aload         4
      68: iload_3
      69: invokespecial #41                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      72: checkcast     #36                 // class java/io/Reader
      75: astore_1
      76: nop
      77: iconst_0
      78: istore_2
      79: aload_1
      80: astore_3
      81: sipush        8192
      84: istore        4
      86: aload_3
      87: instanceof    #38                 // class java/io/BufferedReader
      90: ifeq          100
      93: aload_3
      94: checkcast     #38                 // class java/io/BufferedReader
      97: goto          110
     100: new           #38                 // class java/io/BufferedReader
     103: dup
     104: aload_3
     105: iload         4
     107: invokespecial #41                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
     110: checkcast     #43                 // class java/io/Closeable
     113: astore_3
     114: aconst_null
     115: astore        4
     117: nop
     118: aload_3
     119: checkcast     #38                 // class java/io/BufferedReader
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokestatic  #49                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     132: astore        7
     134: iconst_0
     135: istore        8
     137: aload         7
     139: invokestatic  #53                 // Method sumScores:(Lkotlin/sequences/Sequence;)I
     142: istore        5
     144: aload_3
     145: aload         4
     147: invokestatic  #59                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     150: iload         5
     152: goto          175
     155: astore        6
     157: aload         6
     159: astore        4
     161: aload         6
     163: athrow
     164: astore        6
     166: aload_3
     167: aload         4
     169: invokestatic  #59                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     172: aload         6
     174: athrow
     175: nop
     176: istore_0
     177: new           #61                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #63                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc           #65                 // String Sum of scores is
     186: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: iload_0
     190: invokevirtual #72                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     193: invokevirtual #76                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     196: getstatic     #82                 // Field java/lang/System.out:Ljava/io/PrintStream;
     199: swap
     200: invokevirtual #88                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     203: return
    Exception table:
       from    to  target type
         117   144   155   Class java/lang/Throwable
         117   144   164   any
         155   164   164   any
         164   166   164   any

  private static final int sumScores(kotlin.sequences.Sequence<java.lang.String>);
    Code:
       0: aload_0
       1: invokedynamic #123,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
       6: invokestatic  #129                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
       9: invokestatic  #133                // Method kotlin/sequences/SequencesKt.sorted:(Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
      12: astore_1
      13: iconst_0
      14: istore_2
      15: iconst_0
      16: istore_3
      17: iconst_0
      18: istore        4
      20: iload_2
      21: istore        5
      23: aload_1
      24: invokeinterface #137,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      29: astore        6
      31: aload         6
      33: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      38: ifeq          101
      41: aload         6
      43: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      48: astore        7
      50: iload         4
      52: iinc          4, 1
      55: istore        8
      57: iload         8
      59: ifge          65
      62: invokestatic  #152                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      65: iload         8
      67: iload         5
      69: aload         7
      71: checkcast     #154                // class problems/day7/part1/Hand
      74: astore        9
      76: istore        10
      78: istore        11
      80: iconst_0
      81: istore        12
      83: iload         10
      85: iload         11
      87: iconst_1
      88: iadd
      89: aload         9
      91: invokevirtual #158                // Method problems/day7/part1/Hand.getBid:()I
      94: imul
      95: iadd
      96: istore        5
      98: goto          31
     101: iload         5
     103: ireturn

  private static final int compareTo(java.util.List<? extends problems.day7.part1.Card>, java.util.List<? extends problems.day7.part1.Card>);
    Code:
       0: aload_0
       1: checkcast     #176                // class java/lang/Iterable
       4: invokestatic  #180                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
       7: aload_1
       8: checkcast     #176                // class java/lang/Iterable
      11: invokestatic  #180                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      14: invokestatic  #184                // Method kotlin/sequences/SequencesKt.zip:(Lkotlin/sequences/Sequence;Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
      17: invokeinterface #137,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      22: astore_2
      23: aload_2
      24: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      29: ifeq          71
      32: aload_2
      33: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      38: checkcast     #186                // class kotlin/Pair
      41: astore_3
      42: aload_3
      43: invokevirtual #189                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      46: aload_3
      47: invokevirtual #192                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      50: if_acmpeq     23
      53: aload_3
      54: invokevirtual #189                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      57: checkcast     #194                // class problems/day7/part1/Card
      60: aload_3
      61: invokevirtual #192                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      64: checkcast     #196                // class java/lang/Enum
      67: invokevirtual #199                // Method problems/day7/part1/Card.compareTo:(Ljava/lang/Enum;)I
      70: ireturn
      71: iconst_0
      72: ireturn

  private static final problems.day7.part1.Hand toHand(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #207                // String
       3: aconst_null
       4: iconst_2
       5: aconst_null
       6: invokestatic  #213                // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
       9: checkcast     #215                // class java/lang/CharSequence
      12: astore_2
      13: iconst_0
      14: istore_3
      15: aload_2
      16: astore        4
      18: new           #217                // class java/util/ArrayList
      21: dup
      22: aload_2
      23: invokeinterface #220,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      28: invokespecial #223                // Method java/util/ArrayList."<init>":(I)V
      31: checkcast     #225                // class java/util/Collection
      34: astore        5
      36: iconst_0
      37: istore        6
      39: iconst_0
      40: istore        7
      42: iload         7
      44: aload         4
      46: invokeinterface #220,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      51: if_icmpge     96
      54: aload         4
      56: iload         7
      58: invokeinterface #229,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      63: istore        8
      65: aload         5
      67: iload         8
      69: istore        9
      71: astore        11
      73: iconst_0
      74: istore        10
      76: iload         9
      78: invokestatic  #233                // Method toCard:(C)Lproblems/day7/part1/Card;
      81: aload         11
      83: swap
      84: invokeinterface #237,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      89: pop
      90: iinc          7, 1
      93: goto          42
      96: aload         5
      98: checkcast     #239                // class java/util/List
     101: nop
     102: astore_1
     103: aload_0
     104: ldc           #207                // String
     106: aconst_null
     107: iconst_2
     108: aconst_null
     109: invokestatic  #242                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     112: invokestatic  #248                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     115: istore_2
     116: aload_1
     117: invokestatic  #252                // Method toHandType:(Ljava/util/List;)Lproblems/day7/part1/HandType;
     120: astore_3
     121: new           #154                // class problems/day7/part1/Hand
     124: dup
     125: aload_1
     126: iload_2
     127: aload_3
     128: invokespecial #255                // Method problems/day7/part1/Hand."<init>":(Ljava/util/List;ILproblems/day7/part1/HandType;)V
     131: areturn

  private static final problems.day7.part1.HandType toHandType(java.util.List<? extends problems.day7.part1.Card>);
    Code:
       0: new           #276                // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #277                // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #279                // class java/util/Map
      10: astore_1
      11: aload_0
      12: invokeinterface #280,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      17: astore_2
      18: aload_2
      19: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifeq          74
      27: aload_2
      28: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      33: checkcast     #194                // class problems/day7/part1/Card
      36: astore_3
      37: nop
      38: aload_1
      39: aload_3
      40: aload_1
      41: aload_3
      42: iconst_0
      43: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
      46: invokeinterface #290,  3          // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      51: checkcast     #282                // class kotlin/UInt
      54: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
      57: iconst_1
      58: iadd
      59: invokestatic  #297                // Method kotlin/UInt."constructor-impl":(I)I
      62: invokestatic  #286                // Method kotlin/UInt."box-impl":(I)Lkotlin/UInt;
      65: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      70: pop
      71: goto          18
      74: nop
      75: aload_1
      76: astore_2
      77: iconst_0
      78: istore_3
      79: aload_2
      80: invokeinterface #303,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
      85: ifeq          92
      88: iconst_0
      89: goto          164
      92: aload_2
      93: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      98: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     103: astore        4
     105: aload         4
     107: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     112: ifeq          163
     115: aload         4
     117: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     122: checkcast     #312                // class java/util/Map$Entry
     125: astore        5
     127: aload         5
     129: astore        6
     131: iconst_0
     132: istore        7
     134: aload         6
     136: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     141: checkcast     #282                // class kotlin/UInt
     144: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     147: iconst_5
     148: if_icmpne     155
     151: iconst_1
     152: goto          156
     155: iconst_0
     156: ifeq          105
     159: iconst_1
     160: goto          164
     163: iconst_0
     164: ifeq          173
     167: getstatic     #320                // Field problems/day7/part1/HandType.FIVE_OF_A_KIND:Lproblems/day7/part1/HandType;
     170: goto          799
     173: aload_1
     174: astore_2
     175: iconst_0
     176: istore_3
     177: aload_2
     178: invokeinterface #303,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     183: ifeq          190
     186: iconst_0
     187: goto          262
     190: aload_2
     191: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     196: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     201: astore        4
     203: aload         4
     205: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     210: ifeq          261
     213: aload         4
     215: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     220: checkcast     #312                // class java/util/Map$Entry
     223: astore        5
     225: aload         5
     227: astore        6
     229: iconst_0
     230: istore        7
     232: aload         6
     234: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     239: checkcast     #282                // class kotlin/UInt
     242: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     245: iconst_4
     246: if_icmpne     253
     249: iconst_1
     250: goto          254
     253: iconst_0
     254: ifeq          203
     257: iconst_1
     258: goto          262
     261: iconst_0
     262: ifeq          271
     265: getstatic     #323                // Field problems/day7/part1/HandType.FOUR_OF_A_KIND:Lproblems/day7/part1/HandType;
     268: goto          799
     271: aload_1
     272: astore_2
     273: iconst_0
     274: istore_3
     275: aload_2
     276: invokeinterface #303,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     281: ifeq          288
     284: iconst_0
     285: goto          360
     288: aload_2
     289: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     294: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     299: astore        4
     301: aload         4
     303: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     308: ifeq          359
     311: aload         4
     313: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     318: checkcast     #312                // class java/util/Map$Entry
     321: astore        5
     323: aload         5
     325: astore        6
     327: iconst_0
     328: istore        7
     330: aload         6
     332: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     337: checkcast     #282                // class kotlin/UInt
     340: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     343: iconst_3
     344: if_icmpne     351
     347: iconst_1
     348: goto          352
     351: iconst_0
     352: ifeq          301
     355: iconst_1
     356: goto          360
     359: iconst_0
     360: aload_1
     361: astore_2
     362: istore        11
     364: iconst_0
     365: istore_3
     366: aload_2
     367: invokeinterface #303,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     372: ifeq          379
     375: iconst_0
     376: goto          451
     379: aload_2
     380: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     385: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     390: astore        4
     392: aload         4
     394: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     399: ifeq          450
     402: aload         4
     404: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     409: checkcast     #312                // class java/util/Map$Entry
     412: astore        5
     414: aload         5
     416: astore        6
     418: iconst_0
     419: istore        7
     421: aload         6
     423: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     428: checkcast     #282                // class kotlin/UInt
     431: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     434: iconst_2
     435: if_icmpne     442
     438: iconst_1
     439: goto          443
     442: iconst_0
     443: ifeq          392
     446: iconst_1
     447: goto          451
     450: iconst_0
     451: istore        12
     453: iload         11
     455: iload         12
     457: iand
     458: ifeq          467
     461: getstatic     #326                // Field problems/day7/part1/HandType.FULL_HOUSE:Lproblems/day7/part1/HandType;
     464: goto          799
     467: aload_1
     468: astore_2
     469: iconst_0
     470: istore_3
     471: aload_2
     472: invokeinterface #303,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     477: ifeq          484
     480: iconst_0
     481: goto          556
     484: aload_2
     485: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     490: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     495: astore        4
     497: aload         4
     499: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     504: ifeq          555
     507: aload         4
     509: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     514: checkcast     #312                // class java/util/Map$Entry
     517: astore        5
     519: aload         5
     521: astore        6
     523: iconst_0
     524: istore        7
     526: aload         6
     528: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     533: checkcast     #282                // class kotlin/UInt
     536: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     539: iconst_3
     540: if_icmpne     547
     543: iconst_1
     544: goto          548
     547: iconst_0
     548: ifeq          497
     551: iconst_1
     552: goto          556
     555: iconst_0
     556: ifeq          565
     559: getstatic     #329                // Field problems/day7/part1/HandType.THREE_OF_A_KIND:Lproblems/day7/part1/HandType;
     562: goto          799
     565: aload_1
     566: astore_2
     567: iconst_0
     568: istore_3
     569: aload_2
     570: astore        4
     572: new           #276                // class java/util/LinkedHashMap
     575: dup
     576: invokespecial #277                // Method java/util/LinkedHashMap."<init>":()V
     579: checkcast     #279                // class java/util/Map
     582: astore        5
     584: iconst_0
     585: istore        6
     587: aload         4
     589: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     594: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     599: astore        7
     601: aload         7
     603: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     608: ifeq          680
     611: aload         7
     613: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     618: checkcast     #312                // class java/util/Map$Entry
     621: astore        8
     623: aload         8
     625: astore        9
     627: iconst_0
     628: istore        10
     630: aload         9
     632: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     637: checkcast     #282                // class kotlin/UInt
     640: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     643: iconst_2
     644: if_icmpne     651
     647: iconst_1
     648: goto          652
     651: iconst_0
     652: ifeq          601
     655: aload         5
     657: aload         8
     659: invokeinterface #332,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     664: aload         8
     666: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     671: invokeinterface #300,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     676: pop
     677: goto          601
     680: aload         5
     682: nop
     683: invokeinterface #335,  1          // InterfaceMethod java/util/Map.size:()I
     688: iconst_2
     689: if_icmpne     698
     692: getstatic     #338                // Field problems/day7/part1/HandType.TWO_PAIR:Lproblems/day7/part1/HandType;
     695: goto          799
     698: aload_1
     699: astore_2
     700: iconst_0
     701: istore_3
     702: aload_2
     703: invokeinterface #303,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     708: ifeq          715
     711: iconst_0
     712: goto          787
     715: aload_2
     716: invokeinterface #307,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     721: invokeinterface #310,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     726: astore        4
     728: aload         4
     730: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     735: ifeq          786
     738: aload         4
     740: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     745: checkcast     #312                // class java/util/Map$Entry
     748: astore        5
     750: aload         5
     752: astore        6
     754: iconst_0
     755: istore        7
     757: aload         6
     759: invokeinterface #315,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     764: checkcast     #282                // class kotlin/UInt
     767: invokevirtual #293                // Method kotlin/UInt."unbox-impl":()I
     770: iconst_2
     771: if_icmpne     778
     774: iconst_1
     775: goto          779
     778: iconst_0
     779: ifeq          728
     782: iconst_1
     783: goto          787
     786: iconst_0
     787: ifeq          796
     790: getstatic     #341                // Field problems/day7/part1/HandType.ONE_PAIR:Lproblems/day7/part1/HandType;
     793: goto          799
     796: getstatic     #344                // Field problems/day7/part1/HandType.HIGH_CARD:Lproblems/day7/part1/HandType;
     799: areturn

  private static final problems.day7.part1.Card toCard(char);
    Code:
       0: iload_0
       1: lookupswitch  { // 13
                    50: 116
                    51: 122
                    52: 128
                    53: 134
                    54: 140
                    55: 146
                    56: 152
                    57: 158
                    65: 188
                    74: 170
                    75: 182
                    81: 176
                    84: 164
               default: 194
          }
     116: getstatic     #367                // Field problems/day7/part1/Card.TWO:Lproblems/day7/part1/Card;
     119: goto          228
     122: getstatic     #370                // Field problems/day7/part1/Card.THREE:Lproblems/day7/part1/Card;
     125: goto          228
     128: getstatic     #373                // Field problems/day7/part1/Card.FOUR:Lproblems/day7/part1/Card;
     131: goto          228
     134: getstatic     #376                // Field problems/day7/part1/Card.FIVE:Lproblems/day7/part1/Card;
     137: goto          228
     140: getstatic     #379                // Field problems/day7/part1/Card.SIX:Lproblems/day7/part1/Card;
     143: goto          228
     146: getstatic     #382                // Field problems/day7/part1/Card.SEVEN:Lproblems/day7/part1/Card;
     149: goto          228
     152: getstatic     #385                // Field problems/day7/part1/Card.EIGHT:Lproblems/day7/part1/Card;
     155: goto          228
     158: getstatic     #388                // Field problems/day7/part1/Card.NINE:Lproblems/day7/part1/Card;
     161: goto          228
     164: getstatic     #391                // Field problems/day7/part1/Card.TEN:Lproblems/day7/part1/Card;
     167: goto          228
     170: getstatic     #394                // Field problems/day7/part1/Card.JACK:Lproblems/day7/part1/Card;
     173: goto          228
     176: getstatic     #397                // Field problems/day7/part1/Card.QUEEN:Lproblems/day7/part1/Card;
     179: goto          228
     182: getstatic     #400                // Field problems/day7/part1/Card.KING:Lproblems/day7/part1/Card;
     185: goto          228
     188: getstatic     #403                // Field problems/day7/part1/Card.ACE:Lproblems/day7/part1/Card;
     191: goto          228
     194: new           #405                // class java/lang/IllegalArgumentException
     197: dup
     198: new           #61                 // class java/lang/StringBuilder
     201: dup
     202: invokespecial #63                 // Method java/lang/StringBuilder."<init>":()V
     205: ldc_w         #407                // String Char
     208: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     211: iload_0
     212: invokevirtual #410                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     215: ldc_w         #412                // String  does not have a corresponding card
     218: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     221: invokevirtual #76                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     224: invokespecial #413                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     227: athrow
     228: areturn

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

  private static final problems.day7.part1.Hand sumScores$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #420                // String it
       4: invokestatic  #426                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokestatic  #428                // Method toHand:(Ljava/lang/String;)Lproblems/day7/part1/Hand;
      11: areturn

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