/**
 * P23-Non-Abundant Sums
 *
 * A perfect number is a number for which the sum of its proper divisors is exactly equal to the number.
 * For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28,
 * which means that 28 is a perfect number.
 *
 * A number n is called deficient if the sum of its proper divisors is less than n
 * and it is called abundant if this sum exceeds n.
 *
 * As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16,
 * the smallest number that can be written as the sum of two abundant numbers is 24.
 * By mathematical analysis, it can be shown that all integers greater than 28123
 * can be written as the sum of two abundant numbers.
 * However, this upper limit cannot be reduced any further by analysis
 * even though it is known that the greatest number that cannot be expressed as the sum of
 * two abundant numbers is less than this limit.
 *
 * Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.
 */
fun p23() {
    val upperLimit = 28123; val minAbundant = 12; var sumOfDivisors = 1
    val abundantList = mutableListOf<Int>()
    val nonAbundantSum = (1 until upperLimit).toMutableList()

    for (x in minAbundant until upperLimit) {
        for (j in 2 until x) if (x % j == 0) sumOfDivisors += j
        if (sumOfDivisors > x) abundantList.add(x)
        sumOfDivisors = 1
    }

    for (x in 1 until upperLimit)
        for (abundant in abundantList) {
            if (x - abundant >= minAbundant)
                if (abundantList.contains(x - abundant)) {
                    nonAbundantSum.remove(x)
                    break
                } else break
        }

    println("A23: ${nonAbundantSum.sum()}")
}

Compiled from "P023_NonAbundantSums.kt"
public final class P023_NonAbundantSumsKt {
  public static final void p23();
    Code:
       0: sipush        28123
       3: istore_0
       4: bipush        12
       6: istore_1
       7: iconst_1
       8: istore_2
       9: new           #8                  // class java/util/ArrayList
      12: dup
      13: invokespecial #11                 // Method java/util/ArrayList."<init>":()V
      16: checkcast     #13                 // class java/util/List
      19: astore_3
      20: iconst_1
      21: iload_0
      22: invokestatic  #19                 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      25: checkcast     #21                 // class java/lang/Iterable
      28: invokestatic  #27                 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/lang/Iterable;)Ljava/util/List;
      31: astore        4
      33: iload_1
      34: istore        5
      36: iload         5
      38: iload_0
      39: if_icmpge     97
      42: iconst_2
      43: istore        6
      45: iload         6
      47: iload         5
      49: if_icmpge     71
      52: iload         5
      54: iload         6
      56: irem
      57: ifne          65
      60: iload_2
      61: iload         6
      63: iadd
      64: istore_2
      65: iinc          6, 1
      68: goto          45
      71: iload_2
      72: iload         5
      74: if_icmple     89
      77: aload_3
      78: iload         5
      80: invokestatic  #33                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      83: invokeinterface #37,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      88: pop
      89: iconst_1
      90: istore_2
      91: iinc          5, 1
      94: goto          36
      97: iconst_1
      98: istore        5
     100: iload         5
     102: iload_0
     103: if_icmpge     190
     106: aload_3
     107: invokeinterface #41,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     112: astore        6
     114: aload         6
     116: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     121: ifeq          184
     124: aload         6
     126: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     131: checkcast     #53                 // class java/lang/Number
     134: invokevirtual #57                 // Method java/lang/Number.intValue:()I
     137: istore        7
     139: iload         5
     141: iload         7
     143: isub
     144: iload_1
     145: if_icmplt     114
     148: aload_3
     149: iload         5
     151: iload         7
     153: isub
     154: invokestatic  #33                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     157: invokeinterface #60,  2           // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     162: ifeq          181
     165: aload         4
     167: iload         5
     169: invokestatic  #33                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     172: invokeinterface #63,  2           // InterfaceMethod java/util/List.remove:(Ljava/lang/Object;)Z
     177: pop
     178: goto          184
     181: goto          184
     184: iinc          5, 1
     187: goto          100
     190: new           #65                 // class java/lang/StringBuilder
     193: dup
     194: invokespecial #66                 // Method java/lang/StringBuilder."<init>":()V
     197: ldc           #68                 // String A23:
     199: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     202: aload         4
     204: checkcast     #21                 // class java/lang/Iterable
     207: invokestatic  #76                 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     210: invokevirtual #79                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     213: invokevirtual #83                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     216: getstatic     #89                 // Field java/lang/System.out:Ljava/io/PrintStream;
     219: swap
     220: invokevirtual #95                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     223: return
}


class Day11 {
    fun part1(serialNumber: Int) : Pair<Int, Int> {
        val powerGrid = Array(300) { x ->
            Array(300) { y ->
                getPowerLevel(x+1, y+1, serialNumber)
            }
        }
        return findLargestSquare(powerGrid, 3).key
    }

    private fun findLargestSquare(powerGrid: Array<Array<Int>>, gridSize: Int): Map.Entry<Pair<Int, Int>, Int> {
        val squareMap = mutableMapOf<Pair<Int, Int>, Int>()
        for (x in 0..(300-gridSize)) {
            for (y in 0..(300-gridSize)) {
                var squareSum = 0
                for (rx in 0..(gridSize-1)) {
                    for (ry in 0..(gridSize-1)) {
                        squareSum += powerGrid[x + rx][y + ry]
                    }
                }
                squareMap[Pair(x + 1, y + 1)] = squareSum
            }
        }
        return squareMap.maxBy { it.value }!!
    }

    fun part2(serialNumber: Int) : Triple<Int, Int, Int> {
        val powerGrid = Array(300) { x ->
            Array(300) { y ->
                getPowerLevel(x+1, y+1, serialNumber)
            }
        }
        val tripleMap = mutableMapOf<Triple<Int, Int, Int>, Int>()
        for (size in 1..300) {
            val largeSquare = findLargestSquare(powerGrid, size)
            tripleMap[Triple(largeSquare.key.first, largeSquare.key.second, size)] = largeSquare.value
        }
        return tripleMap.maxBy { it.value }!!.key
    }

    fun getPowerLevel(x: Int, y: Int, serialNumber: Int): Int {
        val rackId = x + 10
        var powerLevel = rackId * y
        powerLevel += serialNumber
        powerLevel *= rackId
        powerLevel = (powerLevel / 100) % 10
        return powerLevel - 5
    }
}

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

  public final kotlin.Pair<java.lang.Integer, java.lang.Integer> part1(int);
    Code:
       0: iconst_0
       1: istore_3
       2: sipush        300
       5: anewarray     #16                 // class "[Ljava/lang/Integer;"
       8: astore        4
      10: iload_3
      11: sipush        300
      14: if_icmpge     91
      17: iload_3
      18: istore        5
      20: aload         4
      22: iload         5
      24: iconst_0
      25: istore        6
      27: sipush        300
      30: anewarray     #18                 // class java/lang/Integer
      33: astore        7
      35: istore        10
      37: astore        9
      39: iload         6
      41: sipush        300
      44: if_icmpge     78
      47: iload         6
      49: istore        8
      51: aload         7
      53: iload         8
      55: aload_0
      56: iload         5
      58: iconst_1
      59: iadd
      60: iload         8
      62: iconst_1
      63: iadd
      64: iload_1
      65: invokevirtual #22                 // Method getPowerLevel:(III)I
      68: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      71: aastore
      72: iinc          6, 1
      75: goto          39
      78: aload         9
      80: iload         10
      82: aload         7
      84: aastore
      85: iinc          3, 1
      88: goto          10
      91: aload         4
      93: astore_2
      94: aload_0
      95: aload_2
      96: iconst_3
      97: invokespecial #30                 // Method findLargestSquare:([[Ljava/lang/Integer;I)Ljava/util/Map$Entry;
     100: invokeinterface #36,  1           // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     105: checkcast     #38                 // class kotlin/Pair
     108: areturn

  private final java.util.Map$Entry<kotlin.Pair<java.lang.Integer, java.lang.Integer>, java.lang.Integer> findLargestSquare(java.lang.Integer[][], int);
    Code:
       0: new           #46                 // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #47                 // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #49                 // class java/util/Map
      10: astore_3
      11: iconst_0
      12: istore        4
      14: sipush        300
      17: iload_2
      18: isub
      19: istore        5
      21: iload         4
      23: iload         5
      25: if_icmpgt     188
      28: iconst_0
      29: istore        6
      31: sipush        300
      34: iload_2
      35: isub
      36: istore        7
      38: iload         6
      40: iload         7
      42: if_icmpgt     175
      45: iconst_0
      46: istore        8
      48: iconst_0
      49: istore        9
      51: iload_2
      52: iconst_1
      53: isub
      54: istore        10
      56: iload         9
      58: iload         10
      60: if_icmpgt     125
      63: iconst_0
      64: istore        11
      66: iload_2
      67: iconst_1
      68: isub
      69: istore        12
      71: iload         11
      73: iload         12
      75: if_icmpgt     112
      78: iload         8
      80: aload_1
      81: iload         4
      83: iload         9
      85: iadd
      86: aaload
      87: iload         6
      89: iload         11
      91: iadd
      92: aaload
      93: invokevirtual #53                 // Method java/lang/Integer.intValue:()I
      96: iadd
      97: istore        8
      99: iload         11
     101: iload         12
     103: if_icmpeq     112
     106: iinc          11, 1
     109: goto          78
     112: iload         9
     114: iload         10
     116: if_icmpeq     125
     119: iinc          9, 1
     122: goto          63
     125: iload         8
     127: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     130: astore        11
     132: aload_3
     133: new           #38                 // class kotlin/Pair
     136: dup
     137: iload         4
     139: iconst_1
     140: iadd
     141: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     144: iload         6
     146: iconst_1
     147: iadd
     148: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     151: invokespecial #56                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     154: aload         11
     156: invokeinterface #60,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     161: pop
     162: iload         6
     164: iload         7
     166: if_icmpeq     175
     169: iinc          6, 1
     172: goto          45
     175: iload         4
     177: iload         5
     179: if_icmpeq     188
     182: iinc          4, 1
     185: goto          28
     188: aload_3
     189: invokeinterface #64,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     194: checkcast     #66                 // class java/lang/Iterable
     197: astore        5
     199: aload         5
     201: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     206: astore        6
     208: aload         6
     210: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     215: ifne          226
     218: new           #78                 // class java/util/NoSuchElementException
     221: dup
     222: invokespecial #79                 // Method java/util/NoSuchElementException."<init>":()V
     225: athrow
     226: aload         6
     228: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     233: astore        7
     235: aload         6
     237: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     242: ifne          250
     245: aload         7
     247: goto          336
     250: aload         7
     252: checkcast     #32                 // class java/util/Map$Entry
     255: astore        8
     257: iconst_0
     258: istore        9
     260: aload         8
     262: invokeinterface #85,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     267: checkcast     #87                 // class java/lang/Number
     270: invokevirtual #88                 // Method java/lang/Number.intValue:()I
     273: istore        8
     275: aload         6
     277: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     282: astore        9
     284: aload         9
     286: checkcast     #32                 // class java/util/Map$Entry
     289: astore        10
     291: iconst_0
     292: istore        11
     294: aload         10
     296: invokeinterface #85,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     301: checkcast     #87                 // class java/lang/Number
     304: invokevirtual #88                 // Method java/lang/Number.intValue:()I
     307: istore        10
     309: iload         8
     311: iload         10
     313: if_icmpge     324
     316: aload         9
     318: astore        7
     320: iload         10
     322: istore        8
     324: aload         6
     326: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     331: ifne          275
     334: aload         7
     336: checkcast     #32                 // class java/util/Map$Entry
     339: dup
     340: invokestatic  #94                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     343: areturn

  public final kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer> part2(int);
    Code:
       0: iconst_0
       1: istore_3
       2: sipush        300
       5: anewarray     #16                 // class "[Ljava/lang/Integer;"
       8: astore        4
      10: iload_3
      11: sipush        300
      14: if_icmpge     91
      17: iload_3
      18: istore        5
      20: aload         4
      22: iload         5
      24: iconst_0
      25: istore        6
      27: sipush        300
      30: anewarray     #18                 // class java/lang/Integer
      33: astore        7
      35: istore        13
      37: astore        12
      39: iload         6
      41: sipush        300
      44: if_icmpge     78
      47: iload         6
      49: istore        8
      51: aload         7
      53: iload         8
      55: aload_0
      56: iload         5
      58: iconst_1
      59: iadd
      60: iload         8
      62: iconst_1
      63: iadd
      64: iload_1
      65: invokevirtual #22                 // Method getPowerLevel:(III)I
      68: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      71: aastore
      72: iinc          6, 1
      75: goto          39
      78: aload         12
      80: iload         13
      82: aload         7
      84: aastore
      85: iinc          3, 1
      88: goto          10
      91: aload         4
      93: astore_2
      94: new           #46                 // class java/util/LinkedHashMap
      97: dup
      98: invokespecial #47                 // Method java/util/LinkedHashMap."<init>":()V
     101: checkcast     #49                 // class java/util/Map
     104: astore_3
     105: iconst_1
     106: istore        4
     108: iload         4
     110: sipush        301
     113: if_icmpge     183
     116: aload_0
     117: aload_2
     118: iload         4
     120: invokespecial #30                 // Method findLargestSquare:([[Ljava/lang/Integer;I)Ljava/util/Map$Entry;
     123: astore        5
     125: aload_3
     126: new           #110                // class kotlin/Triple
     129: dup
     130: aload         5
     132: invokeinterface #36,  1           // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     137: checkcast     #38                 // class kotlin/Pair
     140: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     143: aload         5
     145: invokeinterface #36,  1           // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     150: checkcast     #38                 // class kotlin/Pair
     153: invokevirtual #116                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     156: iload         4
     158: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     161: invokespecial #119                // Method kotlin/Triple."<init>":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
     164: aload         5
     166: invokeinterface #85,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     171: invokeinterface #60,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     176: pop
     177: iinc          4, 1
     180: goto          108
     183: aload_3
     184: invokeinterface #64,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     189: checkcast     #66                 // class java/lang/Iterable
     192: astore        5
     194: aload         5
     196: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     201: astore        6
     203: aload         6
     205: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     210: ifne          221
     213: new           #78                 // class java/util/NoSuchElementException
     216: dup
     217: invokespecial #79                 // Method java/util/NoSuchElementException."<init>":()V
     220: athrow
     221: aload         6
     223: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     228: astore        7
     230: aload         6
     232: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     237: ifne          245
     240: aload         7
     242: goto          331
     245: aload         7
     247: checkcast     #32                 // class java/util/Map$Entry
     250: astore        8
     252: iconst_0
     253: istore        9
     255: aload         8
     257: invokeinterface #85,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     262: checkcast     #87                 // class java/lang/Number
     265: invokevirtual #88                 // Method java/lang/Number.intValue:()I
     268: istore        8
     270: aload         6
     272: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     277: astore        9
     279: aload         9
     281: checkcast     #32                 // class java/util/Map$Entry
     284: astore        10
     286: iconst_0
     287: istore        11
     289: aload         10
     291: invokeinterface #85,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     296: checkcast     #87                 // class java/lang/Number
     299: invokevirtual #88                 // Method java/lang/Number.intValue:()I
     302: istore        10
     304: iload         8
     306: iload         10
     308: if_icmpge     319
     311: aload         9
     313: astore        7
     315: iload         10
     317: istore        8
     319: aload         6
     321: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     326: ifne          270
     329: aload         7
     331: checkcast     #32                 // class java/util/Map$Entry
     334: dup
     335: invokestatic  #94                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     338: invokeinterface #36,  1           // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     343: checkcast     #110                // class kotlin/Triple
     346: areturn

  public final int getPowerLevel(int, int, int);
    Code:
       0: iload_1
       1: bipush        10
       3: iadd
       4: istore        4
       6: iload         4
       8: iload_2
       9: imul
      10: istore        5
      12: iload         5
      14: iload_3
      15: iadd
      16: istore        5
      18: iload         5
      20: iload         4
      22: imul
      23: istore        5
      25: iload         5
      27: bipush        100
      29: idiv
      30: bipush        10
      32: irem
      33: istore        5
      35: iload         5
      37: iconst_5
      38: isub
      39: ireturn
}


import java.io.File

class Day12 {
    fun part1(lines: List<String>): Int {
        val puzzle = Puzzle(lines)
        val pots = puzzle.generate(20)
        return pots.asSequence().mapIndexed { index, char ->
            if (char == '#')
                index-(4*20)
            else
                0
        }.sum()
    }

    fun part2(lines: List<String>): Int {
        val puzzle = Puzzle(lines)
        val pots = puzzle.generate(10000)
        return pots.asSequence().mapIndexed { index, char ->
            if (char == '#')
                index-(4*10000)
            else
                0
        }.sum()
    }
}

class Puzzle(lines: List<String>) {
    val initialState = """^initial state: (.+)$""".toRegex().find(lines[0])!!.destructured.component1()
    val rules = (2 until lines.size).associate {
            val (pattern, plant) = """^(.+) => (.)$""".toRegex().find(lines[it])!!.destructured
            pattern to plant[0]
        }

    fun generate(iterations: Int): String {
        var state = initialState
        repeat(iterations) {
            state = "....$state...."
            val nextGeneration = ".".repeat(state.length).toCharArray()
            (2 until state.length-2).forEach {index ->
                nextGeneration[index] = rules.getOrDefault(state.slice(index-2..index+2), '.')
            }
            state = String(nextGeneration)
            println(state)
        }
        return state
    }
}

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

  public final int part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String lines
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #24                 // class Puzzle
       9: dup
      10: aload_1
      11: invokespecial #27                 // Method Puzzle."<init>":(Ljava/util/List;)V
      14: astore_2
      15: aload_2
      16: bipush        20
      18: invokevirtual #31                 // Method Puzzle.generate:(I)Ljava/lang/String;
      21: astore_3
      22: aload_3
      23: checkcast     #33                 // class java/lang/CharSequence
      26: invokestatic  #39                 // Method kotlin/text/StringsKt.asSequence:(Ljava/lang/CharSequence;)Lkotlin/sequences/Sequence;
      29: invokedynamic #59,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;
      34: invokestatic  #65                 // Method kotlin/sequences/SequencesKt.mapIndexed:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
      37: invokestatic  #69                 // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      40: ireturn

  public final int part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String lines
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #24                 // class Puzzle
       9: dup
      10: aload_1
      11: invokespecial #27                 // Method Puzzle."<init>":(Ljava/util/List;)V
      14: astore_2
      15: aload_2
      16: sipush        10000
      19: invokevirtual #31                 // Method Puzzle.generate:(I)Ljava/lang/String;
      22: astore_3
      23: aload_3
      24: checkcast     #33                 // class java/lang/CharSequence
      27: invokestatic  #39                 // Method kotlin/text/StringsKt.asSequence:(Ljava/lang/CharSequence;)Lkotlin/sequences/Sequence;
      30: invokedynamic #80,  0             // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function2;
      35: invokestatic  #65                 // Method kotlin/sequences/SequencesKt.mapIndexed:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
      38: invokestatic  #69                 // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      41: ireturn

  private static final int part1$lambda$0(int, char);
    Code:
       0: iload_1
       1: bipush        35
       3: if_icmpne     13
       6: iload_0
       7: bipush        80
       9: isub
      10: goto          14
      13: iconst_0
      14: ireturn

  private static final int part2$lambda$1(int, char);
    Code:
       0: iload_1
       1: bipush        35
       3: if_icmpne     13
       6: iload_0
       7: ldc           #85                 // int 40000
       9: isub
      10: goto          14
      13: iconst_0
      14: ireturn
}


class Day02 {
    fun solvePart1(rawValues : List<String>): Int {
        val (twos, threes) = rawValues.fold(Pair(0,0)) { sum, element ->
                val counts = element.asSequence().groupingBy { it }.eachCount()
                Pair(sum.first + if (counts.values.contains(2)) 1 else 0, sum.second + if(counts.values.contains(3)) 1 else 0)
        }
        return twos * threes
    }

    fun solvePart2(rawValues : List<String>): String {
        return rawValues.mapIndexed { i, outer ->
            rawValues.drop(i).mapNotNull {
                val diffIndexes = diffIndexes(outer, it)
                if (diffIndexes.first == 1) {
                    outer.removeRange(diffIndexes.second, diffIndexes.second+1)
                } else null
            }
        }
            .flatten()
            .first()
    }

    fun diffIndexes(a: String, b: String): Pair<Int, Int> {
        var index = 0
        val diff = a.mapIndexed { i, char ->
            if (char != b[i]) {
                index = i
                1
            } else 0
        }.sum()
        return Pair(diff, index)
    }
}

Compiled from "_Sequences.kt"
public final class Day02$solvePart1$lambda$1$$inlined$groupingBy$1 implements kotlin.collections.Grouping<java.lang.Character, java.lang.Character> {
  final kotlin.sequences.Sequence $this_groupingBy;

  public Day02$solvePart1$lambda$1$$inlined$groupingBy$1(kotlin.sequences.Sequence);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #18                 // Field $this_groupingBy:Lkotlin/sequences/Sequence;
       5: aload_0
       6: invokespecial #21                 // Method java/lang/Object."<init>":()V
       9: return

  public java.util.Iterator<java.lang.Character> sourceIterator();
    Code:
       0: aload_0
       1: getfield      #18                 // Field $this_groupingBy:Lkotlin/sequences/Sequence;
       4: invokeinterface #32,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
       9: areturn

  public java.lang.Character keyOf(java.lang.Character);
    Code:
       0: aload_1
       1: checkcast     #37                 // class java/lang/Character
       4: invokevirtual #41                 // Method java/lang/Character.charValue:()C
       7: istore_2
       8: iconst_0
       9: istore_3
      10: iload_2
      11: invokestatic  #45                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      14: areturn
}

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

  public final int solvePart1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String rawValues
       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_3
      11: new           #26                 // class kotlin/Pair
      14: dup
      15: iconst_0
      16: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      19: iconst_0
      20: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      23: invokespecial #35                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      26: astore        4
      28: iconst_0
      29: istore        5
      31: aload         4
      33: astore        6
      35: aload_3
      36: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        7
      43: aload         7
      45: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          196
      53: aload         7
      55: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        8
      62: aload         6
      64: aload         8
      66: checkcast     #51                 // class java/lang/String
      69: astore        9
      71: astore        10
      73: iconst_0
      74: istore        11
      76: aload         9
      78: checkcast     #53                 // class java/lang/CharSequence
      81: invokestatic  #59                 // Method kotlin/text/StringsKt.asSequence:(Ljava/lang/CharSequence;)Lkotlin/sequences/Sequence;
      84: astore        12
      86: iconst_0
      87: istore        13
      89: new           #61                 // class Day02$solvePart1$lambda$1$$inlined$groupingBy$1
      92: dup
      93: aload         12
      95: invokespecial #64                 // Method Day02$solvePart1$lambda$1$$inlined$groupingBy$1."<init>":(Lkotlin/sequences/Sequence;)V
      98: checkcast     #66                 // class kotlin/collections/Grouping
     101: invokestatic  #72                 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;
     104: astore        14
     106: new           #26                 // class kotlin/Pair
     109: dup
     110: aload         10
     112: invokevirtual #75                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     115: checkcast     #77                 // class java/lang/Number
     118: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     121: aload         14
     123: invokeinterface #87,  1           // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
     128: iconst_2
     129: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     132: invokeinterface #93,  2           // InterfaceMethod java/util/Collection.contains:(Ljava/lang/Object;)Z
     137: ifeq          144
     140: iconst_1
     141: goto          145
     144: iconst_0
     145: iadd
     146: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     149: aload         10
     151: invokevirtual #96                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     154: checkcast     #77                 // class java/lang/Number
     157: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     160: aload         14
     162: invokeinterface #87,  1           // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
     167: iconst_3
     168: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     171: invokeinterface #93,  2           // InterfaceMethod java/util/Collection.contains:(Ljava/lang/Object;)Z
     176: ifeq          183
     179: iconst_1
     180: goto          184
     183: iconst_0
     184: iadd
     185: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     188: invokespecial #35                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     191: astore        6
     193: goto          43
     196: aload         6
     198: astore_2
     199: aload_2
     200: invokevirtual #99                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
     203: checkcast     #77                 // class java/lang/Number
     206: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     209: istore_3
     210: aload_2
     211: invokevirtual #102                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     214: checkcast     #77                 // class java/lang/Number
     217: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     220: istore        4
     222: iload_3
     223: iload         4
     225: imul
     226: ireturn

  public final java.lang.String solvePart2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String rawValues
       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: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #132                // class java/util/ArrayList
      19: dup
      20: aload_2
      21: bipush        10
      23: invokestatic  #138                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      26: invokespecial #141                // Method java/util/ArrayList."<init>":(I)V
      29: checkcast     #89                 // class java/util/Collection
      32: astore        5
      34: iconst_0
      35: istore        6
      37: iconst_0
      38: istore        7
      40: aload         4
      42: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      47: astore        8
      49: aload         8
      51: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      56: ifeq          312
      59: aload         8
      61: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      66: astore        9
      68: aload         5
      70: iload         7
      72: iinc          7, 1
      75: istore        10
      77: iload         10
      79: ifge          85
      82: invokestatic  #144                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      85: iload         10
      87: aload         9
      89: checkcast     #51                 // class java/lang/String
      92: astore        11
      94: istore        12
      96: astore        33
      98: iconst_0
      99: istore        13
     101: aload_1
     102: checkcast     #24                 // class java/lang/Iterable
     105: iload         12
     107: invokestatic  #148                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     110: checkcast     #24                 // class java/lang/Iterable
     113: astore        14
     115: iconst_0
     116: istore        15
     118: aload         14
     120: astore        16
     122: new           #132                // class java/util/ArrayList
     125: dup
     126: invokespecial #149                // Method java/util/ArrayList."<init>":()V
     129: checkcast     #89                 // class java/util/Collection
     132: astore        17
     134: iconst_0
     135: istore        18
     137: aload         16
     139: astore        19
     141: iconst_0
     142: istore        20
     144: aload         19
     146: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     151: astore        21
     153: aload         21
     155: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     160: ifeq          292
     163: aload         21
     165: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     170: astore        22
     172: aload         22
     174: astore        23
     176: iconst_0
     177: istore        24
     179: aload         23
     181: checkcast     #51                 // class java/lang/String
     184: astore        25
     186: iconst_0
     187: istore        26
     189: aload_0
     190: aload         11
     192: aload         25
     194: invokevirtual #153                // Method diffIndexes:(Ljava/lang/String;Ljava/lang/String;)Lkotlin/Pair;
     197: astore        27
     199: aload         27
     201: invokevirtual #75                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     204: checkcast     #77                 // class java/lang/Number
     207: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     210: iconst_1
     211: if_icmpne     264
     214: aload         11
     216: astore        28
     218: aload         27
     220: invokevirtual #96                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     223: checkcast     #77                 // class java/lang/Number
     226: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     229: istore        29
     231: aload         27
     233: invokevirtual #96                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     236: checkcast     #77                 // class java/lang/Number
     239: invokevirtual #81                 // Method java/lang/Number.intValue:()I
     242: iconst_1
     243: iadd
     244: istore        30
     246: aload         28
     248: checkcast     #53                 // class java/lang/CharSequence
     251: iload         29
     253: iload         30
     255: invokestatic  #157                // Method kotlin/text/StringsKt.removeRange:(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;
     258: invokevirtual #161                // Method java/lang/Object.toString:()Ljava/lang/String;
     261: goto          265
     264: aconst_null
     265: dup
     266: ifnull        287
     269: astore        31
     271: iconst_0
     272: istore        32
     274: aload         17
     276: aload         31
     278: invokeinterface #164,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     283: pop
     284: goto          288
     287: pop
     288: nop
     289: goto          153
     292: nop
     293: aload         17
     295: checkcast     #125                // class java/util/List
     298: nop
     299: nop
     300: aload         33
     302: swap
     303: invokeinterface #164,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     308: pop
     309: goto          49
     312: aload         5
     314: checkcast     #125                // class java/util/List
     317: nop
     318: checkcast     #24                 // class java/lang/Iterable
     321: invokestatic  #168                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     324: invokestatic  #172                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     327: checkcast     #51                 // class java/lang/String
     330: areturn

  public final kotlin.Pair<java.lang.Integer, java.lang.Integer> diffIndexes(java.lang.String, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #199                // String a
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #201                // String b
       9: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_3
      14: aload_1
      15: checkcast     #53                 // class java/lang/CharSequence
      18: astore        5
      20: iconst_0
      21: istore        6
      23: aload         5
      25: astore        7
      27: new           #132                // class java/util/ArrayList
      30: dup
      31: aload         5
      33: invokeinterface #204,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      38: invokespecial #141                // Method java/util/ArrayList."<init>":(I)V
      41: checkcast     #89                 // class java/util/Collection
      44: astore        8
      46: iconst_0
      47: istore        9
      49: iconst_0
      50: istore        10
      52: iconst_0
      53: istore        11
      55: iload         11
      57: aload         7
      59: invokeinterface #204,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      64: if_icmpge     133
      67: aload         7
      69: iload         11
      71: invokeinterface #208,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      76: istore        12
      78: aload         8
      80: iload         10
      82: iinc          10, 1
      85: iload         12
      87: istore        13
      89: istore        14
      91: astore        16
      93: iconst_0
      94: istore        15
      96: iload         13
      98: aload_2
      99: iload         14
     101: invokevirtual #209                // Method java/lang/String.charAt:(I)C
     104: if_icmpeq     114
     107: iload         14
     109: istore_3
     110: iconst_1
     111: goto          115
     114: iconst_0
     115: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     118: aload         16
     120: swap
     121: invokeinterface #164,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     126: pop
     127: iinc          11, 1
     130: goto          55
     133: aload         8
     135: checkcast     #125                // class java/util/List
     138: nop
     139: checkcast     #24                 // class java/lang/Iterable
     142: invokestatic  #213                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     145: istore        4
     147: new           #26                 // class kotlin/Pair
     150: dup
     151: iload         4
     153: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     156: iload_3
     157: invokestatic  #32                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     160: invokespecial #35                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     163: areturn
}


import java.util.Scanner

class InputData(private val scanner: Scanner) {
    private val totalBooks: Int = scanner.nextInt()
    private val totalLibraries: Int = scanner.nextInt()
    val totalDaysGiven: Day = Day(scanner.nextInt())
    private val scores: List<Int> = List(totalBooks) { scanner.nextInt() }
    val libraries: Map<Library, List<Book>>

    val orderedBookIndexByScore = scores.withIndex().sortedBy { it.value }

    private val bookIndexToScore = (0 until totalBooks).zip(scores).toMap()

    init {
        val libs = mutableMapOf<Library, List<Book>>()
        for (i in 0 until totalLibraries) {
            val numBooksInLibrary = scanner.nextInt()
            val lib = Library(i, Day(scanner.nextInt()), scanner.nextInt(), 0)
            val xs = List(numBooksInLibrary) { scanner.nextInt() }
            val books = xs.map { Book(it, lib, bookIndexToScore[it]?:0) }
            lib.maxScore = books.map { it.score }.max()?:0
            libs[lib] = books
        }
        libraries = libs
    }

    val libsSorted = libraries.keys.sortedWith(Comparator { o1, o2 ->
        if (o2 == null) 1
        else o1?.compareTo(o2)?:-1
    })

}

data class Library(val id: Int, val signUp: Day, val booksPerDay: Int, var maxScore: Int): Comparable<Library> {
    override fun compareTo(other: Library): Int = when {
            maxScore != other.maxScore -> -1 * maxScore.compareTo(other.maxScore)
            signUp != other.signUp -> signUp.compareTo(other.signUp)
            else -> -1 * booksPerDay.compareTo(other.booksPerDay)
        }
}

data class Day(val size: Int): Comparable<Day> {
    override fun compareTo(other: Day): Int = size.compareTo(other.size)
}

data class Book(val id: Int, val lib: Library, val score: Int)

Compiled from "Comparisons.kt"
public final class InputData$special$$inlined$sortedBy$1<T> implements java.util.Comparator {
  public InputData$special$$inlined$sortedBy$1();
    Code:
       0: aload_0
       1: invokespecial #16                 // Method java/lang/Object."<init>":()V
       4: return

  public final int compare(T, T);
    Code:
       0: aload_1
       1: checkcast     #23                 // class kotlin/collections/IndexedValue
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: invokevirtual #27                 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;
      12: checkcast     #29                 // class java/lang/Integer
      15: checkcast     #31                 // class java/lang/Comparable
      18: aload_2
      19: checkcast     #23                 // class kotlin/collections/IndexedValue
      22: astore_3
      23: astore        5
      25: iconst_0
      26: istore        4
      28: aload_3
      29: invokevirtual #27                 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;
      32: checkcast     #29                 // class java/lang/Integer
      35: aload         5
      37: swap
      38: checkcast     #31                 // class java/lang/Comparable
      41: invokestatic  #37                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
      44: ireturn
}

Compiled from "InputData.kt"
public final class InputData {
  private final java.util.Scanner scanner;

  private final int totalBooks;

  private final int totalLibraries;

  private final Day totalDaysGiven;

  private final java.util.List<java.lang.Integer> scores;

  private final java.util.Map<Library, java.util.List<Book>> libraries;

  private final java.util.List<kotlin.collections.IndexedValue<java.lang.Integer>> orderedBookIndexByScore;

  private final java.util.Map<java.lang.Integer, java.lang.Integer> bookIndexToScore;

  private final java.util.List<Library> libsSorted;

  public InputData(java.util.Scanner);
    Code:
       0: aload_1
       1: ldc           #9                  // String scanner
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #21                 // Field scanner:Ljava/util/Scanner;
      15: aload_0
      16: aload_0
      17: getfield      #21                 // Field scanner:Ljava/util/Scanner;
      20: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
      23: putfield      #31                 // Field totalBooks:I
      26: aload_0
      27: aload_0
      28: getfield      #21                 // Field scanner:Ljava/util/Scanner;
      31: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
      34: putfield      #34                 // Field totalLibraries:I
      37: aload_0
      38: new           #36                 // class Day
      41: dup
      42: aload_0
      43: getfield      #21                 // Field scanner:Ljava/util/Scanner;
      46: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
      49: invokespecial #39                 // Method Day."<init>":(I)V
      52: putfield      #43                 // Field totalDaysGiven:LDay;
      55: aload_0
      56: aload_0
      57: getfield      #31                 // Field totalBooks:I
      60: istore_2
      61: astore        19
      63: new           #45                 // class java/util/ArrayList
      66: dup
      67: iload_2
      68: invokespecial #46                 // Method java/util/ArrayList."<init>":(I)V
      71: astore_3
      72: iconst_0
      73: istore        4
      75: iload         4
      77: iload_2
      78: if_icmpge     118
      81: iload         4
      83: istore        5
      85: aload_3
      86: iload         5
      88: istore        6
      90: astore        20
      92: iconst_0
      93: istore        7
      95: aload_0
      96: getfield      #21                 // Field scanner:Ljava/util/Scanner;
      99: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
     102: invokestatic  #52                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     105: aload         20
     107: swap
     108: invokevirtual #56                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     111: pop
     112: iinc          4, 1
     115: goto          75
     118: aload_3
     119: checkcast     #58                 // class java/util/List
     122: aload         19
     124: swap
     125: putfield      #62                 // Field scores:Ljava/util/List;
     128: aload_0
     129: aload_0
     130: getfield      #62                 // Field scores:Ljava/util/List;
     133: checkcast     #64                 // class java/lang/Iterable
     136: invokestatic  #70                 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;
     139: astore_2
     140: iconst_0
     141: istore_3
     142: aload_2
     143: new           #72                 // class InputData$special$$inlined$sortedBy$1
     146: dup
     147: invokespecial #73                 // Method InputData$special$$inlined$sortedBy$1."<init>":()V
     150: checkcast     #75                 // class java/util/Comparator
     153: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     156: putfield      #82                 // Field orderedBookIndexByScore:Ljava/util/List;
     159: aload_0
     160: iconst_0
     161: aload_0
     162: getfield      #31                 // Field totalBooks:I
     165: invokestatic  #88                 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     168: checkcast     #64                 // class java/lang/Iterable
     171: aload_0
     172: getfield      #62                 // Field scores:Ljava/util/List;
     175: checkcast     #64                 // class java/lang/Iterable
     178: invokestatic  #92                 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
     181: checkcast     #64                 // class java/lang/Iterable
     184: invokestatic  #98                 // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;
     187: putfield      #102                // Field bookIndexToScore:Ljava/util/Map;
     190: nop
     191: new           #104                // class java/util/LinkedHashMap
     194: dup
     195: invokespecial #105                // Method java/util/LinkedHashMap."<init>":()V
     198: checkcast     #107                // class java/util/Map
     201: astore_2
     202: iconst_0
     203: istore_3
     204: aload_0
     205: getfield      #34                 // Field totalLibraries:I
     208: istore        4
     210: iload_3
     211: iload         4
     213: if_icmpge     607
     216: aload_0
     217: getfield      #21                 // Field scanner:Ljava/util/Scanner;
     220: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
     223: istore        5
     225: new           #109                // class Library
     228: dup
     229: iload_3
     230: new           #36                 // class Day
     233: dup
     234: aload_0
     235: getfield      #21                 // Field scanner:Ljava/util/Scanner;
     238: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
     241: invokespecial #39                 // Method Day."<init>":(I)V
     244: aload_0
     245: getfield      #21                 // Field scanner:Ljava/util/Scanner;
     248: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
     251: iconst_0
     252: invokespecial #112                // Method Library."<init>":(ILDay;II)V
     255: astore        6
     257: new           #45                 // class java/util/ArrayList
     260: dup
     261: iload         5
     263: invokespecial #46                 // Method java/util/ArrayList."<init>":(I)V
     266: astore        8
     268: iconst_0
     269: istore        9
     271: iload         9
     273: iload         5
     275: if_icmpge     316
     278: iload         9
     280: istore        10
     282: aload         8
     284: iload         10
     286: istore        11
     288: astore        19
     290: iconst_0
     291: istore        12
     293: aload_0
     294: getfield      #21                 // Field scanner:Ljava/util/Scanner;
     297: invokevirtual #27                 // Method java/util/Scanner.nextInt:()I
     300: invokestatic  #52                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     303: aload         19
     305: swap
     306: invokevirtual #56                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     309: pop
     310: iinc          9, 1
     313: goto          271
     316: aload         8
     318: checkcast     #58                 // class java/util/List
     321: astore        7
     323: aload         7
     325: checkcast     #64                 // class java/lang/Iterable
     328: astore        9
     330: iconst_0
     331: istore        10
     333: aload         9
     335: astore        11
     337: new           #45                 // class java/util/ArrayList
     340: dup
     341: aload         9
     343: bipush        10
     345: invokestatic  #116                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     348: invokespecial #46                 // Method java/util/ArrayList."<init>":(I)V
     351: checkcast     #118                // class java/util/Collection
     354: astore        12
     356: iconst_0
     357: istore        13
     359: aload         11
     361: invokeinterface #122,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     366: astore        14
     368: aload         14
     370: invokeinterface #128,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     375: ifeq          456
     378: aload         14
     380: invokeinterface #132,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     385: astore        15
     387: aload         12
     389: aload         15
     391: checkcast     #134                // class java/lang/Number
     394: invokevirtual #137                // Method java/lang/Number.intValue:()I
     397: istore        16
     399: astore        19
     401: iconst_0
     402: istore        17
     404: new           #139                // class Book
     407: dup
     408: iload         16
     410: aload         6
     412: aload_0
     413: getfield      #102                // Field bookIndexToScore:Ljava/util/Map;
     416: iload         16
     418: invokestatic  #52                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     421: invokeinterface #143,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     426: checkcast     #48                 // class java/lang/Integer
     429: dup
     430: ifnull        439
     433: invokevirtual #144                // Method java/lang/Integer.intValue:()I
     436: goto          441
     439: pop
     440: iconst_0
     441: invokespecial #147                // Method Book."<init>":(ILLibrary;I)V
     444: aload         19
     446: swap
     447: invokeinterface #148,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     452: pop
     453: goto          368
     456: aload         12
     458: checkcast     #58                 // class java/util/List
     461: nop
     462: astore        8
     464: aload         6
     466: aload         8
     468: checkcast     #64                 // class java/lang/Iterable
     471: astore        10
     473: astore        19
     475: iconst_0
     476: istore        11
     478: aload         10
     480: astore        12
     482: new           #45                 // class java/util/ArrayList
     485: dup
     486: aload         10
     488: bipush        10
     490: invokestatic  #116                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     493: invokespecial #46                 // Method java/util/ArrayList."<init>":(I)V
     496: checkcast     #118                // class java/util/Collection
     499: astore        13
     501: iconst_0
     502: istore        14
     504: aload         12
     506: invokeinterface #122,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     511: astore        15
     513: aload         15
     515: invokeinterface #128,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     520: ifeq          566
     523: aload         15
     525: invokeinterface #132,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     530: astore        16
     532: aload         13
     534: aload         16
     536: checkcast     #139                // class Book
     539: astore        17
     541: astore        20
     543: iconst_0
     544: istore        18
     546: aload         17
     548: invokevirtual #151                // Method Book.getScore:()I
     551: invokestatic  #52                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     554: aload         20
     556: swap
     557: invokeinterface #148,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     562: pop
     563: goto          513
     566: aload         13
     568: checkcast     #58                 // class java/util/List
     571: nop
     572: aload         19
     574: swap
     575: checkcast     #64                 // class java/lang/Iterable
     578: invokestatic  #155                // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     581: checkcast     #134                // class java/lang/Number
     584: invokevirtual #137                // Method java/lang/Number.intValue:()I
     587: invokevirtual #158                // Method Library.setMaxScore:(I)V
     590: aload_2
     591: aload         6
     593: aload         8
     595: invokeinterface #162,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     600: pop
     601: iinc          3, 1
     604: goto          210
     607: aload_0
     608: aload_2
     609: putfield      #165                // Field libraries:Ljava/util/Map;
     612: nop
     613: aload_0
     614: aload_0
     615: getfield      #165                // Field libraries:Ljava/util/Map;
     618: invokeinterface #169,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     623: checkcast     #64                 // class java/lang/Iterable
     626: invokedynamic #188,  0            // InvokeDynamic #0:compare:()Ljava/util/Comparator;
     631: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     634: putfield      #191                // Field libsSorted:Ljava/util/List;
     637: return

  public final Day getTotalDaysGiven();
    Code:
       0: aload_0
       1: getfield      #43                 // Field totalDaysGiven:LDay;
       4: areturn

  public final java.util.Map<Library, java.util.List<Book>> getLibraries();
    Code:
       0: aload_0
       1: getfield      #165                // Field libraries:Ljava/util/Map;
       4: areturn

  public final java.util.List<kotlin.collections.IndexedValue<java.lang.Integer>> getOrderedBookIndexByScore();
    Code:
       0: aload_0
       1: getfield      #82                 // Field orderedBookIndexByScore:Ljava/util/List;
       4: areturn

  public final java.util.List<Library> getLibsSorted();
    Code:
       0: aload_0
       1: getfield      #191                // Field libsSorted:Ljava/util/List;
       4: areturn

  private static final int libsSorted$lambda$5(Library, Library);
    Code:
       0: aload_1
       1: ifnonnull     8
       4: iconst_1
       5: goto          22
       8: aload_0
       9: dup
      10: ifnull        20
      13: aload_1
      14: invokevirtual #231                // Method Library.compareTo:(LLibrary;)I
      17: goto          22
      20: pop
      21: iconst_m1
      22: ireturn
}


fun main(args: Array<String>) {
    fun toRange(str: String): IntRange {
        val (lo, hi) = str.split("-")
        return IntRange(lo.toInt(), hi.toInt())
    }

    fun rangesFullyContained(a: IntRange, b: IntRange): Boolean {
        return (a.first <= b.first && a.last >= b.last) ||
                (b.first <= a.first && b.last >= a.last)
    }

    fun rangesOverlap(a: IntRange, b: IntRange): Boolean {
        return (a.first <= b.first && a.last >= b.first) ||
                (b.first <= a.first && b.last >= a.first)
    }

    fun rowMeetsCriteria(row: String, func: (a: IntRange, b:IntRange) -> Boolean): Boolean {
        if (row.isEmpty()) return false

        val (left, right) = row.split(",")
        val leftRange = toRange(left)
        val rightRange = toRange(right)

        return func(leftRange, rightRange)
    }

    fun partN(input: String, func: (a: IntRange, b:IntRange) -> Boolean) {
        var sum = 0
        input.split("\n").forEach {
            if (rowMeetsCriteria(it, func))
                sum++
        }
        println(sum)
    }

    fun part1(input: String) {
        partN(input, ::rangesFullyContained)
    }

    fun part2(input: String) {
        partN(input, ::rangesOverlap)
    }

    val input = object {}.javaClass.getResource("Day04.txt").readText()
    part1(input)
    part2(input)
}

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #17                 // class Day04Kt$main$input$1
       9: dup
      10: invokespecial #21                 // Method Day04Kt$main$input$1."<init>":()V
      13: invokevirtual #25                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
      16: ldc           #27                 // String Day04.txt
      18: invokevirtual #33                 // Method java/lang/Class.getResource:(Ljava/lang/String;)Ljava/net/URL;
      21: dup
      22: ldc           #35                 // String getResource(...)
      24: invokestatic  #38                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      27: astore_2
      28: getstatic     #44                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      31: astore_3
      32: aload_2
      33: invokestatic  #50                 // Method kotlin/io/TextStreamsKt.readBytes:(Ljava/net/URL;)[B
      36: astore        4
      38: new           #52                 // class java/lang/String
      41: dup
      42: aload         4
      44: aload_3
      45: invokespecial #55                 // Method java/lang/String."<init>":([BLjava/nio/charset/Charset;)V
      48: astore_1
      49: aload_1
      50: invokestatic  #59                 // Method main$part1:(Ljava/lang/String;)V
      53: aload_1
      54: invokestatic  #62                 // Method main$part2:(Ljava/lang/String;)V
      57: return

  private static final kotlin.ranges.IntRange main$toRange(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #69                 // class java/lang/CharSequence
       4: iconst_1
       5: anewarray     #52                 // class java/lang/String
       8: astore_2
       9: aload_2
      10: iconst_0
      11: ldc           #71                 // String -
      13: aastore
      14: aload_2
      15: iconst_0
      16: iconst_0
      17: bipush        6
      19: aconst_null
      20: invokestatic  #77                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      23: astore_1
      24: aload_1
      25: iconst_0
      26: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      31: checkcast     #52                 // class java/lang/String
      34: astore_2
      35: aload_1
      36: iconst_1
      37: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      42: checkcast     #52                 // class java/lang/String
      45: astore_3
      46: new           #85                 // class kotlin/ranges/IntRange
      49: dup
      50: aload_2
      51: invokestatic  #91                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      54: aload_3
      55: invokestatic  #91                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      58: invokespecial #94                 // Method kotlin/ranges/IntRange."<init>":(II)V
      61: areturn

  private static final boolean main$rangesFullyContained(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
       4: aload_1
       5: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
       8: if_icmpgt     22
      11: aload_0
      12: invokevirtual #106                // Method kotlin/ranges/IntRange.getLast:()I
      15: aload_1
      16: invokevirtual #106                // Method kotlin/ranges/IntRange.getLast:()I
      19: if_icmpge     44
      22: aload_1
      23: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
      26: aload_0
      27: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
      30: if_icmpgt     48
      33: aload_1
      34: invokevirtual #106                // Method kotlin/ranges/IntRange.getLast:()I
      37: aload_0
      38: invokevirtual #106                // Method kotlin/ranges/IntRange.getLast:()I
      41: if_icmplt     48
      44: iconst_1
      45: goto          49
      48: iconst_0
      49: ireturn

  private static final boolean main$rangesOverlap(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
       4: aload_1
       5: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
       8: if_icmpgt     22
      11: aload_0
      12: invokevirtual #106                // Method kotlin/ranges/IntRange.getLast:()I
      15: aload_1
      16: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
      19: if_icmpge     44
      22: aload_1
      23: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
      26: aload_0
      27: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
      30: if_icmpgt     48
      33: aload_1
      34: invokevirtual #106                // Method kotlin/ranges/IntRange.getLast:()I
      37: aload_0
      38: invokevirtual #103                // Method kotlin/ranges/IntRange.getFirst:()I
      41: if_icmplt     48
      44: iconst_1
      45: goto          49
      48: iconst_0
      49: ireturn

  private static final boolean main$rowMeetsCriteria(java.lang.String, kotlin.jvm.functions.Function2<? super kotlin.ranges.IntRange, ? super kotlin.ranges.IntRange, java.lang.Boolean>);
    Code:
       0: aload_0
       1: checkcast     #69                 // class java/lang/CharSequence
       4: invokeinterface #116,  1          // InterfaceMethod java/lang/CharSequence.length:()I
       9: ifne          16
      12: iconst_1
      13: goto          17
      16: iconst_0
      17: ifeq          22
      20: iconst_0
      21: ireturn
      22: aload_0
      23: checkcast     #69                 // class java/lang/CharSequence
      26: iconst_1
      27: anewarray     #52                 // class java/lang/String
      30: astore_3
      31: aload_3
      32: iconst_0
      33: ldc           #118                // String ,
      35: aastore
      36: aload_3
      37: iconst_0
      38: iconst_0
      39: bipush        6
      41: aconst_null
      42: invokestatic  #77                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      45: astore_2
      46: aload_2
      47: iconst_0
      48: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      53: checkcast     #52                 // class java/lang/String
      56: astore_3
      57: aload_2
      58: iconst_1
      59: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      64: checkcast     #52                 // class java/lang/String
      67: astore        4
      69: aload_3
      70: invokestatic  #120                // Method main$toRange:(Ljava/lang/String;)Lkotlin/ranges/IntRange;
      73: astore        5
      75: aload         4
      77: invokestatic  #120                // Method main$toRange:(Ljava/lang/String;)Lkotlin/ranges/IntRange;
      80: astore        6
      82: aload_1
      83: aload         5
      85: aload         6
      87: invokeinterface #126,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      92: checkcast     #128                // class java/lang/Boolean
      95: invokevirtual #132                // Method java/lang/Boolean.booleanValue:()Z
      98: ireturn

  private static final void main$partN(java.lang.String, kotlin.jvm.functions.Function2<? super kotlin.ranges.IntRange, ? super kotlin.ranges.IntRange, java.lang.Boolean>);
    Code:
       0: iconst_0
       1: istore_2
       2: aload_0
       3: checkcast     #69                 // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #52                 // class java/lang/String
      10: astore_3
      11: aload_3
      12: iconst_0
      13: ldc           #144                // String \n
      15: aastore
      16: aload_3
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #77                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      25: checkcast     #146                // class java/lang/Iterable
      28: astore_3
      29: iconst_0
      30: istore        4
      32: aload_3
      33: invokeinterface #150,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        5
      40: aload         5
      42: invokeinterface #155,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          87
      50: aload         5
      52: invokeinterface #159,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        6
      59: aload         6
      61: checkcast     #52                 // class java/lang/String
      64: astore        7
      66: iconst_0
      67: istore        8
      69: aload         7
      71: aload_1
      72: invokestatic  #161                // Method main$rowMeetsCriteria:(Ljava/lang/String;Lkotlin/jvm/functions/Function2;)Z
      75: ifeq          82
      78: iload_2
      79: iconst_1
      80: iadd
      81: istore_2
      82: nop
      83: nop
      84: goto          40
      87: nop
      88: iload_2
      89: istore_3
      90: getstatic     #167                // Field java/lang/System.out:Ljava/io/PrintStream;
      93: iload_3
      94: invokevirtual #173                // Method java/io/PrintStream.println:(I)V
      97: return

  private static final void main$part1(java.lang.String);
    Code:
       0: aload_0
       1: getstatic     #188                // Field Day04Kt$main$part1$1.INSTANCE:LDay04Kt$main$part1$1;
       4: checkcast     #122                // class kotlin/jvm/functions/Function2
       7: invokestatic  #190                // Method main$partN:(Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
      10: return

  private static final void main$part2(java.lang.String);
    Code:
       0: aload_0
       1: getstatic     #195                // Field Day04Kt$main$part2$1.INSTANCE:LDay04Kt$main$part2$1;
       4: checkcast     #122                // class kotlin/jvm/functions/Function2
       7: invokestatic  #190                // Method main$partN:(Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
      10: return

  public static final boolean access$main$rangesFullyContained(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: aload_1
       2: invokestatic  #198                // Method main$rangesFullyContained:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
       5: ireturn

  public static final boolean access$main$rangesOverlap(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: aload_1
       2: invokestatic  #201                // Method main$rangesOverlap:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
       5: ireturn
}

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

Compiled from "Day04.kt"
final class Day04Kt$main$part2$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<kotlin.ranges.IntRange, kotlin.ranges.IntRange, java.lang.Boolean> {
  public static final Day04Kt$main$part2$1 INSTANCE;

  Day04Kt$main$part2$1();
    Code:
       0: aload_0
       1: iconst_2
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String rangesOverlap
       6: ldc           #15                 // String main$rangesOverlap(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Boolean invoke(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokestatic  #38                 // Method Day04Kt.access$main$rangesOverlap:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
      17: invokestatic  #44                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
      20: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #48                 // class kotlin/ranges/IntRange
       5: aload_2
       6: checkcast     #48                 // class kotlin/ranges/IntRange
       9: invokevirtual #50                 // Method invoke:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Ljava/lang/Boolean;
      12: areturn

  static {};
    Code:
       0: new           #2                  // class Day04Kt$main$part2$1
       3: dup
       4: invokespecial #55                 // Method "<init>":()V
       7: putstatic     #58                 // Field INSTANCE:LDay04Kt$main$part2$1;
      10: return
}

Compiled from "Day04.kt"
final class Day04Kt$main$part1$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<kotlin.ranges.IntRange, kotlin.ranges.IntRange, java.lang.Boolean> {
  public static final Day04Kt$main$part1$1 INSTANCE;

  Day04Kt$main$part1$1();
    Code:
       0: aload_0
       1: iconst_2
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String rangesFullyContained
       6: ldc           #15                 // String main$rangesFullyContained(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Boolean invoke(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokestatic  #38                 // Method Day04Kt.access$main$rangesFullyContained:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
      17: invokestatic  #44                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
      20: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #48                 // class kotlin/ranges/IntRange
       5: aload_2
       6: checkcast     #48                 // class kotlin/ranges/IntRange
       9: invokevirtual #50                 // Method invoke:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Ljava/lang/Boolean;
      12: areturn

  static {};
    Code:
       0: new           #2                  // class Day04Kt$main$part1$1
       3: dup
       4: invokespecial #55                 // Method "<init>":()V
       7: putstatic     #58                 // Field INSTANCE:LDay04Kt$main$part1$1;
      10: return
}