import java.io.File
import kotlin.math.abs

fun main(args: Array<String>) {
    val lines = File("day5input.txt").reader()
    var coordinates = mutableListOf<List<Pair<Int, Int>>>()
    var size = 0
    lines.forEachLine { fileLine ->
        fileLine
            .split("->")
            .map { coordinates ->
                coordinates
                    .split(",")
                    .map { coordinate ->
                        Integer.parseInt(coordinate.filter { !it.isWhitespace() }).also { if (it > size) { size = it } }
                    }.let {
                        it.first() to it.last()
                    }
            }.let { coordinatePair ->
                if (coordinatePair.first().first == coordinatePair.last().first) {
                    val lowerEnd = minOf(coordinatePair.first().second, coordinatePair.last().second)
                    val higherEnd = maxOf(coordinatePair.first().second, coordinatePair.last().second)
                    return@let IntRange(lowerEnd, higherEnd).map {
                       coordinatePair.first().first to it
                    }
                }
                else if (coordinatePair.first().second == coordinatePair.last().second) {
                    val lowerEnd = minOf(coordinatePair.first().first, coordinatePair.last().first)
                    val higherEnd = maxOf(coordinatePair.first().first, coordinatePair.last().first)
                    return@let IntRange(lowerEnd, higherEnd).map {
                        it to coordinatePair.first().second
                    }
                }
                else {
                    val firstDistance = abs(coordinatePair.first().first - coordinatePair.last().first)
                    val secondDistance = abs(coordinatePair.first().second - coordinatePair.last().second)
                    if (firstDistance == secondDistance) {
                        val lowerFirst = minOf(coordinatePair.first().first, coordinatePair.last().first)
                        val higherFirst = maxOf(coordinatePair.first().first, coordinatePair.last().first)
                        val firstRange = IntRange(lowerFirst, higherFirst).toList()
                        val lowerSecond = minOf(coordinatePair.first().second, coordinatePair.last().second)
                        val higherSecond = maxOf(coordinatePair.first().second, coordinatePair.last().second)
                        val secondRange = IntRange(lowerSecond, higherSecond).toList()
                        val reverseFirst = coordinatePair.first().first != firstRange.first()
                        val reverseSecond = coordinatePair.first().second != secondRange.first()
                        return@let firstRange.mapIndexed { index, i ->
                            if (reverseFirst xor reverseSecond) {
                                i to secondRange[secondDistance - index]
                            } else {
                                i to secondRange[index]
                            }
                        }
                    }
                    else {
                        return@let emptyList()
                    }
                }
            }.let { coordinates.add(it) }

    }
    var area = Array(size+1) { IntArray(size+1) { 0 } }
    coordinates.flatten().forEach {
        area[it.second][it.first] = area[it.second][it.first] + 1
    }

    val hotpoints = area.map { it.filter { it > 1 } }.flatten().count().also { println(it) }
}

Compiled from "day5.kt"
public final class Day5Kt {
  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/io/File
       9: dup
      10: ldc           #19                 // String day5input.txt
      12: invokespecial #23                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      15: astore_2
      16: getstatic     #29                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      19: astore_3
      20: new           #31                 // class java/io/InputStreamReader
      23: dup
      24: new           #33                 // class java/io/FileInputStream
      27: dup
      28: aload_2
      29: invokespecial #36                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      32: checkcast     #38                 // class java/io/InputStream
      35: aload_3
      36: invokespecial #41                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      39: astore_1
      40: new           #43                 // class kotlin/jvm/internal/Ref$ObjectRef
      43: dup
      44: invokespecial #46                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
      47: astore_2
      48: aload_2
      49: new           #48                 // class java/util/ArrayList
      52: dup
      53: invokespecial #49                 // Method java/util/ArrayList."<init>":()V
      56: checkcast     #51                 // class java/util/List
      59: putfield      #55                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      62: new           #57                 // class kotlin/jvm/internal/Ref$IntRef
      65: dup
      66: invokespecial #58                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      69: astore_3
      70: aload_1
      71: checkcast     #60                 // class java/io/Reader
      74: aload_3
      75: aload_2
      76: invokedynamic #80,  0             // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/jvm/internal/Ref$ObjectRef;)Lkotlin/jvm/functions/Function1;
      81: invokestatic  #86                 // Method kotlin/io/TextStreamsKt.forEachLine:(Ljava/io/Reader;Lkotlin/jvm/functions/Function1;)V
      84: aconst_null
      85: astore        4
      87: iconst_0
      88: istore        5
      90: aload_3
      91: getfield      #89                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      94: iconst_1
      95: iadd
      96: istore        6
      98: iload         6
     100: anewarray     #91                 // class "[I"
     103: astore        7
     105: iload         5
     107: iload         6
     109: if_icmpge     177
     112: iload         5
     114: istore        8
     116: aload         7
     118: iload         8
     120: iconst_0
     121: istore        9
     123: aload_3
     124: getfield      #89                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     127: iconst_1
     128: iadd
     129: istore        10
     131: iload         10
     133: newarray       int
     135: astore        11
     137: istore        28
     139: astore        27
     141: iload         9
     143: iload         10
     145: if_icmpge     164
     148: iload         9
     150: istore        12
     152: aload         11
     154: iload         12
     156: iconst_0
     157: iastore
     158: iinc          9, 1
     161: goto          141
     164: aload         27
     166: iload         28
     168: aload         11
     170: aastore
     171: iinc          5, 1
     174: goto          105
     177: aload         7
     179: astore        4
     181: aload_2
     182: getfield      #55                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     185: checkcast     #93                 // class java/lang/Iterable
     188: invokestatic  #99                 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     191: checkcast     #93                 // class java/lang/Iterable
     194: astore        5
     196: iconst_0
     197: istore        6
     199: aload         5
     201: invokeinterface #103,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     206: astore        7
     208: aload         7
     210: invokeinterface #109,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     215: ifeq          302
     218: aload         7
     220: invokeinterface #113,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     225: astore        8
     227: aload         8
     229: checkcast     #115                // class kotlin/Pair
     232: astore        9
     234: iconst_0
     235: istore        10
     237: aload         4
     239: checkcast     #117                // class "[[I"
     242: aload         9
     244: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     247: checkcast     #122                // class java/lang/Number
     250: invokevirtual #126                // Method java/lang/Number.intValue:()I
     253: aaload
     254: aload         9
     256: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     259: checkcast     #122                // class java/lang/Number
     262: invokevirtual #126                // Method java/lang/Number.intValue:()I
     265: aload         4
     267: checkcast     #117                // class "[[I"
     270: aload         9
     272: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     275: checkcast     #122                // class java/lang/Number
     278: invokevirtual #126                // Method java/lang/Number.intValue:()I
     281: aaload
     282: aload         9
     284: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     287: checkcast     #122                // class java/lang/Number
     290: invokevirtual #126                // Method java/lang/Number.intValue:()I
     293: iaload
     294: iconst_1
     295: iadd
     296: iastore
     297: nop
     298: nop
     299: goto          208
     302: nop
     303: aload         4
     305: checkcast     #131                // class "[Ljava/lang/Object;"
     308: astore        6
     310: iconst_0
     311: istore        7
     313: aload         6
     315: astore        8
     317: new           #48                 // class java/util/ArrayList
     320: dup
     321: aload         6
     323: arraylength
     324: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
     327: checkcast     #136                // class java/util/Collection
     330: astore        9
     332: iconst_0
     333: istore        10
     335: iconst_0
     336: istore        11
     338: aload         8
     340: arraylength
     341: istore        12
     343: iload         11
     345: iload         12
     347: if_icmpge     481
     350: aload         8
     352: iload         11
     354: aaload
     355: astore        13
     357: aload         9
     359: aload         13
     361: checkcast     #91                 // class "[I"
     364: astore        14
     366: astore        26
     368: iconst_0
     369: istore        15
     371: aload         14
     373: astore        16
     375: iconst_0
     376: istore        17
     378: aload         16
     380: astore        18
     382: new           #48                 // class java/util/ArrayList
     385: dup
     386: invokespecial #49                 // Method java/util/ArrayList."<init>":()V
     389: checkcast     #136                // class java/util/Collection
     392: astore        19
     394: iconst_0
     395: istore        20
     397: iconst_0
     398: istore        21
     400: aload         18
     402: arraylength
     403: istore        22
     405: iload         21
     407: iload         22
     409: if_icmpge     459
     412: aload         18
     414: iload         21
     416: iaload
     417: istore        23
     419: iload         23
     421: istore        24
     423: iconst_0
     424: istore        25
     426: iload         24
     428: iconst_1
     429: if_icmple     436
     432: iconst_1
     433: goto          437
     436: iconst_0
     437: ifeq          453
     440: aload         19
     442: iload         23
     444: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     447: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     452: pop
     453: iinc          21, 1
     456: goto          405
     459: aload         19
     461: checkcast     #51                 // class java/util/List
     464: nop
     465: nop
     466: aload         26
     468: swap
     469: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     474: pop
     475: iinc          11, 1
     478: goto          343
     481: aload         9
     483: checkcast     #51                 // class java/util/List
     486: nop
     487: checkcast     #93                 // class java/lang/Iterable
     490: invokestatic  #99                 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     493: checkcast     #136                // class java/util/Collection
     496: invokeinterface #149,  1          // InterfaceMethod java/util/Collection.size:()I
     501: istore        6
     503: iload         6
     505: istore        7
     507: iconst_0
     508: istore        8
     510: getstatic     #155                // Field java/lang/System.out:Ljava/io/PrintStream;
     513: iload         7
     515: invokevirtual #160                // Method java/io/PrintStream.println:(I)V
     518: nop
     519: iload         6
     521: istore        5
     523: return

  private static final kotlin.Unit main$lambda$10(kotlin.jvm.internal.Ref$IntRef, kotlin.jvm.internal.Ref$ObjectRef, java.lang.String);
    Code:
       0: aload_2
       1: ldc           #193                // String fileLine
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: checkcast     #195                // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #197                // class java/lang/String
      14: astore_3
      15: aload_3
      16: iconst_0
      17: ldc           #199                // String ->
      19: aastore
      20: aload_3
      21: iconst_0
      22: iconst_0
      23: bipush        6
      25: aconst_null
      26: invokestatic  #205                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      29: checkcast     #93                 // class java/lang/Iterable
      32: astore_3
      33: nop
      34: iconst_0
      35: istore        4
      37: aload_3
      38: astore        5
      40: new           #48                 // class java/util/ArrayList
      43: dup
      44: aload_3
      45: bipush        10
      47: invokestatic  #209                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      50: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
      53: checkcast     #136                // class java/util/Collection
      56: astore        6
      58: iconst_0
      59: istore        7
      61: aload         5
      63: invokeinterface #103,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      68: astore        8
      70: aload         8
      72: invokeinterface #109,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      77: ifeq          396
      80: aload         8
      82: invokeinterface #113,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      87: astore        9
      89: aload         6
      91: aload         9
      93: checkcast     #197                // class java/lang/String
      96: astore        10
      98: astore        32
     100: iconst_0
     101: istore        11
     103: aload         10
     105: checkcast     #195                // class java/lang/CharSequence
     108: iconst_1
     109: anewarray     #197                // class java/lang/String
     112: astore        12
     114: aload         12
     116: iconst_0
     117: ldc           #211                // String ,
     119: aastore
     120: aload         12
     122: iconst_0
     123: iconst_0
     124: bipush        6
     126: aconst_null
     127: invokestatic  #205                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     130: checkcast     #93                 // class java/lang/Iterable
     133: astore        12
     135: nop
     136: iconst_0
     137: istore        13
     139: aload         12
     141: astore        14
     143: new           #48                 // class java/util/ArrayList
     146: dup
     147: aload         12
     149: bipush        10
     151: invokestatic  #209                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     154: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
     157: checkcast     #136                // class java/util/Collection
     160: astore        15
     162: iconst_0
     163: istore        16
     165: aload         14
     167: invokeinterface #103,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     172: astore        17
     174: aload         17
     176: invokeinterface #109,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     181: ifeq          358
     184: aload         17
     186: invokeinterface #113,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     191: astore        18
     193: aload         15
     195: aload         18
     197: checkcast     #197                // class java/lang/String
     200: astore        19
     202: astore        20
     204: iconst_0
     205: istore        21
     207: aload         19
     209: astore        22
     211: iconst_0
     212: istore        23
     214: aload         22
     216: checkcast     #195                // class java/lang/CharSequence
     219: astore        24
     221: new           #213                // class java/lang/StringBuilder
     224: dup
     225: invokespecial #214                // Method java/lang/StringBuilder."<init>":()V
     228: checkcast     #216                // class java/lang/Appendable
     231: astore        25
     233: iconst_0
     234: istore        26
     236: iconst_0
     237: istore        27
     239: aload         24
     241: invokeinterface #219,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     246: istore        28
     248: iload         27
     250: iload         28
     252: if_icmpge     305
     255: aload         24
     257: iload         27
     259: invokeinterface #223,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     264: istore        29
     266: iload         29
     268: istore        30
     270: iconst_0
     271: istore        31
     273: iload         30
     275: invokestatic  #229                // Method kotlin/text/CharsKt.isWhitespace:(C)Z
     278: ifne          285
     281: iconst_1
     282: goto          286
     285: iconst_0
     286: ifeq          299
     289: aload         25
     291: iload         29
     293: invokeinterface #233,  2          // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
     298: pop
     299: iinc          27, 1
     302: goto          248
     305: aload         25
     307: checkcast     #213                // class java/lang/StringBuilder
     310: invokevirtual #237                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     313: invokestatic  #241                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     316: istore        22
     318: iload         22
     320: istore        23
     322: iconst_0
     323: istore        24
     325: iload         23
     327: aload_0
     328: getfield      #89                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     331: if_icmple     340
     334: aload_0
     335: iload         23
     337: putfield      #89                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     340: iload         22
     342: nop
     343: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     346: aload         20
     348: swap
     349: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     354: pop
     355: goto          174
     358: aload         15
     360: checkcast     #51                 // class java/util/List
     363: nop
     364: astore        13
     366: iconst_0
     367: istore        14
     369: aload         13
     371: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     374: aload         13
     376: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     379: invokestatic  #254                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     382: nop
     383: nop
     384: aload         32
     386: swap
     387: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     392: pop
     393: goto          70
     396: aload         6
     398: checkcast     #51                 // class java/util/List
     401: nop
     402: astore        4
     404: iconst_0
     405: istore        5
     407: aload         4
     409: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     412: checkcast     #115                // class kotlin/Pair
     415: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     418: checkcast     #122                // class java/lang/Number
     421: invokevirtual #126                // Method java/lang/Number.intValue:()I
     424: aload         4
     426: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     429: checkcast     #115                // class kotlin/Pair
     432: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     435: checkcast     #122                // class java/lang/Number
     438: invokevirtual #126                // Method java/lang/Number.intValue:()I
     441: if_icmpne     647
     444: aload         4
     446: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     449: checkcast     #115                // class kotlin/Pair
     452: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     455: checkcast     #122                // class java/lang/Number
     458: invokevirtual #126                // Method java/lang/Number.intValue:()I
     461: aload         4
     463: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     466: checkcast     #115                // class kotlin/Pair
     469: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     472: checkcast     #122                // class java/lang/Number
     475: invokevirtual #126                // Method java/lang/Number.intValue:()I
     478: invokestatic  #260                // Method java/lang/Math.min:(II)I
     481: istore        6
     483: aload         4
     485: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     488: checkcast     #115                // class kotlin/Pair
     491: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     494: checkcast     #122                // class java/lang/Number
     497: invokevirtual #126                // Method java/lang/Number.intValue:()I
     500: aload         4
     502: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     505: checkcast     #115                // class kotlin/Pair
     508: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     511: checkcast     #122                // class java/lang/Number
     514: invokevirtual #126                // Method java/lang/Number.intValue:()I
     517: invokestatic  #263                // Method java/lang/Math.max:(II)I
     520: istore        7
     522: new           #265                // class kotlin/ranges/IntRange
     525: dup
     526: iload         6
     528: iload         7
     530: invokespecial #268                // Method kotlin/ranges/IntRange."<init>":(II)V
     533: checkcast     #93                 // class java/lang/Iterable
     536: astore        8
     538: iconst_0
     539: istore        9
     541: aload         8
     543: astore        10
     545: new           #48                 // class java/util/ArrayList
     548: dup
     549: aload         8
     551: bipush        10
     553: invokestatic  #209                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     556: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
     559: checkcast     #136                // class java/util/Collection
     562: astore        11
     564: iconst_0
     565: istore        12
     567: aload         10
     569: invokeinterface #103,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     574: astore        13
     576: aload         13
     578: invokeinterface #109,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     583: ifeq          638
     586: aload         13
     588: checkcast     #270                // class kotlin/collections/IntIterator
     591: invokevirtual #273                // Method kotlin/collections/IntIterator.nextInt:()I
     594: istore        14
     596: aload         11
     598: iload         14
     600: istore        15
     602: astore        16
     604: iconst_0
     605: istore        17
     607: aload         4
     609: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     612: checkcast     #115                // class kotlin/Pair
     615: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     618: iload         15
     620: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     623: invokestatic  #254                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     626: aload         16
     628: swap
     629: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     634: pop
     635: goto          576
     638: aload         11
     640: checkcast     #51                 // class java/util/List
     643: nop
     644: goto          1420
     647: aload         4
     649: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     652: checkcast     #115                // class kotlin/Pair
     655: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     658: checkcast     #122                // class java/lang/Number
     661: invokevirtual #126                // Method java/lang/Number.intValue:()I
     664: aload         4
     666: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     669: checkcast     #115                // class kotlin/Pair
     672: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     675: checkcast     #122                // class java/lang/Number
     678: invokevirtual #126                // Method java/lang/Number.intValue:()I
     681: if_icmpne     887
     684: aload         4
     686: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     689: checkcast     #115                // class kotlin/Pair
     692: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     695: checkcast     #122                // class java/lang/Number
     698: invokevirtual #126                // Method java/lang/Number.intValue:()I
     701: aload         4
     703: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     706: checkcast     #115                // class kotlin/Pair
     709: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     712: checkcast     #122                // class java/lang/Number
     715: invokevirtual #126                // Method java/lang/Number.intValue:()I
     718: invokestatic  #260                // Method java/lang/Math.min:(II)I
     721: istore        6
     723: aload         4
     725: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     728: checkcast     #115                // class kotlin/Pair
     731: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     734: checkcast     #122                // class java/lang/Number
     737: invokevirtual #126                // Method java/lang/Number.intValue:()I
     740: aload         4
     742: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     745: checkcast     #115                // class kotlin/Pair
     748: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     751: checkcast     #122                // class java/lang/Number
     754: invokevirtual #126                // Method java/lang/Number.intValue:()I
     757: invokestatic  #263                // Method java/lang/Math.max:(II)I
     760: istore        7
     762: new           #265                // class kotlin/ranges/IntRange
     765: dup
     766: iload         6
     768: iload         7
     770: invokespecial #268                // Method kotlin/ranges/IntRange."<init>":(II)V
     773: checkcast     #93                 // class java/lang/Iterable
     776: astore        8
     778: iconst_0
     779: istore        9
     781: aload         8
     783: astore        10
     785: new           #48                 // class java/util/ArrayList
     788: dup
     789: aload         8
     791: bipush        10
     793: invokestatic  #209                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     796: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
     799: checkcast     #136                // class java/util/Collection
     802: astore        11
     804: iconst_0
     805: istore        12
     807: aload         10
     809: invokeinterface #103,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     814: astore        13
     816: aload         13
     818: invokeinterface #109,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     823: ifeq          878
     826: aload         13
     828: checkcast     #270                // class kotlin/collections/IntIterator
     831: invokevirtual #273                // Method kotlin/collections/IntIterator.nextInt:()I
     834: istore        14
     836: aload         11
     838: iload         14
     840: istore        15
     842: astore        16
     844: iconst_0
     845: istore        17
     847: iload         15
     849: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     852: aload         4
     854: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     857: checkcast     #115                // class kotlin/Pair
     860: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     863: invokestatic  #254                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     866: aload         16
     868: swap
     869: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     874: pop
     875: goto          816
     878: aload         11
     880: checkcast     #51                 // class java/util/List
     883: nop
     884: goto          1420
     887: aload         4
     889: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     892: checkcast     #115                // class kotlin/Pair
     895: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     898: checkcast     #122                // class java/lang/Number
     901: invokevirtual #126                // Method java/lang/Number.intValue:()I
     904: aload         4
     906: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     909: checkcast     #115                // class kotlin/Pair
     912: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     915: checkcast     #122                // class java/lang/Number
     918: invokevirtual #126                // Method java/lang/Number.intValue:()I
     921: isub
     922: invokestatic  #277                // Method java/lang/Math.abs:(I)I
     925: istore        6
     927: aload         4
     929: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     932: checkcast     #115                // class kotlin/Pair
     935: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     938: checkcast     #122                // class java/lang/Number
     941: invokevirtual #126                // Method java/lang/Number.intValue:()I
     944: aload         4
     946: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     949: checkcast     #115                // class kotlin/Pair
     952: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     955: checkcast     #122                // class java/lang/Number
     958: invokevirtual #126                // Method java/lang/Number.intValue:()I
     961: isub
     962: invokestatic  #277                // Method java/lang/Math.abs:(I)I
     965: istore        7
     967: iload         6
     969: iload         7
     971: if_icmpne     1417
     974: aload         4
     976: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     979: checkcast     #115                // class kotlin/Pair
     982: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     985: checkcast     #122                // class java/lang/Number
     988: invokevirtual #126                // Method java/lang/Number.intValue:()I
     991: aload         4
     993: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     996: checkcast     #115                // class kotlin/Pair
     999: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1002: checkcast     #122                // class java/lang/Number
    1005: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1008: invokestatic  #260                // Method java/lang/Math.min:(II)I
    1011: istore        8
    1013: aload         4
    1015: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1018: checkcast     #115                // class kotlin/Pair
    1021: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1024: checkcast     #122                // class java/lang/Number
    1027: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1030: aload         4
    1032: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
    1035: checkcast     #115                // class kotlin/Pair
    1038: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1041: checkcast     #122                // class java/lang/Number
    1044: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1047: invokestatic  #263                // Method java/lang/Math.max:(II)I
    1050: istore        9
    1052: new           #265                // class kotlin/ranges/IntRange
    1055: dup
    1056: iload         8
    1058: iload         9
    1060: invokespecial #268                // Method kotlin/ranges/IntRange."<init>":(II)V
    1063: checkcast     #93                 // class java/lang/Iterable
    1066: invokestatic  #280                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
    1069: astore        10
    1071: aload         4
    1073: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1076: checkcast     #115                // class kotlin/Pair
    1079: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1082: checkcast     #122                // class java/lang/Number
    1085: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1088: aload         4
    1090: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
    1093: checkcast     #115                // class kotlin/Pair
    1096: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1099: checkcast     #122                // class java/lang/Number
    1102: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1105: invokestatic  #260                // Method java/lang/Math.min:(II)I
    1108: istore        11
    1110: aload         4
    1112: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1115: checkcast     #115                // class kotlin/Pair
    1118: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1121: checkcast     #122                // class java/lang/Number
    1124: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1127: aload         4
    1129: invokestatic  #248                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
    1132: checkcast     #115                // class kotlin/Pair
    1135: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1138: checkcast     #122                // class java/lang/Number
    1141: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1144: invokestatic  #263                // Method java/lang/Math.max:(II)I
    1147: istore        12
    1149: new           #265                // class kotlin/ranges/IntRange
    1152: dup
    1153: iload         11
    1155: iload         12
    1157: invokespecial #268                // Method kotlin/ranges/IntRange."<init>":(II)V
    1160: checkcast     #93                 // class java/lang/Iterable
    1163: invokestatic  #280                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
    1166: astore        13
    1168: aload         4
    1170: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1173: checkcast     #115                // class kotlin/Pair
    1176: invokevirtual #129                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1179: checkcast     #122                // class java/lang/Number
    1182: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1185: aload         10
    1187: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1190: checkcast     #122                // class java/lang/Number
    1193: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1196: if_icmpeq     1203
    1199: iconst_1
    1200: goto          1204
    1203: iconst_0
    1204: istore        14
    1206: aload         4
    1208: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1211: checkcast     #115                // class kotlin/Pair
    1214: invokevirtual #120                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1217: checkcast     #122                // class java/lang/Number
    1220: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1223: aload         13
    1225: invokestatic  #245                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
    1228: checkcast     #122                // class java/lang/Number
    1231: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1234: if_icmpeq     1241
    1237: iconst_1
    1238: goto          1242
    1241: iconst_0
    1242: istore        15
    1244: aload         10
    1246: checkcast     #93                 // class java/lang/Iterable
    1249: astore        17
    1251: iconst_0
    1252: istore        18
    1254: aload         17
    1256: astore        19
    1258: new           #48                 // class java/util/ArrayList
    1261: dup
    1262: aload         17
    1264: bipush        10
    1266: invokestatic  #209                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1269: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
    1272: checkcast     #136                // class java/util/Collection
    1275: astore        20
    1277: iconst_0
    1278: istore        21
    1280: iconst_0
    1281: istore        22
    1283: aload         19
    1285: invokeinterface #103,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1290: astore        23
    1292: aload         23
    1294: invokeinterface #109,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
    1299: ifeq          1408
    1302: aload         23
    1304: invokeinterface #113,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1309: astore        24
    1311: aload         20
    1313: iload         22
    1315: iinc          22, 1
    1318: istore        25
    1320: iload         25
    1322: ifge          1328
    1325: invokestatic  #283                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
    1328: iload         25
    1330: aload         24
    1332: checkcast     #122                // class java/lang/Number
    1335: invokevirtual #126                // Method java/lang/Number.intValue:()I
    1338: istore        26
    1340: istore        27
    1342: astore        16
    1344: iconst_0
    1345: istore        28
    1347: iload         14
    1349: iload         15
    1351: ixor
    1352: ifeq          1378
    1355: iload         26
    1357: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1360: aload         13
    1362: iload         7
    1364: iload         27
    1366: isub
    1367: invokeinterface #287,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1372: invokestatic  #254                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
    1375: goto          1395
    1378: iload         26
    1380: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1383: aload         13
    1385: iload         27
    1387: invokeinterface #287,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1392: invokestatic  #254                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
    1395: nop
    1396: aload         16
    1398: swap
    1399: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1404: pop
    1405: goto          1292
    1408: aload         20
    1410: checkcast     #51                 // class java/util/List
    1413: nop
    1414: goto          1420
    1417: invokestatic  #291                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
    1420: nop
    1421: astore        4
    1423: iconst_0
    1424: istore        5
    1426: aload_1
    1427: getfield      #55                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
    1430: checkcast     #51                 // class java/util/List
    1433: aload         4
    1435: invokeinterface #292,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    1440: pop
    1441: nop
    1442: getstatic     #298                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
    1445: areturn
}


Pleiterson__desafios-bootcamps-dio__003eda6/Kotlin/Solucionando problemas em Kotlin/PrimoRapido.kt

// Primo Rápido

/*
Mariazinha sabe que um Número Primo é aquele que pode ser dividido somente por
1 (um) e por ele mesmo. Por exemplo, o número 7 é primo, pois pode ser dividido
apenas pelo número 1 e pelo número 7 sem que haja resto. Então ela pediu para
você fazer um programa que aceite diversos valores e diga se cada um destes
valores é primo ou não. Acontece que a paciência não é uma das virtudes de
Mariazinha, portanto ela quer que a execução de todos os casos de teste que ela
selecionar (instâncias) aconteçam no tempo máximo de um segundo, pois ela odeia
esperar.

- Entrada

A primeira linha da entrada contém um inteiro N (1 ≤ N ≤ 200), correspondente
ao número de casos de teste. Seguem N linhas, cada uma contendo um valor
inteiro X (1 < X < 231) que pode ser ou não, um número primo.

- Saída

Para cada caso de teste imprima a mensagem “Prime” (Primo) ou “Not Prime” (Não
Primo), de acordo com o exemplo abaixo.
*/
import kotlin.math.sqrt

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    for (i in 0 until n) {
        val x = readLine()!!.toDouble()
        val prime = isPrime(x)
        print(prime)
    }
}

fun print(prime: Boolean) {
    if (prime) {
        print("Prime\n")
    } else print("Not Prime\n")
}

fun isPrime(num: Double): Boolean {
    if (num < 2) return false
    if (num % 2 == 0.0) return num == 2.0

    val root = sqrt(num).toInt()
    var i = 3

    while (i <= root) {
        if (num % i == 0.0) return false
        i += 2
    }
    return true
}

Compiled from "PrimoRapido.kt"
public final class PrimoRapidoKt {
  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: invokestatic  #21                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       9: dup
      10: invokestatic  #25                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      13: invokestatic  #31                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      16: istore_1
      17: iconst_0
      18: istore_2
      19: iload_2
      20: iload_1
      21: if_icmpge     52
      24: invokestatic  #21                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      27: dup
      28: invokestatic  #25                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      31: invokestatic  #37                 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
      34: dstore_3
      35: dload_3
      36: invokestatic  #41                 // Method isPrime:(D)Z
      39: istore        5
      41: iload         5
      43: invokestatic  #45                 // Method print:(Z)V
      46: iinc          2, 1
      49: goto          19
      52: return

  public static final void print(boolean);
    Code:
       0: iload_0
       1: ifeq          16
       4: ldc           #55                 // String Prime\n
       6: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
       9: swap
      10: invokevirtual #65                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      13: goto          25
      16: ldc           #67                 // String Not Prime\n
      18: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
      21: swap
      22: invokevirtual #65                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      25: return

  public static final boolean isPrime(double);
    Code:
       0: dload_0
       1: ldc2_w        #68                 // double 2.0d
       4: dcmpg
       5: ifge          10
       8: iconst_0
       9: ireturn
      10: dload_0
      11: iconst_2
      12: i2d
      13: drem
      14: dconst_0
      15: dcmpg
      16: ifne          23
      19: iconst_1
      20: goto          24
      23: iconst_0
      24: ifeq          41
      27: dload_0
      28: ldc2_w        #68                 // double 2.0d
      31: dcmpg
      32: ifne          39
      35: iconst_1
      36: goto          40
      39: iconst_0
      40: ireturn
      41: dload_0
      42: invokestatic  #75                 // Method java/lang/Math.sqrt:(D)D
      45: d2i
      46: istore_2
      47: iconst_3
      48: istore_3
      49: iload_3
      50: iload_2
      51: if_icmpgt     79
      54: dload_0
      55: iload_3
      56: i2d
      57: drem
      58: dconst_0
      59: dcmpg
      60: ifne          67
      63: iconst_1
      64: goto          68
      67: iconst_0
      68: ifeq          73
      71: iconst_0
      72: ireturn
      73: iinc          3, 2
      76: goto          49
      79: iconst_1
      80: ireturn
}


Pleiterson__desafios-bootcamps-dio__003eda6/Kotlin/Solucionando problemas em Kotlin/Figurinhas.kt

// Figurinhas

/*
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() }

            if(input.size == 2){
                val valorMdc = mdc(input[0], input[1])
                lista.add(valorMdc)
            }
    }

    for (i in lista){
        println(i)
    }
}

// máximo divisor comum (chamada recursiva)
fun mdc(n1: Int, n2: Int): Int {
    var resto: Int
    var n1 = n1
    var n2 = n2

    do{
        resto = n1%n2
        n1 = n2
        n2 = resto
    }while (resto != 0)

    return n1
}

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     239
      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: invokeinterface #90,  1           // InterfaceMethod java/util/List.size:()I
     179: iconst_2
     180: if_icmpne     228
     183: aload         4
     185: iconst_0
     186: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     191: checkcast     #96                 // class java/lang/Number
     194: invokevirtual #99                 // Method java/lang/Number.intValue:()I
     197: aload         4
     199: iconst_1
     200: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     205: checkcast     #96                 // class java/lang/Number
     208: invokevirtual #99                 // Method java/lang/Number.intValue:()I
     211: invokestatic  #103                // Method mdc:(II)I
     214: istore        5
     216: aload_1
     217: iload         5
     219: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     222: invokeinterface #104,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     227: pop
     228: iload_2
     229: iload_3
     230: if_icmpeq     239
     233: iinc          2, 1
     236: goto          35
     239: aload_1
     240: invokeinterface #105,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     245: astore_2
     246: aload_2
     247: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     252: ifeq          278
     255: aload_2
     256: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     261: checkcast     #96                 // class java/lang/Number
     264: invokevirtual #99                 // Method java/lang/Number.intValue:()I
     267: istore_3
     268: getstatic     #111                // Field java/lang/System.out:Ljava/io/PrintStream;
     271: iload_3
     272: invokevirtual #116                // Method java/io/PrintStream.println:(I)V
     275: goto          246
     278: return

  public static final int mdc(int, int);
    Code:
       0: iconst_0
       1: istore_2
       2: iload_0
       3: istore_3
       4: iload_1
       5: istore        4
       7: iload_3
       8: iload         4
      10: irem
      11: istore_2
      12: iload         4
      14: istore_3
      15: iload_2
      16: istore        4
      18: iload_2
      19: ifne          7
      22: iload_3
      23: ireturn
}


import java.lang.Integer.min
import java.util.*

/*
KOTLIN PROGRAM TO FIND THE ROWS WITH MINIMUM NUMBER OF 1s
INPUT FORMAT :
number of rows and number of column
||THE ARRAY ||
OUTPUT FORMAT:
ith row which has the least number of 1s
the elements of row which has the least number of 1s
INPUT:
5 4
1 1 1 2
1 1 5 2
0 0 1 1
1 1 2 2
1 0 1 1
OUTPUT:
2 row:
1 1 5 2
3 row:
0 0 1 1
4 row:
1 1 2 2
Time complexity : O(N^2);
Space complexity : O(N^2);
*/
fun main() {
    val scanner = Scanner(System.`in`)
    val noOfRows: Int = scanner.nextInt()
    val noOfColumns: Int = scanner.nextInt()
    val array = Array(noOfRows) { IntArray(noOfColumns) }
    val noOf1sPerRow = IntArray(noOfRows) { 0 }
    readInputArray(array, noOfRows, noOfColumns)
    val minNoOf1s = findMin1s(array, noOfRows, noOf1sPerRow)
    printRowsWithMin1s(array, minNoOf1s, noOf1sPerRow)
}

fun readInputArray(array: Array<IntArray>, noOfRows: Int, noOfColumns: Int) {
    val scanner = Scanner(System.`in`)
    for (rowIndex in 0 until noOfRows) {
        for (columnIndex in 0 until noOfColumns) {
            array[rowIndex][columnIndex] = scanner.nextInt()
        }
    }
}

fun findMin1s(array: Array<IntArray>, noOfRows: Int, noOf1sPerRow: IntArray): Int {
    var minNoOf1s = Int.MAX_VALUE;
    for (i in 0 until noOfRows) {
        noOf1sPerRow[i] = array[i].fold(0) { prev, curr -> prev + (if (curr == 1) 1 else 0) }
        minNoOf1s = min(minNoOf1s, noOf1sPerRow[i])
    }
    return minNoOf1s;
}

fun printRowsWithMin1s(array: Array<IntArray>, minNoOf1s: Int, noOf1sPerRow: IntArray) {
    for (i in array.indices) {
        if (minNoOf1s == noOf1sPerRow[i]) {
            println("${i + 1} row:")
            println(array[i].joinToString(" "))
        }
    }
}

Compiled from "min_number_of_1.kt"
public final class Min_number_of_1Kt {
  public static final void main();
    Code:
       0: new           #8                  // class java/util/Scanner
       3: dup
       4: getstatic     #14                 // Field java/lang/System.in:Ljava/io/InputStream;
       7: invokespecial #18                 // Method java/util/Scanner."<init>":(Ljava/io/InputStream;)V
      10: astore_0
      11: aload_0
      12: invokevirtual #22                 // Method java/util/Scanner.nextInt:()I
      15: istore_1
      16: aload_0
      17: invokevirtual #22                 // Method java/util/Scanner.nextInt:()I
      20: istore_2
      21: iconst_0
      22: istore        4
      24: iload_1
      25: anewarray     #24                 // class "[I"
      28: astore        5
      30: iload         4
      32: iload_1
      33: if_icmpge     54
      36: iload         4
      38: istore        6
      40: aload         5
      42: iload         6
      44: iload_2
      45: newarray       int
      47: aastore
      48: iinc          4, 1
      51: goto          30
      54: aload         5
      56: astore_3
      57: iconst_0
      58: istore        5
      60: iload_1
      61: newarray       int
      63: astore        6
      65: iload         5
      67: iload_1
      68: if_icmpge     87
      71: iload         5
      73: istore        7
      75: aload         6
      77: iload         7
      79: iconst_0
      80: iastore
      81: iinc          5, 1
      84: goto          65
      87: aload         6
      89: astore        4
      91: aload_3
      92: iload_1
      93: iload_2
      94: invokestatic  #28                 // Method readInputArray:([[III)V
      97: aload_3
      98: iload_1
      99: aload         4
     101: invokestatic  #32                 // Method findMin1s:([[II[I)I
     104: istore        5
     106: aload_3
     107: iload         5
     109: aload         4
     111: invokestatic  #36                 // Method printRowsWithMin1s:([[II[I)V
     114: return

  public static final void readInputArray(int[][], int, int);
    Code:
       0: aload_0
       1: ldc           #48                 // String array
       3: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #8                  // class java/util/Scanner
       9: dup
      10: getstatic     #14                 // Field java/lang/System.in:Ljava/io/InputStream;
      13: invokespecial #18                 // Method java/util/Scanner."<init>":(Ljava/io/InputStream;)V
      16: astore_3
      17: iconst_0
      18: istore        4
      20: iload         4
      22: iload_1
      23: if_icmpge     58
      26: iconst_0
      27: istore        5
      29: iload         5
      31: iload_2
      32: if_icmpge     52
      35: aload_0
      36: iload         4
      38: aaload
      39: iload         5
      41: aload_3
      42: invokevirtual #22                 // Method java/util/Scanner.nextInt:()I
      45: iastore
      46: iinc          5, 1
      49: goto          29
      52: iinc          4, 1
      55: goto          20
      58: return

  public static final int findMin1s(int[][], int, int[]);
    Code:
       0: aload_0
       1: ldc           #48                 // String array
       3: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #57                 // String noOf1sPerRow
       9: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: ldc           #58                 // int 2147483647
      14: istore_3
      15: iconst_0
      16: istore        4
      18: iload         4
      20: iload_1
      21: if_icmpge     128
      24: aload_2
      25: iload         4
      27: aload_0
      28: iload         4
      30: aaload
      31: astore        5
      33: iconst_0
      34: istore        6
      36: istore        16
      38: astore        15
      40: iconst_0
      41: istore        7
      43: iload         6
      45: istore        8
      47: iconst_0
      48: istore        9
      50: aload         5
      52: arraylength
      53: istore        10
      55: iload         9
      57: iload         10
      59: if_icmpge     102
      62: aload         5
      64: iload         9
      66: iaload
      67: istore        11
      69: iload         8
      71: iload         11
      73: istore        12
      75: istore        13
      77: iconst_0
      78: istore        14
      80: iload         13
      82: iload         12
      84: iconst_1
      85: if_icmpne     92
      88: iconst_1
      89: goto          93
      92: iconst_0
      93: iadd
      94: istore        8
      96: iinc          9, 1
      99: goto          55
     102: iload         8
     104: istore        17
     106: aload         15
     108: iload         16
     110: iload         17
     112: iastore
     113: iload_3
     114: aload_2
     115: iload         4
     117: iaload
     118: invokestatic  #64                 // Method java/lang/Integer.min:(II)I
     121: istore_3
     122: iinc          4, 1
     125: goto          18
     128: iload_3
     129: ireturn

  public static final void printRowsWithMin1s(int[][], int, int[]);
    Code:
       0: aload_0
       1: ldc           #48                 // String array
       3: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #57                 // String noOf1sPerRow
       9: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_3
      14: aload_0
      15: checkcast     #75                 // class "[Ljava/lang/Object;"
      18: arraylength
      19: istore        4
      21: iload_3
      22: iload         4
      24: if_icmpge     94
      27: iload_1
      28: aload_2
      29: iload_3
      30: iaload
      31: if_icmpne     88
      34: new           #77                 // class java/lang/StringBuilder
      37: dup
      38: invokespecial #79                 // Method java/lang/StringBuilder."<init>":()V
      41: iload_3
      42: iconst_1
      43: iadd
      44: invokevirtual #83                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      47: ldc           #85                 // String  row:
      49: invokevirtual #88                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      52: invokevirtual #92                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      55: getstatic     #96                 // Field java/lang/System.out:Ljava/io/PrintStream;
      58: swap
      59: invokevirtual #102                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      62: aload_0
      63: iload_3
      64: aaload
      65: ldc           #104                // String
      67: checkcast     #106                // class java/lang/CharSequence
      70: aconst_null
      71: aconst_null
      72: iconst_0
      73: aconst_null
      74: aconst_null
      75: bipush        62
      77: aconst_null
      78: invokestatic  #112                // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      81: getstatic     #96                 // Field java/lang/System.out:Ljava/io/PrintStream;
      84: swap
      85: invokevirtual #102                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      88: iinc          3, 1
      91: goto          21
      94: return

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


import java.util.*

/*
Sample Input & Output :
---------------------
The first line of the input contains an integer 'n' denoting the size of the array
The second line of the input contains 'n' no integers
SAMPLE INPUT & OUTPUT 1
INPUT :
4
98 76 54 32
OUTPUT :
32 54 76 98
SAMPLE INPUT & OUTPUT 2
INPUT :
5
45 45 23 65 12
OUTPUT:
12 23 45 45 65
------------------------
Time Complexity :
Best Case Complexity - O(n*logn)
Worst Case Complexity - O(n2)
------------------------
Space Complexity :
The space complexity of quicksort is O(n*logn)
*/
class QuickSort(private val array: IntArray) {
    private fun partition(start: Int, end: Int): Int {
        val pivot: Int = array[end] // pivot is the last element
        var i = start - 1;
        /**
         * At start of each iteration, array will satisfy following
         *  elements less than or equal to pivot are between start index and ith index
         *  elements greater than pivot are between (i + 1)th index and (j - 1)th index
         */
        for (j in start until end) {
            if (array[j] <= pivot) {
                i += 1
                swap(i, j)
            }
        }
        swap(i + 1, end); // After this swap pivot will get to its sorted position
        return i + 1;
    }

    private fun swap(index1: Int, index2: Int) {
        array[index1] = array[index2].also { array[index2] = array[index1] }
    }

    fun sort(start: Int, end: Int) {
        if (start < end) {
            val partitionIndex = partition(start, end);
            sort(start, partitionIndex - 1)
            sort(partitionIndex + 1, end)
        }
    }

    fun printElements() {
        println(array.joinToString(" "))
    }
}

fun main() {
    val scanner = Scanner(System.`in`)
    val noOfElements = scanner.nextInt()
    val array = IntArray(noOfElements)
    readInputArray(array, scanner)
    val quickSort = QuickSort(array)
    quickSort.sort(0, array.size - 1)
    quickSort.printElements()
}

fun readInputArray(array: IntArray, scanner: Scanner) {
    for (i in array.indices) {
        array[i] = scanner.nextInt()
    }
}

Compiled from "QuickSort.kt"
public final class QuickSort {
  private final int[] array;

  public QuickSort(int[]);
    Code:
       0: aload_1
       1: ldc           #9                  // String array
       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 array:[I
      15: return

  private final int partition(int, int);
    Code:
       0: aload_0
       1: getfield      #21                 // Field array:[I
       4: iload_2
       5: iaload
       6: istore_3
       7: iload_1
       8: iconst_1
       9: isub
      10: istore        4
      12: iload_1
      13: istore        5
      15: iload         5
      17: iload_2
      18: if_icmpge     49
      21: aload_0
      22: getfield      #21                 // Field array:[I
      25: iload         5
      27: iaload
      28: iload_3
      29: if_icmpgt     43
      32: iinc          4, 1
      35: aload_0
      36: iload         4
      38: iload         5
      40: invokespecial #29                 // Method swap:(II)V
      43: iinc          5, 1
      46: goto          15
      49: aload_0
      50: iload         4
      52: iconst_1
      53: iadd
      54: iload_2
      55: invokespecial #29                 // Method swap:(II)V
      58: iload         4
      60: iconst_1
      61: iadd
      62: ireturn

  private final void swap(int, int);
    Code:
       0: aload_0
       1: getfield      #21                 // Field array:[I
       4: iload_1
       5: aload_0
       6: getfield      #21                 // Field array:[I
       9: iload_2
      10: iaload
      11: istore_3
      12: iload_3
      13: istore        4
      15: istore        7
      17: astore        6
      19: iconst_0
      20: istore        5
      22: aload_0
      23: getfield      #21                 // Field array:[I
      26: iload_2
      27: aload_0
      28: getfield      #21                 // Field array:[I
      31: iload_1
      32: iaload
      33: iastore
      34: getstatic     #41                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      37: astore        8
      39: aload         6
      41: iload         7
      43: iload_3
      44: iastore
      45: return

  public final void sort(int, int);
    Code:
       0: iload_1
       1: iload_2
       2: if_icmpge     28
       5: aload_0
       6: iload_1
       7: iload_2
       8: invokespecial #48                 // Method partition:(II)I
      11: istore_3
      12: aload_0
      13: iload_1
      14: iload_3
      15: iconst_1
      16: isub
      17: invokevirtual #50                 // Method sort:(II)V
      20: aload_0
      21: iload_3
      22: iconst_1
      23: iadd
      24: iload_2
      25: invokevirtual #50                 // Method sort:(II)V
      28: return

  public final void printElements();
    Code:
       0: aload_0
       1: getfield      #21                 // Field array:[I
       4: ldc           #54                 // String
       6: checkcast     #56                 // class java/lang/CharSequence
       9: aconst_null
      10: aconst_null
      11: iconst_0
      12: aconst_null
      13: aconst_null
      14: bipush        62
      16: aconst_null
      17: invokestatic  #62                 // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      20: getstatic     #68                 // Field java/lang/System.out:Ljava/io/PrintStream;
      23: swap
      24: invokevirtual #74                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      27: return
}

Compiled from "QuickSort.kt"
public final class QuickSortKt {
  public static final void main();
    Code:
       0: new           #8                  // class java/util/Scanner
       3: dup
       4: getstatic     #14                 // Field java/lang/System.in:Ljava/io/InputStream;
       7: invokespecial #18                 // Method java/util/Scanner."<init>":(Ljava/io/InputStream;)V
      10: astore_0
      11: aload_0
      12: invokevirtual #22                 // Method java/util/Scanner.nextInt:()I
      15: istore_1
      16: iload_1
      17: newarray       int
      19: astore_2
      20: aload_2
      21: aload_0
      22: invokestatic  #26                 // Method readInputArray:([ILjava/util/Scanner;)V
      25: new           #28                 // class QuickSort
      28: dup
      29: aload_2
      30: invokespecial #31                 // Method QuickSort."<init>":([I)V
      33: astore_3
      34: aload_3
      35: iconst_0
      36: aload_2
      37: arraylength
      38: iconst_1
      39: isub
      40: invokevirtual #35                 // Method QuickSort.sort:(II)V
      43: aload_3
      44: invokevirtual #38                 // Method QuickSort.printElements:()V
      47: return

  public static final void readInputArray(int[], java.util.Scanner);
    Code:
       0: aload_0
       1: ldc           #48                 // String array
       3: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #55                 // String scanner
       9: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_2
      14: aload_0
      15: arraylength
      16: istore_3
      17: iload_2
      18: iload_3
      19: if_icmpge     35
      22: aload_0
      23: iload_2
      24: aload_1
      25: invokevirtual #22                 // Method java/util/Scanner.nextInt:()I
      28: iastore
      29: iinc          2, 1
      32: goto          17
      35: return

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


import java.io.File

fun main(){

    val numberOfCommonPairs = File("src/Day04.txt")
        .readText()
        .split("\n")
        .flatMap { it.lines() }
        .sumOf {
            val split = it.split(",")
            overLappingAssignmentPair(split[0].split("-"), split[1].split("-"))
        }

    println(numberOfCommonPairs)

}

fun pairsInRangeOfEachOther(firstPair: List<String>,secondPair: List<String>) : Int{
    val firstPairInsideSecond = firstPair[0].toInt() >= secondPair[0].toInt() && firstPair[1].toInt() <= secondPair[1].toInt()
    val secondPairInsideFirst = secondPair[0].toInt() >= firstPair[0].toInt() && secondPair[1].toInt() <= firstPair[1].toInt()
    return if (firstPairInsideSecond.or(secondPairInsideFirst))
        1
    else
        0
}

fun overLappingAssignmentPair(firstPair: List<String>,secondPair: List<String>) : Int{
    val firstPairOverlappingSecond = firstPair[0].toInt() in secondPair[0].toInt()..secondPair[1].toInt() || firstPair[1].toInt() in secondPair[0].toInt()..secondPair[1].toInt()
    val secondPairOverlappingFirst = secondPair[0].toInt() in firstPair[0].toInt()..firstPair[1].toInt() || secondPair[1].toInt() in firstPair[0].toInt()..firstPair[1].toInt()
    return if (firstPairOverlappingSecond.or(secondPairOverlappingFirst))
        1
    else
        0
}

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main();
    Code:
       0: new           #8                  // class java/io/File
       3: dup
       4: ldc           #10                 // String src/Day04.txt
       6: invokespecial #14                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #20                 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;
      15: checkcast     #22                 // class java/lang/CharSequence
      18: iconst_1
      19: anewarray     #24                 // class java/lang/String
      22: astore_1
      23: aload_1
      24: iconst_0
      25: ldc           #26                 // String \n
      27: aastore
      28: aload_1
      29: iconst_0
      30: iconst_0
      31: bipush        6
      33: aconst_null
      34: invokestatic  #32                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      37: checkcast     #34                 // class java/lang/Iterable
      40: astore_1
      41: nop
      42: iconst_0
      43: istore_2
      44: aload_1
      45: astore_3
      46: new           #36                 // class java/util/ArrayList
      49: dup
      50: invokespecial #38                 // Method java/util/ArrayList."<init>":()V
      53: checkcast     #40                 // class java/util/Collection
      56: astore        4
      58: iconst_0
      59: istore        5
      61: aload_3
      62: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      67: astore        6
      69: aload         6
      71: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      76: ifeq          122
      79: aload         6
      81: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      86: astore        7
      88: aload         7
      90: checkcast     #24                 // class java/lang/String
      93: astore        8
      95: iconst_0
      96: istore        9
      98: aload         8
     100: checkcast     #22                 // class java/lang/CharSequence
     103: invokestatic  #58                 // Method kotlin/text/StringsKt.lines:(Ljava/lang/CharSequence;)Ljava/util/List;
     106: checkcast     #34                 // class java/lang/Iterable
     109: astore        8
     111: aload         4
     113: aload         8
     115: invokestatic  #64                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     118: pop
     119: goto          69
     122: aload         4
     124: checkcast     #66                 // class java/util/List
     127: nop
     128: checkcast     #34                 // class java/lang/Iterable
     131: astore_1
     132: iconst_0
     133: istore_2
     134: aload_1
     135: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     140: astore_3
     141: aload_3
     142: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     147: ifeq          280
     150: aload_3
     151: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     156: astore        4
     158: iload_2
     159: aload         4
     161: checkcast     #24                 // class java/lang/String
     164: astore        5
     166: istore        10
     168: iconst_0
     169: istore        6
     171: aload         5
     173: checkcast     #22                 // class java/lang/CharSequence
     176: iconst_1
     177: anewarray     #24                 // class java/lang/String
     180: astore        7
     182: aload         7
     184: iconst_0
     185: ldc           #68                 // String ,
     187: aastore
     188: aload         7
     190: iconst_0
     191: iconst_0
     192: bipush        6
     194: aconst_null
     195: invokestatic  #32                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     198: astore        8
     200: aload         8
     202: iconst_0
     203: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     208: checkcast     #22                 // class java/lang/CharSequence
     211: iconst_1
     212: anewarray     #24                 // class java/lang/String
     215: astore        7
     217: aload         7
     219: iconst_0
     220: ldc           #74                 // String -
     222: aastore
     223: aload         7
     225: iconst_0
     226: iconst_0
     227: bipush        6
     229: aconst_null
     230: invokestatic  #32                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     233: aload         8
     235: iconst_1
     236: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     241: checkcast     #22                 // class java/lang/CharSequence
     244: iconst_1
     245: anewarray     #24                 // class java/lang/String
     248: astore        7
     250: aload         7
     252: iconst_0
     253: ldc           #74                 // String -
     255: aastore
     256: aload         7
     258: iconst_0
     259: iconst_0
     260: bipush        6
     262: aconst_null
     263: invokestatic  #32                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     266: invokestatic  #78                 // Method overLappingAssignmentPair:(Ljava/util/List;Ljava/util/List;)I
     269: istore        11
     271: iload         10
     273: iload         11
     275: iadd
     276: istore_2
     277: goto          141
     280: iload_2
     281: istore_0
     282: getstatic     #84                 // Field java/lang/System.out:Ljava/io/PrintStream;
     285: iload_0
     286: invokevirtual #90                 // Method java/io/PrintStream.println:(I)V
     289: return

  public static final int pairsInRangeOfEachOther(java.util.List<java.lang.String>, java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #113                // String firstPair
       3: invokestatic  #119                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #121                // String secondPair
       9: invokestatic  #119                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: iconst_0
      14: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      19: checkcast     #24                 // class java/lang/String
      22: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      25: aload_1
      26: iconst_0
      27: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      32: checkcast     #24                 // class java/lang/String
      35: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      38: if_icmplt     74
      41: aload_0
      42: iconst_1
      43: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      48: checkcast     #24                 // class java/lang/String
      51: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      54: aload_1
      55: iconst_1
      56: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      61: checkcast     #24                 // class java/lang/String
      64: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      67: if_icmpgt     74
      70: iconst_1
      71: goto          75
      74: iconst_0
      75: istore_2
      76: aload_1
      77: iconst_0
      78: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      83: checkcast     #24                 // class java/lang/String
      86: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      89: aload_0
      90: iconst_0
      91: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      96: checkcast     #24                 // class java/lang/String
      99: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     102: if_icmplt     138
     105: aload_1
     106: iconst_1
     107: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     112: checkcast     #24                 // class java/lang/String
     115: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     118: aload_0
     119: iconst_1
     120: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     125: checkcast     #24                 // class java/lang/String
     128: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     131: if_icmpgt     138
     134: iconst_1
     135: goto          139
     138: iconst_0
     139: istore_3
     140: iload_2
     141: iload_3
     142: ior
     143: ifeq          150
     146: iconst_1
     147: goto          151
     150: iconst_0
     151: ireturn

  public static final int overLappingAssignmentPair(java.util.List<java.lang.String>, java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #113                // String firstPair
       3: invokestatic  #119                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #121                // String secondPair
       9: invokestatic  #119                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: iconst_0
      14: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      19: checkcast     #24                 // class java/lang/String
      22: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      25: istore_3
      26: aload_1
      27: iconst_1
      28: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      33: checkcast     #24                 // class java/lang/String
      36: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      39: istore        4
      41: aload_0
      42: iconst_0
      43: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      48: checkcast     #24                 // class java/lang/String
      51: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      54: istore        5
      56: iload_3
      57: iload         5
      59: if_icmpgt     77
      62: iload         5
      64: iload         4
      66: if_icmpgt     73
      69: iconst_1
      70: goto          78
      73: iconst_0
      74: goto          78
      77: iconst_0
      78: ifne          150
      81: aload_1
      82: iconst_0
      83: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      88: checkcast     #24                 // class java/lang/String
      91: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      94: istore_3
      95: aload_1
      96: iconst_1
      97: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     102: checkcast     #24                 // class java/lang/String
     105: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     108: istore        4
     110: aload_0
     111: iconst_1
     112: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     117: checkcast     #24                 // class java/lang/String
     120: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     123: istore        5
     125: iload_3
     126: iload         5
     128: if_icmpgt     146
     131: iload         5
     133: iload         4
     135: if_icmpgt     142
     138: iconst_1
     139: goto          147
     142: iconst_0
     143: goto          147
     146: iconst_0
     147: ifeq          154
     150: iconst_1
     151: goto          155
     154: iconst_0
     155: istore_2
     156: aload_0
     157: iconst_0
     158: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     163: checkcast     #24                 // class java/lang/String
     166: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     169: istore        4
     171: aload_0
     172: iconst_1
     173: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     178: checkcast     #24                 // class java/lang/String
     181: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     184: istore        5
     186: aload_1
     187: iconst_0
     188: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     193: checkcast     #24                 // class java/lang/String
     196: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     199: istore        6
     201: iload         4
     203: iload         6
     205: if_icmpgt     223
     208: iload         6
     210: iload         5
     212: if_icmpgt     219
     215: iconst_1
     216: goto          224
     219: iconst_0
     220: goto          224
     223: iconst_0
     224: ifne          298
     227: aload_0
     228: iconst_0
     229: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     234: checkcast     #24                 // class java/lang/String
     237: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     240: istore        4
     242: aload_0
     243: iconst_1
     244: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     249: checkcast     #24                 // class java/lang/String
     252: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     255: istore        5
     257: aload_1
     258: iconst_1
     259: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     264: checkcast     #24                 // class java/lang/String
     267: invokestatic  #127                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     270: istore        6
     272: iload         4
     274: iload         6
     276: if_icmpgt     294
     279: iload         6
     281: iload         5
     283: if_icmpgt     290
     286: iconst_1
     287: goto          295
     290: iconst_0
     291: goto          295
     294: iconst_0
     295: ifeq          302
     298: iconst_1
     299: goto          303
     302: iconst_0
     303: istore_3
     304: iload_2
     305: iload_3
     306: ior
     307: ifeq          314
     310: iconst_1
     311: goto          315
     314: iconst_0
     315: ireturn

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