import java.io.File
import kotlin.math.pow

fun main() {
  println(countPoints())
  println(countCards())
}

private fun countCards(): Int {
  val cardCount = (0..211).associateWith { 1 }.toMutableMap()

  File("inputs/scratch.txt").readLines().mapIndexed() { ix, line ->
    if (line.isBlank()) return@mapIndexed

    val winningCount = countWinningNumbers(line)
    val times = cardCount[ix]!!
    for (j in (ix + 1)..ix + winningCount) {
      cardCount[j] = cardCount[j]!! + times
    }
  }

  return cardCount.values.sum()
}

private fun countPoints(): Int = File("inputs/scratch.txt").readLines().map { line ->
    val winningCount = countWinningNumbers(line)
    if (winningCount == 0) 0 else 2.0.pow(winningCount - 1).toInt()
  }.sum()

private fun countWinningNumbers(line: String): Int {
  val (winning, actual) = line.split(":")[1].split("|")
  val winningNumbers = winning.toNumbers().toSet()
  return actual.toNumbers().count { winningNumbers.contains(it) }
}

private fun String.toNumbers() = Regex("\\d+").findAll(this).map { it.value.toInt() }.toList()

Compiled from "Scratch.kt"
public final class ScratchKt {
  public static final void main();
    Code:
       0: invokestatic  #10                 // Method countPoints:()I
       3: istore_0
       4: getstatic     #16                 // Field java/lang/System.out:Ljava/io/PrintStream;
       7: iload_0
       8: invokevirtual #22                 // Method java/io/PrintStream.println:(I)V
      11: invokestatic  #25                 // Method countCards:()I
      14: istore_0
      15: getstatic     #16                 // Field java/lang/System.out:Ljava/io/PrintStream;
      18: iload_0
      19: invokevirtual #22                 // Method java/io/PrintStream.println:(I)V
      22: return

  private static final int countCards();
    Code:
       0: new           #27                 // class kotlin/ranges/IntRange
       3: dup
       4: iconst_0
       5: sipush        211
       8: invokespecial #31                 // Method kotlin/ranges/IntRange."<init>":(II)V
      11: checkcast     #33                 // class java/lang/Iterable
      14: astore_1
      15: iconst_0
      16: istore_2
      17: new           #35                 // class java/util/LinkedHashMap
      20: dup
      21: aload_1
      22: bipush        10
      24: invokestatic  #41                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      27: invokestatic  #47                 // Method kotlin/collections/MapsKt.mapCapacity:(I)I
      30: bipush        16
      32: invokestatic  #53                 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
      35: invokespecial #55                 // Method java/util/LinkedHashMap."<init>":(I)V
      38: astore_3
      39: aload_1
      40: astore        4
      42: iconst_0
      43: istore        5
      45: aload         4
      47: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      52: astore        6
      54: aload         6
      56: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      61: ifeq          117
      64: aload         6
      66: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      71: astore        7
      73: aload_3
      74: checkcast     #71                 // class java/util/Map
      77: aload         7
      79: aload         7
      81: checkcast     #73                 // class java/lang/Number
      84: invokevirtual #76                 // Method java/lang/Number.intValue:()I
      87: istore        8
      89: astore        19
      91: astore        18
      93: iconst_0
      94: istore        9
      96: iconst_1
      97: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     100: astore        20
     102: aload         18
     104: aload         19
     106: aload         20
     108: invokeinterface #86,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     113: pop
     114: goto          54
     117: aload_3
     118: checkcast     #71                 // class java/util/Map
     121: nop
     122: invokestatic  #90                 // Method kotlin/collections/MapsKt.toMutableMap:(Ljava/util/Map;)Ljava/util/Map;
     125: astore_0
     126: new           #92                 // class java/io/File
     129: dup
     130: ldc           #94                 // String inputs/scratch.txt
     132: invokespecial #97                 // Method java/io/File."<init>":(Ljava/lang/String;)V
     135: aconst_null
     136: iconst_1
     137: aconst_null
     138: invokestatic  #103                // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
     141: checkcast     #33                 // class java/lang/Iterable
     144: astore_1
     145: iconst_0
     146: istore_2
     147: aload_1
     148: astore_3
     149: new           #105                // class java/util/ArrayList
     152: dup
     153: aload_1
     154: bipush        10
     156: invokestatic  #41                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     159: invokespecial #106                // Method java/util/ArrayList."<init>":(I)V
     162: checkcast     #108                // class java/util/Collection
     165: astore        4
     167: iconst_0
     168: istore        5
     170: iconst_0
     171: istore        6
     173: aload_3
     174: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     179: astore        7
     181: aload         7
     183: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     188: ifeq          365
     191: aload         7
     193: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     198: astore        8
     200: aload         4
     202: iload         6
     204: iinc          6, 1
     207: istore        9
     209: iload         9
     211: ifge          217
     214: invokestatic  #111                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     217: iload         9
     219: aload         8
     221: checkcast     #113                // class java/lang/String
     224: astore        10
     226: istore        11
     228: astore        18
     230: iconst_0
     231: istore        12
     233: aload         10
     235: checkcast     #115                // class java/lang/CharSequence
     238: invokestatic  #121                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     241: ifne          351
     244: aload         10
     246: invokestatic  #125                // Method countWinningNumbers:(Ljava/lang/String;)I
     249: istore        13
     251: aload_0
     252: iload         11
     254: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     257: invokeinterface #129,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     262: dup
     263: invokestatic  #135                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     266: checkcast     #73                 // class java/lang/Number
     269: invokevirtual #76                 // Method java/lang/Number.intValue:()I
     272: istore        14
     274: iload         11
     276: iconst_1
     277: iadd
     278: istore        15
     280: iload         11
     282: iload         13
     284: iadd
     285: istore        16
     287: iload         15
     289: iload         16
     291: if_icmpgt     350
     294: iload         15
     296: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     299: astore        17
     301: aload_0
     302: aload         17
     304: aload_0
     305: iload         15
     307: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     310: invokeinterface #129,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     315: dup
     316: invokestatic  #135                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     319: checkcast     #73                 // class java/lang/Number
     322: invokevirtual #76                 // Method java/lang/Number.intValue:()I
     325: iload         14
     327: iadd
     328: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     331: invokeinterface #86,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     336: pop
     337: iload         15
     339: iload         16
     341: if_icmpeq     350
     344: iinc          15, 1
     347: goto          294
     350: nop
     351: aload         18
     353: getstatic     #141                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     356: invokeinterface #145,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     361: pop
     362: goto          181
     365: aload         4
     367: checkcast     #147                // class java/util/List
     370: nop
     371: pop
     372: aload_0
     373: invokeinterface #151,  1          // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
     378: checkcast     #33                 // class java/lang/Iterable
     381: invokestatic  #155                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     384: ireturn

  private static final int countPoints();
    Code:
       0: new           #92                 // class java/io/File
       3: dup
       4: ldc           #94                 // String inputs/scratch.txt
       6: invokespecial #97                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #103                // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      15: checkcast     #33                 // class java/lang/Iterable
      18: astore_0
      19: iconst_0
      20: istore_1
      21: aload_0
      22: astore_2
      23: new           #105                // class java/util/ArrayList
      26: dup
      27: aload_0
      28: bipush        10
      30: invokestatic  #41                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      33: invokespecial #106                // Method java/util/ArrayList."<init>":(I)V
      36: checkcast     #108                // class java/util/Collection
      39: astore_3
      40: iconst_0
      41: istore        4
      43: aload_2
      44: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      49: astore        5
      51: aload         5
      53: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      58: ifeq          126
      61: aload         5
      63: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      68: astore        6
      70: aload_3
      71: aload         6
      73: checkcast     #113                // class java/lang/String
      76: astore        7
      78: astore        10
      80: iconst_0
      81: istore        8
      83: aload         7
      85: invokestatic  #125                // Method countWinningNumbers:(Ljava/lang/String;)I
      88: istore        9
      90: iload         9
      92: ifne          99
      95: iconst_0
      96: goto          111
      99: ldc2_w        #185                // double 2.0d
     102: iload         9
     104: iconst_1
     105: isub
     106: i2d
     107: invokestatic  #192                // Method java/lang/Math.pow:(DD)D
     110: d2i
     111: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     114: aload         10
     116: swap
     117: invokeinterface #145,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     122: pop
     123: goto          51
     126: aload_3
     127: checkcast     #147                // class java/util/List
     130: nop
     131: checkcast     #33                 // class java/lang/Iterable
     134: invokestatic  #155                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     137: ireturn

  private static final int countWinningNumbers(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #115                // class java/lang/CharSequence
       4: iconst_1
       5: anewarray     #113                // class java/lang/String
       8: astore_2
       9: aload_2
      10: iconst_0
      11: ldc           #199                // String :
      13: aastore
      14: aload_2
      15: iconst_0
      16: iconst_0
      17: bipush        6
      19: aconst_null
      20: invokestatic  #203                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      23: iconst_1
      24: invokeinterface #206,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      29: checkcast     #115                // class java/lang/CharSequence
      32: iconst_1
      33: anewarray     #113                // class java/lang/String
      36: astore_2
      37: aload_2
      38: iconst_0
      39: ldc           #208                // String |
      41: aastore
      42: aload_2
      43: iconst_0
      44: iconst_0
      45: bipush        6
      47: aconst_null
      48: invokestatic  #203                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      51: astore_1
      52: aload_1
      53: iconst_0
      54: invokeinterface #206,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      59: checkcast     #113                // class java/lang/String
      62: astore_2
      63: aload_1
      64: iconst_1
      65: invokeinterface #206,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      70: checkcast     #113                // class java/lang/String
      73: astore_3
      74: aload_2
      75: invokestatic  #212                // Method toNumbers:(Ljava/lang/String;)Ljava/util/List;
      78: checkcast     #33                 // class java/lang/Iterable
      81: invokestatic  #216                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
      84: astore        4
      86: aload_3
      87: invokestatic  #212                // Method toNumbers:(Ljava/lang/String;)Ljava/util/List;
      90: checkcast     #33                 // class java/lang/Iterable
      93: astore        5
      95: iconst_0
      96: istore        6
      98: aload         5
     100: instanceof    #108                // class java/util/Collection
     103: ifeq          123
     106: aload         5
     108: checkcast     #108                // class java/util/Collection
     111: invokeinterface #219,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     116: ifeq          123
     119: iconst_0
     120: goto          198
     123: iconst_0
     124: istore        7
     126: aload         5
     128: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     133: astore        8
     135: aload         8
     137: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     142: ifeq          196
     145: aload         8
     147: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     152: astore        9
     154: aload         9
     156: checkcast     #73                 // class java/lang/Number
     159: invokevirtual #76                 // Method java/lang/Number.intValue:()I
     162: istore        10
     164: iconst_0
     165: istore        11
     167: aload         4
     169: iload         10
     171: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     174: invokeinterface #224,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     179: ifeq          135
     182: iinc          7, 1
     185: iload         7
     187: ifge          135
     190: invokestatic  #227                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     193: goto          135
     196: iload         7
     198: ireturn

  private static final java.util.List<java.lang.Integer> toNumbers(java.lang.String);
    Code:
       0: new           #239                // class kotlin/text/Regex
       3: dup
       4: ldc           #241                // String \\d+
       6: invokespecial #242                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
       9: aload_0
      10: checkcast     #115                // class java/lang/CharSequence
      13: iconst_0
      14: iconst_2
      15: aconst_null
      16: invokestatic  #246                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
      19: invokedynamic #265,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      24: invokestatic  #271                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      27: invokestatic  #275                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      30: areturn

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

  private static final int toNumbers$lambda$4(kotlin.text.MatchResult);
    Code:
       0: aload_0
       1: ldc_w         #282                // String it
       4: invokestatic  #286                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokeinterface #292,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
      13: invokestatic  #295                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      16: ireturn
}


shyoutarou__desafios-DIO__b312f8f/Desafios/Kotlin/Primeiros passos em Kotlin/Carrefour Android Developer/Figurinhas/figurinhas.kt

/*
Ricardo e Vicente são aficionados por figurinhas. Nas horas vagas, eles arrumam um jeito de jogar um “bafo” ou algum outro jogo que envolva tais figurinhas. Ambos também têm o hábito de trocarem as figuras repetidas com seus amigos e certo dia pensaram em uma brincadeira diferente. Chamaram todos os amigos e propuseram o seguinte: com as figurinhas em mãos, cada um tentava fazer uma troca com o amigo que estava mais perto seguindo a seguinte regra: cada um contava quantas figurinhas tinha. Em seguida, eles tinham que dividir as figurinhas de cada um em pilhas do mesmo tamanho, no maior tamanho que fosse possível para ambos. Então, cada um escolhia uma das pilhas de figurinhas do amigo para receber. Por exemplo, se Ricardo e Vicente fossem trocar as figurinhas e tivessem respectivamente 8 e 12 figuras, ambos dividiam todas as suas figuras em pilhas de 4 figuras (Ricardo teria 2 pilhas e Vicente teria 3 pilhas) e ambos escolhiam uma pilha do amigo para receber.

Entrada

A primeira linha da entrada contém um único inteiro N (1 ≤ N ≤ 3000), indicando o número de casos de teste. Cada caso de teste contém 2 inteiros F1 (1 ≤ F1 ≤ 1000) e F2 (1 ≤ F2 ≤ 1000) indicando, respectivamente, a quantidade de figurinhas que Ricardo e Vicente têm para trocar.

Saída

Para cada caso de teste de entrada haverá um valor na saída, representando o tamanho máximo da pilha de figurinhas que poderia ser trocada entre dois jogadores.

*/
fun main(args: Array<String>)
{
    val lista = mutableListOf<Int>()

    for (i in 1..readLine()!!.toInt()) {
        val input = readLine()!!.split(" ").map { it.toInt() }

        input.forEach { number ->
            lista.add(number)
        }

        println(mdc(lista[0], lista[1]))

        lista.clear()
    }
}

fun mdc(n1: Int, n2: Int): Int
{
    return if (n2 == 0) {
        n1
    } else {
        mdc(n2, (n1 % n2))
    }
}

Compiled from "figurinhas.kt"
public final class FigurinhasKt {
  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 java/util/ArrayList
       9: dup
      10: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
      13: checkcast     #23                 // class java/util/List
      16: astore_1
      17: iconst_1
      18: istore_2
      19: invokestatic  #29                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      22: dup
      23: invokestatic  #33                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      26: invokestatic  #39                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      29: istore_3
      30: iload_2
      31: iload_3
      32: if_icmpgt     297
      35: invokestatic  #29                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      38: dup
      39: invokestatic  #33                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      42: checkcast     #41                 // class java/lang/CharSequence
      45: iconst_1
      46: anewarray     #43                 // class java/lang/String
      49: astore        5
      51: aload         5
      53: iconst_0
      54: ldc           #45                 // String
      56: aastore
      57: aload         5
      59: iconst_0
      60: iconst_0
      61: bipush        6
      63: aconst_null
      64: invokestatic  #51                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      67: checkcast     #53                 // class java/lang/Iterable
      70: astore        5
      72: iconst_0
      73: istore        6
      75: aload         5
      77: astore        7
      79: new           #17                 // class java/util/ArrayList
      82: dup
      83: aload         5
      85: bipush        10
      87: invokestatic  #59                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      90: invokespecial #62                 // Method java/util/ArrayList."<init>":(I)V
      93: checkcast     #64                 // class java/util/Collection
      96: astore        8
      98: iconst_0
      99: istore        9
     101: aload         7
     103: invokeinterface #68,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     108: astore        10
     110: aload         10
     112: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     117: ifeq          164
     120: aload         10
     122: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     127: astore        11
     129: aload         8
     131: aload         11
     133: checkcast     #43                 // class java/lang/String
     136: astore        12
     138: astore        14
     140: iconst_0
     141: istore        13
     143: aload         12
     145: invokestatic  #39                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     148: nop
     149: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     152: aload         14
     154: swap
     155: invokeinterface #86,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     160: pop
     161: goto          110
     164: aload         8
     166: checkcast     #23                 // class java/util/List
     169: nop
     170: astore        4
     172: aload         4
     174: checkcast     #53                 // class java/lang/Iterable
     177: astore        5
     179: iconst_0
     180: istore        6
     182: aload         5
     184: invokeinterface #68,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     189: astore        7
     191: aload         7
     193: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     198: ifeq          240
     201: aload         7
     203: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     208: astore        8
     210: aload         8
     212: checkcast     #88                 // class java/lang/Number
     215: invokevirtual #92                 // Method java/lang/Number.intValue:()I
     218: istore        9
     220: iconst_0
     221: istore        10
     223: aload_1
     224: iload         9
     226: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     229: invokeinterface #93,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     234: pop
     235: nop
     236: nop
     237: goto          191
     240: nop
     241: aload_1
     242: iconst_0
     243: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     248: checkcast     #88                 // class java/lang/Number
     251: invokevirtual #92                 // Method java/lang/Number.intValue:()I
     254: aload_1
     255: iconst_1
     256: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     261: checkcast     #88                 // class java/lang/Number
     264: invokevirtual #92                 // Method java/lang/Number.intValue:()I
     267: invokestatic  #101                // Method mdc:(II)I
     270: istore        5
     272: getstatic     #107                // Field java/lang/System.out:Ljava/io/PrintStream;
     275: iload         5
     277: invokevirtual #112                // Method java/io/PrintStream.println:(I)V
     280: aload_1
     281: invokeinterface #115,  1          // InterfaceMethod java/util/List.clear:()V
     286: iload_2
     287: iload_3
     288: if_icmpeq     297
     291: iinc          2, 1
     294: goto          35
     297: return

  public static final int mdc(int, int);
    Code:
       0: iload_1
       1: ifne          8
       4: iload_0
       5: goto          15
       8: iload_1
       9: iload_0
      10: iload_1
      11: irem
      12: invokestatic  #101                // Method mdc:(II)I
      15: ireturn
}


import kotlin.collections.listOf

var amount = 11
var result: ArrayList<CoinsAndQuantity> = ArrayList()
fun main() {
    println(minCoins())
}

fun minCoins() {
    val coins = listOf(1,2,5).sorted()
    val suma = coins.sum();
    if(suma == amount) {
        println(suma);
        return;
    }
    calculation(coins.size, coins)
    println(result)
    println(sumItems())
    if(sumItems() != amount) println(-1)
    else println(result)
}

private fun sumItems(): Int {
    var data = 0
    result.forEach { item ->
        data += item.coin * item.quantity
    }
    return data
}

private fun calculation(index: Int, coins: List<Int>) {
    if(index > 0) {
        val divisor = (amount / coins[index-1]).toInt()
        val restante = (amount % coins[index-1]).toInt()
        amount = restante
        divisor.takeIf { it > 0 }?.also {
            result.add(CoinsAndQuantity(coins[index-1], divisor))
        }
        calculation(index - 1, coins)
    }
}

data class CoinsAndQuantity (
    var coin: Int = 0,
    var quantity: Int = 0
)

Compiled from "coins.kt"
public final class CoinsKt {
  private static int amount;

  private static java.util.ArrayList<CoinsAndQuantity> result;

  public static final int getAmount();
    Code:
       0: getstatic     #10                 // Field amount:I
       3: ireturn

  public static final void setAmount(int);
    Code:
       0: iload_0
       1: putstatic     #10                 // Field amount:I
       4: return

  public static final java.util.ArrayList<CoinsAndQuantity> getResult();
    Code:
       0: getstatic     #21                 // Field result:Ljava/util/ArrayList;
       3: areturn

  public static final void setResult(java.util.ArrayList<CoinsAndQuantity>);
    Code:
       0: aload_0
       1: ldc           #25                 // String <set-?>
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: putstatic     #21                 // Field result:Ljava/util/ArrayList;
      10: return

  public static final void main();
    Code:
       0: invokestatic  #36                 // Method minCoins:()V
       3: getstatic     #42                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
       6: getstatic     #48                 // Field java/lang/System.out:Ljava/io/PrintStream;
       9: swap
      10: invokevirtual #54                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      13: return

  public static final void minCoins();
    Code:
       0: iconst_3
       1: anewarray     #56                 // class java/lang/Integer
       4: astore_1
       5: aload_1
       6: iconst_0
       7: iconst_1
       8: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      11: aastore
      12: aload_1
      13: iconst_1
      14: iconst_2
      15: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      18: aastore
      19: aload_1
      20: iconst_2
      21: iconst_5
      22: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: aastore
      26: aload_1
      27: invokestatic  #66                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      30: checkcast     #68                 // class java/lang/Iterable
      33: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      36: astore_0
      37: aload_0
      38: checkcast     #68                 // class java/lang/Iterable
      41: invokestatic  #76                 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
      44: istore_1
      45: iload_1
      46: getstatic     #10                 // Field amount:I
      49: if_icmpne     60
      52: getstatic     #48                 // Field java/lang/System.out:Ljava/io/PrintStream;
      55: iload_1
      56: invokevirtual #78                 // Method java/io/PrintStream.println:(I)V
      59: return
      60: aload_0
      61: invokeinterface #83,  1           // InterfaceMethod java/util/List.size:()I
      66: aload_0
      67: invokestatic  #87                 // Method calculation:(ILjava/util/List;)V
      70: getstatic     #21                 // Field result:Ljava/util/ArrayList;
      73: getstatic     #48                 // Field java/lang/System.out:Ljava/io/PrintStream;
      76: swap
      77: invokevirtual #54                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      80: invokestatic  #90                 // Method sumItems:()I
      83: istore_2
      84: getstatic     #48                 // Field java/lang/System.out:Ljava/io/PrintStream;
      87: iload_2
      88: invokevirtual #78                 // Method java/io/PrintStream.println:(I)V
      91: invokestatic  #90                 // Method sumItems:()I
      94: getstatic     #10                 // Field amount:I
      97: if_icmpeq     112
     100: iconst_m1
     101: istore_2
     102: getstatic     #48                 // Field java/lang/System.out:Ljava/io/PrintStream;
     105: iload_2
     106: invokevirtual #78                 // Method java/io/PrintStream.println:(I)V
     109: goto          122
     112: getstatic     #21                 // Field result:Ljava/util/ArrayList;
     115: getstatic     #48                 // Field java/lang/System.out:Ljava/io/PrintStream;
     118: swap
     119: invokevirtual #54                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     122: return

  private static final int sumItems();
    Code:
       0: iconst_0
       1: istore_0
       2: getstatic     #21                 // Field result:Ljava/util/ArrayList;
       5: checkcast     #68                 // class java/lang/Iterable
       8: astore_1
       9: iconst_0
      10: istore_2
      11: aload_1
      12: invokeinterface #97,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      17: astore_3
      18: aload_3
      19: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifeq          64
      27: aload_3
      28: invokeinterface #107,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      33: astore        4
      35: aload         4
      37: checkcast     #109                // class CoinsAndQuantity
      40: astore        5
      42: iconst_0
      43: istore        6
      45: iload_0
      46: aload         5
      48: invokevirtual #112                // Method CoinsAndQuantity.getCoin:()I
      51: aload         5
      53: invokevirtual #115                // Method CoinsAndQuantity.getQuantity:()I
      56: imul
      57: iadd
      58: istore_0
      59: nop
      60: nop
      61: goto          18
      64: nop
      65: iload_0
      66: ireturn

  private static final void calculation(int, java.util.List<java.lang.Integer>);
    Code:
       0: iload_0
       1: ifle          148
       4: getstatic     #10                 // Field amount:I
       7: aload_1
       8: iload_0
       9: iconst_1
      10: isub
      11: invokeinterface #129,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      16: checkcast     #131                // class java/lang/Number
      19: invokevirtual #134                // Method java/lang/Number.intValue:()I
      22: idiv
      23: istore_2
      24: getstatic     #10                 // Field amount:I
      27: aload_1
      28: iload_0
      29: iconst_1
      30: isub
      31: invokeinterface #129,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      36: checkcast     #131                // class java/lang/Number
      39: invokevirtual #134                // Method java/lang/Number.intValue:()I
      42: irem
      43: istore_3
      44: iload_3
      45: putstatic     #10                 // Field amount:I
      48: iload_2
      49: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      52: astore        4
      54: aload         4
      56: checkcast     #131                // class java/lang/Number
      59: invokevirtual #134                // Method java/lang/Number.intValue:()I
      62: istore        5
      64: iconst_0
      65: istore        6
      67: iload         5
      69: ifle          76
      72: iconst_1
      73: goto          77
      76: iconst_0
      77: ifeq          85
      80: aload         4
      82: goto          86
      85: aconst_null
      86: dup
      87: ifnull        139
      90: astore        4
      92: aload         4
      94: checkcast     #131                // class java/lang/Number
      97: invokevirtual #134                // Method java/lang/Number.intValue:()I
     100: istore        5
     102: iconst_0
     103: istore        6
     105: getstatic     #21                 // Field result:Ljava/util/ArrayList;
     108: new           #109                // class CoinsAndQuantity
     111: dup
     112: aload_1
     113: iload_0
     114: iconst_1
     115: isub
     116: invokeinterface #129,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     121: checkcast     #131                // class java/lang/Number
     124: invokevirtual #134                // Method java/lang/Number.intValue:()I
     127: iload_2
     128: invokespecial #138                // Method CoinsAndQuantity."<init>":(II)V
     131: invokevirtual #144                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     134: pop
     135: nop
     136: goto          141
     139: pop
     140: nop
     141: iload_0
     142: iconst_1
     143: isub
     144: aload_1
     145: invokestatic  #87                 // Method calculation:(ILjava/util/List;)V
     148: return

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

  static {};
    Code:
       0: bipush        11
       2: putstatic     #10                 // Field amount:I
       5: new           #140                // class java/util/ArrayList
       8: dup
       9: invokespecial #158                // Method java/util/ArrayList."<init>":()V
      12: putstatic     #21                 // Field result:Ljava/util/ArrayList;
      15: return
}


fun main() {
    fun part1(input: List<String>): Int = input
        .contains(::fullyContains)

    fun part2(input: List<String>): Int = input
        .contains(::partiallyContains)

    // test if implementation meets criteria from the description, like:
//    val testInput = readInput("Day04_test")
//    check(part1(testInput) == 2)
//
//    check(part2(testInput) == 4)
//
//    val input = readInput("Day04")
//    println(part1(input))
//    println(part2(input))
}

fun List<String>.contains(fullyOrPartialContains: (List<Int>, List<Int>) -> Boolean) = map {
    it
        .split(",")
}
    .foldRight(0) { cleaningAreas, containedAreas ->
        val (cleaningAreaOne, cleaningAreaTwo) = cleaningAreas
            .map { cleaningArea ->
                cleaningArea
                    .split("-")
                    .map { it.toInt() }
            }
        containedAreas + if (fullyOrPartialContains(cleaningAreaOne, cleaningAreaTwo))
            1
        else 0
    }

fun fullyContains(areaOne: List<Int>, areaTwo: List<Int>): Boolean = when {
    areaOne.first() >= areaTwo.first() && areaOne.last() <= areaTwo.last() || areaTwo.first() >= areaOne.first() && areaTwo.last() <= areaOne.last() -> true
    else -> false
}

fun partiallyContains(areaOne: List<Int>, areaTwo: List<Int>): Boolean = (areaOne.first() .. areaOne.last()).toSet().intersect((areaTwo.first() .. areaTwo.last()).toSet()).size >= 1

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main();
    Code:
       0: return

  public static final int contains(java.util.List<java.lang.String>, kotlin.jvm.functions.Function2<? super java.util.List<java.lang.Integer>, ? super java.util.List<java.lang.Integer>, java.lang.Boolean>);
    Code:
       0: aload_0
       1: ldc           #12                 // String <this>
       3: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #20                 // String fullyOrPartialContains
       9: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: checkcast     #22                 // class java/lang/Iterable
      16: astore_2
      17: iconst_0
      18: istore_3
      19: aload_2
      20: astore        4
      22: new           #24                 // class java/util/ArrayList
      25: dup
      26: aload_2
      27: bipush        10
      29: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      32: invokespecial #34                 // Method java/util/ArrayList."<init>":(I)V
      35: checkcast     #36                 // class java/util/Collection
      38: astore        5
      40: iconst_0
      41: istore        6
      43: aload         4
      45: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        7
      52: aload         7
      54: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          124
      62: aload         7
      64: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        8
      71: aload         5
      73: aload         8
      75: checkcast     #52                 // class java/lang/String
      78: astore        9
      80: astore        31
      82: iconst_0
      83: istore        10
      85: aload         9
      87: checkcast     #54                 // class java/lang/CharSequence
      90: iconst_1
      91: anewarray     #52                 // class java/lang/String
      94: astore        11
      96: aload         11
      98: iconst_0
      99: ldc           #56                 // String ,
     101: aastore
     102: aload         11
     104: iconst_0
     105: iconst_0
     106: bipush        6
     108: aconst_null
     109: invokestatic  #62                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     112: aload         31
     114: swap
     115: invokeinterface #66,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     120: pop
     121: goto          52
     124: aload         5
     126: checkcast     #68                 // class java/util/List
     129: nop
     130: astore_2
     131: iconst_0
     132: istore_3
     133: iconst_0
     134: istore        4
     136: iload_3
     137: istore        5
     139: aload_2
     140: invokeinterface #71,  1           // InterfaceMethod java/util/List.isEmpty:()Z
     145: ifne          481
     148: aload_2
     149: aload_2
     150: invokeinterface #75,  1           // InterfaceMethod java/util/List.size:()I
     155: invokeinterface #79,  2           // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;
     160: astore        6
     162: aload         6
     164: invokeinterface #84,  1           // InterfaceMethod java/util/ListIterator.hasPrevious:()Z
     169: ifeq          481
     172: aload         6
     174: invokeinterface #87,  1           // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;
     179: iload         5
     181: istore        7
     183: checkcast     #68                 // class java/util/List
     186: astore        8
     188: iconst_0
     189: istore        9
     191: aload         8
     193: checkcast     #22                 // class java/lang/Iterable
     196: astore        10
     198: nop
     199: iconst_0
     200: istore        11
     202: aload         10
     204: astore        12
     206: new           #24                 // class java/util/ArrayList
     209: dup
     210: aload         10
     212: bipush        10
     214: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     217: invokespecial #34                 // Method java/util/ArrayList."<init>":(I)V
     220: checkcast     #36                 // class java/util/Collection
     223: astore        13
     225: iconst_0
     226: istore        14
     228: aload         12
     230: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     235: astore        15
     237: aload         15
     239: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     244: ifeq          414
     247: aload         15
     249: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     254: astore        16
     256: aload         13
     258: aload         16
     260: checkcast     #52                 // class java/lang/String
     263: astore        17
     265: astore        18
     267: iconst_0
     268: istore        19
     270: aload         17
     272: checkcast     #54                 // class java/lang/CharSequence
     275: iconst_1
     276: anewarray     #52                 // class java/lang/String
     279: astore        20
     281: aload         20
     283: iconst_0
     284: ldc           #89                 // String -
     286: aastore
     287: aload         20
     289: iconst_0
     290: iconst_0
     291: bipush        6
     293: aconst_null
     294: invokestatic  #62                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     297: checkcast     #22                 // class java/lang/Iterable
     300: astore        20
     302: nop
     303: iconst_0
     304: istore        21
     306: aload         20
     308: astore        22
     310: new           #24                 // class java/util/ArrayList
     313: dup
     314: aload         20
     316: bipush        10
     318: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     321: invokespecial #34                 // Method java/util/ArrayList."<init>":(I)V
     324: checkcast     #36                 // class java/util/Collection
     327: astore        23
     329: iconst_0
     330: istore        24
     332: aload         22
     334: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     339: astore        25
     341: aload         25
     343: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     348: ifeq          395
     351: aload         25
     353: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     358: astore        26
     360: aload         23
     362: aload         26
     364: checkcast     #52                 // class java/lang/String
     367: astore        27
     369: astore        28
     371: iconst_0
     372: istore        29
     374: aload         27
     376: invokestatic  #95                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     379: nop
     380: invokestatic  #99                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     383: aload         28
     385: swap
     386: invokeinterface #66,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     391: pop
     392: goto          341
     395: aload         23
     397: checkcast     #68                 // class java/util/List
     400: nop
     401: nop
     402: aload         18
     404: swap
     405: invokeinterface #66,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     410: pop
     411: goto          237
     414: aload         13
     416: checkcast     #68                 // class java/util/List
     419: nop
     420: astore        30
     422: aload         30
     424: iconst_0
     425: invokeinterface #103,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     430: checkcast     #68                 // class java/util/List
     433: astore        10
     435: aload         30
     437: iconst_1
     438: invokeinterface #103,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     443: checkcast     #68                 // class java/util/List
     446: astore        11
     448: iload         7
     450: aload_1
     451: aload         10
     453: aload         11
     455: invokeinterface #109,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     460: checkcast     #111                // class java/lang/Boolean
     463: invokevirtual #114                // Method java/lang/Boolean.booleanValue:()Z
     466: ifeq          473
     469: iconst_1
     470: goto          474
     473: iconst_0
     474: iadd
     475: nop
     476: istore        5
     478: goto          162
     481: iload         5
     483: ireturn

  public static final boolean fullyContains(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #149                // String areaOne
       3: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #151                // String areaTwo
       9: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: nop
      13: aload_0
      14: invokestatic  #155                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      17: checkcast     #157                // class java/lang/Number
      20: invokevirtual #160                // Method java/lang/Number.intValue:()I
      23: aload_1
      24: invokestatic  #155                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      27: checkcast     #157                // class java/lang/Number
      30: invokevirtual #160                // Method java/lang/Number.intValue:()I
      33: if_icmplt     59
      36: aload_0
      37: invokestatic  #163                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      40: checkcast     #157                // class java/lang/Number
      43: invokevirtual #160                // Method java/lang/Number.intValue:()I
      46: aload_1
      47: invokestatic  #163                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      50: checkcast     #157                // class java/lang/Number
      53: invokevirtual #160                // Method java/lang/Number.intValue:()I
      56: if_icmple     105
      59: aload_1
      60: invokestatic  #155                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      63: checkcast     #157                // class java/lang/Number
      66: invokevirtual #160                // Method java/lang/Number.intValue:()I
      69: aload_0
      70: invokestatic  #155                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      73: checkcast     #157                // class java/lang/Number
      76: invokevirtual #160                // Method java/lang/Number.intValue:()I
      79: if_icmplt     109
      82: aload_1
      83: invokestatic  #163                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      86: checkcast     #157                // class java/lang/Number
      89: invokevirtual #160                // Method java/lang/Number.intValue:()I
      92: aload_0
      93: invokestatic  #163                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      96: checkcast     #157                // class java/lang/Number
      99: invokevirtual #160                // Method java/lang/Number.intValue:()I
     102: if_icmpgt     109
     105: iconst_1
     106: goto          110
     109: iconst_0
     110: ireturn

  public static final boolean partiallyContains(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #149                // String areaOne
       3: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #151                // String areaTwo
       9: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #166                // class kotlin/ranges/IntRange
      15: dup
      16: aload_0
      17: invokestatic  #155                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      20: checkcast     #157                // class java/lang/Number
      23: invokevirtual #160                // Method java/lang/Number.intValue:()I
      26: aload_0
      27: invokestatic  #163                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      30: checkcast     #157                // class java/lang/Number
      33: invokevirtual #160                // Method java/lang/Number.intValue:()I
      36: invokespecial #169                // Method kotlin/ranges/IntRange."<init>":(II)V
      39: checkcast     #22                 // class java/lang/Iterable
      42: invokestatic  #173                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
      45: checkcast     #22                 // class java/lang/Iterable
      48: new           #166                // class kotlin/ranges/IntRange
      51: dup
      52: aload_1
      53: invokestatic  #155                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      56: checkcast     #157                // class java/lang/Number
      59: invokevirtual #160                // Method java/lang/Number.intValue:()I
      62: aload_1
      63: invokestatic  #163                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      66: checkcast     #157                // class java/lang/Number
      69: invokevirtual #160                // Method java/lang/Number.intValue:()I
      72: invokespecial #169                // Method kotlin/ranges/IntRange."<init>":(II)V
      75: checkcast     #22                 // class java/lang/Iterable
      78: invokestatic  #173                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
      81: checkcast     #22                 // class java/lang/Iterable
      84: invokestatic  #177                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      87: invokeinterface #180,  1          // InterfaceMethod java/util/Set.size:()I
      92: iconst_1
      93: if_icmplt     100
      96: iconst_1
      97: goto          101
     100: iconst_0
     101: ireturn

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

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: getstatic     #194                // Field Day04Kt$main$part1$1.INSTANCE:LDay04Kt$main$part1$1;
       4: checkcast     #105                // class kotlin/jvm/functions/Function2
       7: invokestatic  #196                // Method contains:(Ljava/util/List;Lkotlin/jvm/functions/Function2;)I
      10: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: getstatic     #203                // Field Day04Kt$main$part2$1.INSTANCE:LDay04Kt$main$part2$1;
       4: checkcast     #105                // class kotlin/jvm/functions/Function2
       7: invokestatic  #196                // Method contains:(Ljava/util/List;Lkotlin/jvm/functions/Function2;)I
      10: ireturn
}

Compiled from "Day04.kt"
final class Day04Kt$main$part2$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.util.List<? extends java.lang.Integer>, java.util.List<? extends java.lang.Integer>, 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 Day04Kt
       4: ldc           #13                 // String partiallyContains
       6: ldc           #15                 // String partiallyContains(Ljava/util/List;Ljava/util/List;)Z
       8: iconst_1
       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(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #33                 // String p1
       9: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokestatic  #36                 // Method Day04Kt.partiallyContains:(Ljava/util/List;Ljava/util/List;)Z
      17: invokestatic  #42                 // 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     #46                 // class java/util/List
       5: aload_2
       6: checkcast     #46                 // class java/util/List
       9: invokevirtual #48                 // Method invoke:(Ljava/util/List;Ljava/util/List;)Ljava/lang/Boolean;
      12: areturn

  static {};
    Code:
       0: new           #2                  // class Day04Kt$main$part2$1
       3: dup
       4: invokespecial #53                 // Method "<init>":()V
       7: putstatic     #56                 // 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<java.util.List<? extends java.lang.Integer>, java.util.List<? extends java.lang.Integer>, 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 Day04Kt
       4: ldc           #13                 // String fullyContains
       6: ldc           #15                 // String fullyContains(Ljava/util/List;Ljava/util/List;)Z
       8: iconst_1
       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(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #33                 // String p1
       9: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokestatic  #36                 // Method Day04Kt.fullyContains:(Ljava/util/List;Ljava/util/List;)Z
      17: invokestatic  #42                 // 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     #46                 // class java/util/List
       5: aload_2
       6: checkcast     #46                 // class java/util/List
       9: invokevirtual #48                 // Method invoke:(Ljava/util/List;Ljava/util/List;)Ljava/lang/Boolean;
      12: areturn

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