/**
 * Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
 * You may assume that each input would have exactly one solution, and you may not use the same element twice.
 * You can return the answer in any order.
 *
 * Example 1:

 * Input: nums = [2,7,11,15], target = 9
 * Output: [0,1]
 * Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
 * Example 2:
 *
 * Input: nums = [3,2,4], target = 6
 * Output: [1,2]
 * Example 3:
 *
 * Input: nums = [3,3], target = 6
 * Output: [0,1]
 *
 * Main.kt run
 * println(
 * twoSumBest(
 * nums = intArrayOf(7, 5, 10, 2),
 * target = 12
 * ).contentToString()
 * )
 */

//My solution
fun twoSum(nums: IntArray, target: Int): IntArray {
    var result : IntArray = intArrayOf()
    nums.forEachIndexed { index, item ->
        val numberWeLook = target - item
        if(nums.contains(numberWeLook) && index != nums.indexOf(numberWeLook)) {
            result = intArrayOf(index, nums.indexOf(numberWeLook))
            return result
        }
    }
    return result
}

//Alternative solution
fun twoSumBest(nums: IntArray, target: Int): IntArray {
    val diffMap = mutableMapOf<Int, Int>()
    nums.forEachIndexed { index, int ->
        diffMap[int]?.let { return intArrayOf(it, index) }
        diffMap[target - int] = index
    }
    return intArrayOf()
}

Compiled from "TwoSum.kt"
public final class TwoSumKt {
  public static final int[] twoSum(int[], int);
    Code:
       0: aload_0
       1: ldc           #9                  // String nums
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aconst_null
       7: astore_2
       8: iconst_0
       9: newarray       int
      11: astore_2
      12: aload_0
      13: astore_3
      14: iconst_0
      15: istore        4
      17: iconst_0
      18: istore        5
      20: iconst_0
      21: istore        6
      23: aload_3
      24: arraylength
      25: istore        7
      27: iload         6
      29: iload         7
      31: if_icmpge     114
      34: aload_3
      35: iload         6
      37: iaload
      38: istore        8
      40: iload         5
      42: iinc          5, 1
      45: iload         8
      47: istore        9
      49: istore        10
      51: iconst_0
      52: istore        11
      54: iload_1
      55: iload         9
      57: isub
      58: istore        12
      60: aload_0
      61: iload         12
      63: invokestatic  #21                 // Method kotlin/collections/ArraysKt.contains:([II)Z
      66: ifeq          106
      69: iload         10
      71: aload_0
      72: iload         12
      74: invokestatic  #25                 // Method kotlin/collections/ArraysKt.indexOf:([II)I
      77: if_icmpeq     106
      80: iconst_2
      81: newarray       int
      83: astore        13
      85: aload         13
      87: iconst_0
      88: iload         10
      90: iastore
      91: aload         13
      93: iconst_1
      94: aload_0
      95: iload         12
      97: invokestatic  #25                 // Method kotlin/collections/ArraysKt.indexOf:([II)I
     100: iastore
     101: aload         13
     103: astore_2
     104: aload_2
     105: areturn
     106: nop
     107: nop
     108: iinc          6, 1
     111: goto          27
     114: nop
     115: aload_2
     116: areturn

  public static final int[] twoSumBest(int[], int);
    Code:
       0: aload_0
       1: ldc           #9                  // String nums
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #42                 // class java/util/LinkedHashMap
       9: dup
      10: invokespecial #46                 // Method java/util/LinkedHashMap."<init>":()V
      13: checkcast     #48                 // class java/util/Map
      16: astore_2
      17: aload_0
      18: astore_3
      19: iconst_0
      20: istore        4
      22: iconst_0
      23: istore        5
      25: iconst_0
      26: istore        6
      28: aload_3
      29: arraylength
      30: istore        7
      32: iload         6
      34: iload         7
      36: if_icmpge     140
      39: aload_3
      40: iload         6
      42: iaload
      43: istore        8
      45: iload         5
      47: iinc          5, 1
      50: iload         8
      52: istore        9
      54: istore        10
      56: iconst_0
      57: istore        11
      59: aload_2
      60: iload         9
      62: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      65: invokeinterface #58,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      70: checkcast     #50                 // class java/lang/Integer
      73: dup
      74: ifnull        108
      77: checkcast     #60                 // class java/lang/Number
      80: invokevirtual #64                 // Method java/lang/Number.intValue:()I
      83: istore        12
      85: iconst_0
      86: istore        13
      88: iconst_2
      89: newarray       int
      91: astore        14
      93: aload         14
      95: iconst_0
      96: iload         12
      98: iastore
      99: aload         14
     101: iconst_1
     102: iload         10
     104: iastore
     105: aload         14
     107: areturn
     108: pop
     109: iload         10
     111: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     114: astore        12
     116: aload_2
     117: iload_1
     118: iload         9
     120: isub
     121: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     124: aload         12
     126: invokeinterface #68,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     131: pop
     132: nop
     133: nop
     134: iinc          6, 1
     137: goto          32
     140: nop
     141: iconst_0
     142: newarray       int
     144: areturn
}


typealias CategoryMap<K, V> = Set<Map<K, V>>
typealias IncludePath = String
/** Descending level */
typealias Level = /*Comparable*/ Int

class DescendAllocator(private var max: Int = Int.MAX_VALUE) {
  fun less() = max--
}

val kmap: CategoryMap<IncludePath, Level> = DescendAllocator().run { setOf(
  mapOf(
    "QObject" to less(),
    "QScopedPointer" to less(),
    "QByteArray" to less()
  ),
  mapOf(
    "QIODevice" to less(),
    "QTimer" to less(),
    "QAudioOutput" to less()
  ),
  mapOf(
    "QMainWindow" to less(),
    "QLabel" to less(),
    "QComboBox" to less(),
    "QPushButton" to less(),
    "QSlider" to less()
  )
)
}

fun <T, K> Iterable<T>.histogram(key: (T) -> K): Map<K, List<T>> {
  val hist: MutableMap<K, MutableList<T>> = mutableMapOf()
  for (item in this) { hist.getOrPut(key(item), ::mutableListOf).add(item) }
  return hist
}

object SortInclude {
  @JvmStatic
  fun main(vararg arg: String) {
    val code = readText()
    val includes = parse(code)
    println(includes)
    println(dump(organize(includes)))
  }
  fun dump(includes: Set<List<IncludePath>>): String {
    return includes.map { it.joinToString("\n") }.joinToString("\n\n")
  }
  private fun parse(includeCode: String): List<IncludePath>
    = includeCode.lines().map { includeRegex.matchEntire(it)
        ?.groupValues?.get(1) ?: error(it) }
  private val includeRegex = Regex("#include <(.*)>")
  fun organize(includes: List<IncludePath>): Set<List<IncludePath>> {
    val parted = includes.histogram { kmap.find { m -> it in m } ?: homeless }
    val sorted = parted.map { val (m, inz) = it;
      inz.sortedByDescending(m::getValue) }
    return sorted.toSet()
  }
  private val homeless: Map<IncludePath, Level> = emptyMap()
}

fun readText(): String {
  val text = StringBuilder()
  while (true) {
    val line = readLine()
    if (line == ".") break
    else text.append(line).append("\n")
  }
  text.delete(text.lastIndex, text.lastIndex.inc()) //"\n"
  return text.toString()
}

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

  private static final kotlin.text.Regex includeRegex;

  private static final java.util.Map<java.lang.String, java.lang.Integer> homeless;

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

  public static final void main(java.lang.String...);
    Code:
       0: aload_0
       1: ldc           #16                 // String arg
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: invokestatic  #28                 // Method SortIncludeKt.readText:()Ljava/lang/String;
       9: astore_1
      10: getstatic     #31                 // Field INSTANCE:LSortInclude;
      13: aload_1
      14: invokespecial #35                 // Method parse:(Ljava/lang/String;)Ljava/util/List;
      17: astore_2
      18: getstatic     #41                 // Field java/lang/System.out:Ljava/io/PrintStream;
      21: aload_2
      22: invokevirtual #47                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      25: getstatic     #31                 // Field INSTANCE:LSortInclude;
      28: getstatic     #31                 // Field INSTANCE:LSortInclude;
      31: aload_2
      32: invokevirtual #51                 // Method organize:(Ljava/util/List;)Ljava/util/Set;
      35: invokevirtual #55                 // Method dump:(Ljava/util/Set;)Ljava/lang/String;
      38: getstatic     #41                 // Field java/lang/System.out:Ljava/io/PrintStream;
      41: swap
      42: invokevirtual #47                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      45: return

  public final java.lang.String dump(java.util.Set<? extends java.util.List<java.lang.String>>);
    Code:
       0: aload_1
       1: ldc           #62                 // String includes
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #64                 // class java/lang/Iterable
      10: astore_2
      11: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #66                 // class java/util/ArrayList
      19: dup
      20: aload_2
      21: bipush        10
      23: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      26: invokespecial #75                 // Method java/util/ArrayList."<init>":(I)V
      29: checkcast     #77                 // class java/util/Collection
      32: astore        5
      34: iconst_0
      35: istore        6
      37: aload         4
      39: invokeinterface #81,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      44: astore        7
      46: aload         7
      48: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          112
      56: aload         7
      58: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      63: astore        8
      65: aload         5
      67: aload         8
      69: checkcast     #93                 // class java/util/List
      72: astore        9
      74: astore        11
      76: iconst_0
      77: istore        10
      79: aload         9
      81: checkcast     #64                 // class java/lang/Iterable
      84: ldc           #95                 // String \n
      86: checkcast     #97                 // class java/lang/CharSequence
      89: aconst_null
      90: aconst_null
      91: iconst_0
      92: aconst_null
      93: aconst_null
      94: bipush        62
      96: aconst_null
      97: invokestatic  #101                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     100: aload         11
     102: swap
     103: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     108: pop
     109: goto          46
     112: aload         5
     114: checkcast     #93                 // class java/util/List
     117: nop
     118: checkcast     #64                 // class java/lang/Iterable
     121: ldc           #107                // String \n\n
     123: checkcast     #97                 // class java/lang/CharSequence
     126: aconst_null
     127: aconst_null
     128: iconst_0
     129: aconst_null
     130: aconst_null
     131: bipush        62
     133: aconst_null
     134: invokestatic  #101                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     137: areturn

  private final java.util.List<java.lang.String> parse(java.lang.String);
    Code:
       0: aload_1
       1: checkcast     #97                 // class java/lang/CharSequence
       4: invokestatic  #129                // Method kotlin/text/StringsKt.lines:(Ljava/lang/CharSequence;)Ljava/util/List;
       7: checkcast     #64                 // class java/lang/Iterable
      10: astore_2
      11: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #66                 // class java/util/ArrayList
      19: dup
      20: aload_2
      21: bipush        10
      23: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      26: invokespecial #75                 // Method java/util/ArrayList."<init>":(I)V
      29: checkcast     #77                 // class java/util/Collection
      32: astore        5
      34: iconst_0
      35: istore        6
      37: aload         4
      39: invokeinterface #81,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      44: astore        7
      46: aload         7
      48: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          159
      56: aload         7
      58: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      63: astore        8
      65: aload         5
      67: aload         8
      69: checkcast     #131                // class java/lang/String
      72: astore        9
      74: astore        14
      76: iconst_0
      77: istore        10
      79: getstatic     #135                // Field includeRegex:Lkotlin/text/Regex;
      82: aload         9
      84: checkcast     #97                 // class java/lang/CharSequence
      87: invokevirtual #141                // Method kotlin/text/Regex.matchEntire:(Ljava/lang/CharSequence;)Lkotlin/text/MatchResult;
      90: astore        11
      92: aload         11
      94: ifnull        134
      97: aload         11
      99: invokeinterface #147,  1          // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     104: astore        12
     106: aload         12
     108: ifnull        134
     111: aload         12
     113: iconst_1
     114: invokeinterface #151,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     119: checkcast     #131                // class java/lang/String
     122: astore        13
     124: aload         13
     126: ifnull        134
     129: aload         13
     131: goto          147
     134: new           #153                // class java/lang/IllegalStateException
     137: dup
     138: aload         9
     140: invokevirtual #156                // Method java/lang/Object.toString:()Ljava/lang/String;
     143: invokespecial #159                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     146: athrow
     147: aload         14
     149: swap
     150: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     155: pop
     156: goto          46
     159: aload         5
     161: checkcast     #93                 // class java/util/List
     164: nop
     165: areturn

  public final java.util.Set<java.util.List<java.lang.String>> organize(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #62                 // String includes
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #64                 // class java/lang/Iterable
      10: invokedynamic #181,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      15: invokestatic  #185                // Method SortIncludeKt.histogram:(Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/util/Map;
      18: astore_2
      19: aload_2
      20: astore        4
      22: iconst_0
      23: istore        5
      25: aload         4
      27: astore        6
      29: new           #66                 // class java/util/ArrayList
      32: dup
      33: aload         4
      35: invokeinterface #191,  1          // InterfaceMethod java/util/Map.size:()I
      40: invokespecial #75                 // Method java/util/ArrayList."<init>":(I)V
      43: checkcast     #77                 // class java/util/Collection
      46: astore        7
      48: iconst_0
      49: istore        8
      51: aload         6
      53: invokeinterface #195,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      58: invokeinterface #196,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      63: astore        9
      65: aload         9
      67: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      72: ifeq          162
      75: aload         9
      77: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      82: checkcast     #198                // class java/util/Map$Entry
      85: astore        10
      87: aload         7
      89: aload         10
      91: astore        11
      93: astore        17
      95: iconst_0
      96: istore        12
      98: aload         11
     100: invokeinterface #201,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     105: checkcast     #187                // class java/util/Map
     108: astore        13
     110: aload         11
     112: invokeinterface #204,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     117: checkcast     #93                 // class java/util/List
     120: astore        14
     122: aload         14
     124: checkcast     #64                 // class java/lang/Iterable
     127: astore        15
     129: iconst_0
     130: istore        16
     132: aload         15
     134: new           #206                // class SortInclude$organize$lambda$4$$inlined$sortedByDescending$1
     137: dup
     138: aload         13
     140: invokespecial #209                // Method SortInclude$organize$lambda$4$$inlined$sortedByDescending$1."<init>":(Ljava/util/Map;)V
     143: checkcast     #211                // class java/util/Comparator
     146: invokestatic  #215                // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     149: nop
     150: aload         17
     152: swap
     153: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     158: pop
     159: goto          65
     162: aload         7
     164: checkcast     #93                 // class java/util/List
     167: nop
     168: astore_3
     169: aload_3
     170: checkcast     #64                 // class java/lang/Iterable
     173: invokestatic  #219                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     176: areturn

  private static final java.util.Map organize$lambda$3(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #229                // String it
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: invokestatic  #232                // Method SortIncludeKt.getKmap:()Ljava/util/Set;
       9: checkcast     #64                 // class java/lang/Iterable
      12: astore_1
      13: aload_1
      14: invokeinterface #81,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      19: astore_2
      20: aload_2
      21: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      26: ifeq          61
      29: aload_2
      30: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      35: astore_3
      36: aload_3
      37: checkcast     #187                // class java/util/Map
      40: astore        4
      42: iconst_0
      43: istore        5
      45: aload         4
      47: aload_0
      48: invokeinterface #235,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
      53: nop
      54: ifeq          20
      57: aload_3
      58: goto          62
      61: aconst_null
      62: checkcast     #187                // class java/util/Map
      65: dup
      66: ifnonnull     73
      69: pop
      70: getstatic     #238                // Field homeless:Ljava/util/Map;
      73: areturn

  static {};
    Code:
       0: new           #2                  // class SortInclude
       3: dup
       4: invokespecial #241                // Method "<init>":()V
       7: putstatic     #31                 // Field INSTANCE:LSortInclude;
      10: new           #137                // class kotlin/text/Regex
      13: dup
      14: ldc           #243                // String #include <(.*)>
      16: invokespecial #244                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      19: putstatic     #135                // Field includeRegex:Lkotlin/text/Regex;
      22: invokestatic  #250                // Method kotlin/collections/MapsKt.emptyMap:()Ljava/util/Map;
      25: putstatic     #238                // Field homeless:Ljava/util/Map;
      28: return
}

Compiled from "SortInclude.kt"
public final class SortIncludeKt {
  private static final java.util.Set<java.util.Map<java.lang.String, java.lang.Integer>> kmap;

  public static final java.util.Set<java.util.Map<java.lang.String, java.lang.Integer>> getKmap();
    Code:
       0: getstatic     #12                 // Field kmap:Ljava/util/Set;
       3: areturn

  public static final <T, K> java.util.Map<K, java.util.List<T>> histogram(java.lang.Iterable<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends K>);
    Code:
       0: aload_0
       1: ldc           #17                 // String <this>
       3: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #25                 // String key
       9: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #27                 // class java/util/LinkedHashMap
      15: dup
      16: invokespecial #31                 // Method java/util/LinkedHashMap."<init>":()V
      19: checkcast     #33                 // class java/util/Map
      22: astore_2
      23: aload_0
      24: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      29: astore_3
      30: aload_3
      31: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifeq          129
      39: aload_3
      40: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: astore        4
      47: aload_2
      48: astore        5
      50: aload_1
      51: aload         4
      53: invokeinterface #55,  2           // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      58: astore        6
      60: iconst_0
      61: istore        7
      63: aload         5
      65: aload         6
      67: invokeinterface #58,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      72: astore        8
      74: aload         8
      76: ifnonnull     112
      79: iconst_0
      80: istore        9
      82: new           #60                 // class java/util/ArrayList
      85: dup
      86: invokespecial #61                 // Method java/util/ArrayList."<init>":()V
      89: checkcast     #63                 // class java/util/List
      92: nop
      93: astore        9
      95: aload         5
      97: aload         6
      99: aload         9
     101: invokeinterface #67,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     106: pop
     107: aload         9
     109: goto          114
     112: aload         8
     114: nop
     115: checkcast     #63                 // class java/util/List
     118: aload         4
     120: invokeinterface #71,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     125: pop
     126: goto          30
     129: aload_2
     130: areturn

  public static final java.lang.String readText();
    Code:
       0: new           #89                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #90                 // Method java/lang/StringBuilder."<init>":()V
       7: astore_0
       8: nop
       9: invokestatic  #95                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      12: astore_1
      13: aload_1
      14: ldc           #97                 // String .
      16: invokestatic  #101                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      19: ifne          36
      22: aload_0
      23: aload_1
      24: invokevirtual #105                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: ldc           #107                // String \n
      29: invokevirtual #105                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      32: pop
      33: goto          8
      36: aload_0
      37: aload_0
      38: checkcast     #109                // class java/lang/CharSequence
      41: invokestatic  #115                // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I
      44: aload_0
      45: checkcast     #109                // class java/lang/CharSequence
      48: invokestatic  #115                // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I
      51: iconst_1
      52: iadd
      53: invokevirtual #119                // Method java/lang/StringBuilder.delete:(II)Ljava/lang/StringBuilder;
      56: pop
      57: aload_0
      58: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      61: dup
      62: ldc           #124                // String toString(...)
      64: invokestatic  #127                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      67: areturn

  static {};
    Code:
       0: new           #136                // class DescendAllocator
       3: dup
       4: iconst_0
       5: iconst_1
       6: aconst_null
       7: invokespecial #139                // Method DescendAllocator."<init>":(IILkotlin/jvm/internal/DefaultConstructorMarker;)V
      10: astore_0
      11: iconst_0
      12: istore_1
      13: iconst_3
      14: anewarray     #33                 // class java/util/Map
      17: astore_2
      18: aload_2
      19: iconst_0
      20: iconst_3
      21: anewarray     #141                // class kotlin/Pair
      24: astore_3
      25: aload_3
      26: iconst_0
      27: ldc           #143                // String QObject
      29: aload_0
      30: invokevirtual #147                // Method DescendAllocator.less:()I
      33: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      36: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      39: aastore
      40: aload_3
      41: iconst_1
      42: ldc           #161                // String QScopedPointer
      44: aload_0
      45: invokevirtual #147                // Method DescendAllocator.less:()I
      48: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      51: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      54: aastore
      55: aload_3
      56: iconst_2
      57: ldc           #163                // String QByteArray
      59: aload_0
      60: invokevirtual #147                // Method DescendAllocator.less:()I
      63: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      66: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      69: aastore
      70: aload_3
      71: invokestatic  #169                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
      74: aastore
      75: aload_2
      76: iconst_1
      77: iconst_3
      78: anewarray     #141                // class kotlin/Pair
      81: astore_3
      82: aload_3
      83: iconst_0
      84: ldc           #171                // String QIODevice
      86: aload_0
      87: invokevirtual #147                // Method DescendAllocator.less:()I
      90: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      93: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      96: aastore
      97: aload_3
      98: iconst_1
      99: ldc           #173                // String QTimer
     101: aload_0
     102: invokevirtual #147                // Method DescendAllocator.less:()I
     105: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     108: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     111: aastore
     112: aload_3
     113: iconst_2
     114: ldc           #175                // String QAudioOutput
     116: aload_0
     117: invokevirtual #147                // Method DescendAllocator.less:()I
     120: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     123: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     126: aastore
     127: aload_3
     128: invokestatic  #169                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     131: aastore
     132: aload_2
     133: iconst_2
     134: iconst_5
     135: anewarray     #141                // class kotlin/Pair
     138: astore_3
     139: aload_3
     140: iconst_0
     141: ldc           #177                // String QMainWindow
     143: aload_0
     144: invokevirtual #147                // Method DescendAllocator.less:()I
     147: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     150: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     153: aastore
     154: aload_3
     155: iconst_1
     156: ldc           #179                // String QLabel
     158: aload_0
     159: invokevirtual #147                // Method DescendAllocator.less:()I
     162: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     165: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     168: aastore
     169: aload_3
     170: iconst_2
     171: ldc           #181                // String QComboBox
     173: aload_0
     174: invokevirtual #147                // Method DescendAllocator.less:()I
     177: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     180: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     183: aastore
     184: aload_3
     185: iconst_3
     186: ldc           #183                // String QPushButton
     188: aload_0
     189: invokevirtual #147                // Method DescendAllocator.less:()I
     192: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     195: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     198: aastore
     199: aload_3
     200: iconst_4
     201: ldc           #185                // String QSlider
     203: aload_0
     204: invokevirtual #147                // Method DescendAllocator.less:()I
     207: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     210: invokestatic  #159                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     213: aastore
     214: aload_3
     215: invokestatic  #169                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     218: aastore
     219: aload_2
     220: invokestatic  #191                // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;
     223: nop
     224: nop
     225: putstatic     #12                 // Field kmap:Ljava/util/Set;
     228: return
}

Compiled from "Comparisons.kt"
public final class SortInclude$organize$lambda$4$$inlined$sortedByDescending$1<T> implements java.util.Comparator {
  final java.util.Map $receiver$inlined;

  public SortInclude$organize$lambda$4$$inlined$sortedByDescending$1(java.util.Map);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #18                 // Field $receiver$inlined:Ljava/util/Map;
       5: aload_0
       6: invokespecial #21                 // Method java/lang/Object."<init>":()V
       9: return

  public final int compare(T, T);
    Code:
       0: aload_2
       1: checkcast     #28                 // class java/lang/String
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_0
       9: getfield      #18                 // Field $receiver$inlined:Ljava/util/Map;
      12: aload_3
      13: invokestatic  #34                 // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
      16: checkcast     #36                 // class java/lang/Number
      19: invokevirtual #40                 // Method java/lang/Number.intValue:()I
      22: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: checkcast     #48                 // class java/lang/Comparable
      28: aload_1
      29: checkcast     #28                 // class java/lang/String
      32: astore_3
      33: astore        5
      35: iconst_0
      36: istore        4
      38: aload_0
      39: getfield      #18                 // Field $receiver$inlined:Ljava/util/Map;
      42: aload_3
      43: invokestatic  #34                 // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
      46: checkcast     #36                 // class java/lang/Number
      49: invokevirtual #40                 // Method java/lang/Number.intValue:()I
      52: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      55: aload         5
      57: swap
      58: checkcast     #48                 // class java/lang/Comparable
      61: invokestatic  #54                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
      64: ireturn
}


import java.util.stream.Stream

class Exercise3 {

    companion object {
        fun functional(start: Int, end: Int): List<Pair<Int, Int>> {
            return Stream
                .iterate(
                    Pair(0, start), // Cuando empieza.
                    { it.first < end }, // Cuando termina.
                    { Pair(it.first + 1, if (it.first % 3 == 1) it.second + 1 else it.second + it.first) }) // Siguiente
                .toList().sortedBy { it.first }
        }

        fun iterativeWhile(start: Int, end: Int): List<Pair<Int, Int>> {
            var current: Pair<Int, Int> = Pair(0, start)
            val result: MutableList<Pair<Int, Int>> = mutableListOf()
            while (current.first < end) {
                result += Pair(current.first, current.second)
                current = Pair(
                    current.first + 1,
                    if (current.first % 3 == 1) current.second + 1 else current.second + current.first
                )

            }
            return result.sortedBy { it.first }
        }

        fun recursiveFinal(start: Int, end: Int): List<Pair<Int, Int>> {
            return recursiveFinal(end, mutableListOf(), Pair(0, start)).sortedBy { it.first }
        }

        private fun recursiveFinal(end: Int, list: List<Pair<Int, Int>>, current: Pair<Int, Int>): List<Pair<Int, Int>> {
            if (current.first < end) return recursiveFinal(
                end,
                list + current,
                Pair(
                    current.first + 1,
                    if (current.first % 3 == 1) current.second + 1 else current.second + current.first
                )
            )
            return list
        }

        fun recursiveNoFinal(start: Int, end: Int): List<Pair<Int, Int>> {
            return recursiveNoFinal(end, Pair(0, start)).sortedBy { it.first }
        }

        private fun recursiveNoFinal(end: Int, current: Pair<Int, Int>): List<Pair<Int, Int>> {
            if (current.first < end) return recursiveNoFinal(
                end,
                Pair(
                    current.first + 1,
                    if (current.first % 3 == 1) current.second + 1 else current.second + current.first
                )
            ) + current
            return listOf()
        }
    }
}

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

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

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

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

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

  public final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> functional(int, int);
    Code:
       0: new           #16                 // class kotlin/Pair
       3: dup
       4: iconst_0
       5: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       8: iload_1
       9: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      15: iload_2
      16: invokedynamic #45,  0             // InvokeDynamic #0:invoke:(I)Lkotlin/jvm/functions/Function1;
      21: invokedynamic #56,  0             // InvokeDynamic #1:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
      26: invokedynamic #66,  0             // InvokeDynamic #2:apply:()Ljava/util/function/UnaryOperator;
      31: invokestatic  #72                 // InterfaceMethod java/util/stream/Stream.iterate:(Ljava/lang/Object;Ljava/util/function/Predicate;Ljava/util/function/UnaryOperator;)Ljava/util/stream/Stream;
      34: invokeinterface #76,  1           // InterfaceMethod java/util/stream/Stream.toList:()Ljava/util/List;
      39: astore_3
      40: aload_3
      41: ldc           #78                 // String toList(...)
      43: invokestatic  #84                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      46: aload_3
      47: checkcast     #86                 // class java/lang/Iterable
      50: astore_3
      51: nop
      52: iconst_0
      53: istore        4
      55: aload_3
      56: new           #88                 // class Exercise3$Companion$functional$$inlined$sortedBy$1
      59: dup
      60: invokespecial #89                 // Method Exercise3$Companion$functional$$inlined$sortedBy$1."<init>":()V
      63: checkcast     #91                 // class java/util/Comparator
      66: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
      69: areturn

  public final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> iterativeWhile(int, int);
    Code:
       0: new           #16                 // class kotlin/Pair
       3: dup
       4: iconst_0
       5: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       8: iload_1
       9: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      15: astore_3
      16: new           #106                // class java/util/ArrayList
      19: dup
      20: invokespecial #107                // Method java/util/ArrayList."<init>":()V
      23: checkcast     #109                // class java/util/List
      26: astore        4
      28: aload_3
      29: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      32: checkcast     #115                // class java/lang/Number
      35: invokevirtual #119                // Method java/lang/Number.intValue:()I
      38: iload_2
      39: if_icmpge     149
      42: aload         4
      44: checkcast     #121                // class java/util/Collection
      47: new           #16                 // class kotlin/Pair
      50: dup
      51: aload_3
      52: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      55: aload_3
      56: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      59: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      62: invokeinterface #127,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      67: pop
      68: new           #16                 // class kotlin/Pair
      71: dup
      72: aload_3
      73: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      76: checkcast     #115                // class java/lang/Number
      79: invokevirtual #119                // Method java/lang/Number.intValue:()I
      82: iconst_1
      83: iadd
      84: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      87: aload_3
      88: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      91: checkcast     #115                // class java/lang/Number
      94: invokevirtual #119                // Method java/lang/Number.intValue:()I
      97: iconst_3
      98: irem
      99: iconst_1
     100: if_icmpne     118
     103: aload_3
     104: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     107: checkcast     #115                // class java/lang/Number
     110: invokevirtual #119                // Method java/lang/Number.intValue:()I
     113: iconst_1
     114: iadd
     115: goto          139
     118: aload_3
     119: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     122: checkcast     #115                // class java/lang/Number
     125: invokevirtual #119                // Method java/lang/Number.intValue:()I
     128: aload_3
     129: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     132: checkcast     #115                // class java/lang/Number
     135: invokevirtual #119                // Method java/lang/Number.intValue:()I
     138: iadd
     139: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     142: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     145: astore_3
     146: goto          28
     149: aload         4
     151: checkcast     #86                 // class java/lang/Iterable
     154: astore        5
     156: iconst_0
     157: istore        6
     159: aload         5
     161: new           #129                // class Exercise3$Companion$iterativeWhile$$inlined$sortedBy$1
     164: dup
     165: invokespecial #130                // Method Exercise3$Companion$iterativeWhile$$inlined$sortedBy$1."<init>":()V
     168: checkcast     #91                 // class java/util/Comparator
     171: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     174: areturn

  public final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> recursiveFinal(int, int);
    Code:
       0: aload_0
       1: iload_2
       2: new           #106                // class java/util/ArrayList
       5: dup
       6: invokespecial #107                // Method java/util/ArrayList."<init>":()V
       9: checkcast     #109                // class java/util/List
      12: new           #16                 // class kotlin/Pair
      15: dup
      16: iconst_0
      17: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      20: iload_1
      21: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      24: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      27: invokespecial #138                // Method recursiveFinal:(ILjava/util/List;Lkotlin/Pair;)Ljava/util/List;
      30: checkcast     #86                 // class java/lang/Iterable
      33: astore_3
      34: iconst_0
      35: istore        4
      37: aload_3
      38: new           #140                // class Exercise3$Companion$recursiveFinal$$inlined$sortedBy$1
      41: dup
      42: invokespecial #141                // Method Exercise3$Companion$recursiveFinal$$inlined$sortedBy$1."<init>":()V
      45: checkcast     #91                 // class java/util/Comparator
      48: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
      51: areturn

  private final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> recursiveFinal(int, java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);
    Code:
       0: aload_3
       1: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       4: checkcast     #115                // class java/lang/Number
       7: invokevirtual #119                // Method java/lang/Number.intValue:()I
      10: iload_1
      11: if_icmpge     105
      14: aload_0
      15: iload_1
      16: aload_2
      17: checkcast     #121                // class java/util/Collection
      20: aload_3
      21: invokestatic  #146                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
      24: new           #16                 // class kotlin/Pair
      27: dup
      28: aload_3
      29: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      32: checkcast     #115                // class java/lang/Number
      35: invokevirtual #119                // Method java/lang/Number.intValue:()I
      38: iconst_1
      39: iadd
      40: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      43: aload_3
      44: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      47: checkcast     #115                // class java/lang/Number
      50: invokevirtual #119                // Method java/lang/Number.intValue:()I
      53: iconst_3
      54: irem
      55: iconst_1
      56: if_icmpne     74
      59: aload_3
      60: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      63: checkcast     #115                // class java/lang/Number
      66: invokevirtual #119                // Method java/lang/Number.intValue:()I
      69: iconst_1
      70: iadd
      71: goto          95
      74: aload_3
      75: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      78: checkcast     #115                // class java/lang/Number
      81: invokevirtual #119                // Method java/lang/Number.intValue:()I
      84: aload_3
      85: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      88: checkcast     #115                // class java/lang/Number
      91: invokevirtual #119                // Method java/lang/Number.intValue:()I
      94: iadd
      95: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      98: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     101: invokespecial #138                // Method recursiveFinal:(ILjava/util/List;Lkotlin/Pair;)Ljava/util/List;
     104: areturn
     105: aload_2
     106: areturn

  public final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> recursiveNoFinal(int, int);
    Code:
       0: aload_0
       1: iload_2
       2: new           #16                 // class kotlin/Pair
       5: dup
       6: iconst_0
       7: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      10: iload_1
      11: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      17: invokespecial #151                // Method recursiveNoFinal:(ILkotlin/Pair;)Ljava/util/List;
      20: checkcast     #86                 // class java/lang/Iterable
      23: astore_3
      24: iconst_0
      25: istore        4
      27: aload_3
      28: new           #153                // class Exercise3$Companion$recursiveNoFinal$$inlined$sortedBy$1
      31: dup
      32: invokespecial #154                // Method Exercise3$Companion$recursiveNoFinal$$inlined$sortedBy$1."<init>":()V
      35: checkcast     #91                 // class java/util/Comparator
      38: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
      41: areturn

  private final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> recursiveNoFinal(int, kotlin.Pair<java.lang.Integer, java.lang.Integer>);
    Code:
       0: aload_2
       1: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       4: checkcast     #115                // class java/lang/Number
       7: invokevirtual #119                // Method java/lang/Number.intValue:()I
      10: iload_1
      11: if_icmpge     104
      14: aload_0
      15: iload_1
      16: new           #16                 // class kotlin/Pair
      19: dup
      20: aload_2
      21: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      24: checkcast     #115                // class java/lang/Number
      27: invokevirtual #119                // Method java/lang/Number.intValue:()I
      30: iconst_1
      31: iadd
      32: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      35: aload_2
      36: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      39: checkcast     #115                // class java/lang/Number
      42: invokevirtual #119                // Method java/lang/Number.intValue:()I
      45: iconst_3
      46: irem
      47: iconst_1
      48: if_icmpne     66
      51: aload_2
      52: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      55: checkcast     #115                // class java/lang/Number
      58: invokevirtual #119                // Method java/lang/Number.intValue:()I
      61: iconst_1
      62: iadd
      63: goto          87
      66: aload_2
      67: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      70: checkcast     #115                // class java/lang/Number
      73: invokevirtual #119                // Method java/lang/Number.intValue:()I
      76: aload_2
      77: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      80: checkcast     #115                // class java/lang/Number
      83: invokevirtual #119                // Method java/lang/Number.intValue:()I
      86: iadd
      87: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      90: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      93: invokespecial #151                // Method recursiveNoFinal:(ILkotlin/Pair;)Ljava/util/List;
      96: checkcast     #121                // class java/util/Collection
      99: aload_2
     100: invokestatic  #146                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
     103: areturn
     104: invokestatic  #158                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
     107: areturn

  private static final boolean functional$lambda$0(int, kotlin.Pair);
    Code:
       0: aload_1
       1: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       4: checkcast     #115                // class java/lang/Number
       7: invokevirtual #119                // Method java/lang/Number.intValue:()I
      10: iload_0
      11: if_icmpge     18
      14: iconst_1
      15: goto          19
      18: iconst_0
      19: ireturn

  private static final boolean functional$lambda$1(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #164,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #166                // class java/lang/Boolean
      10: invokevirtual #170                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  private static final kotlin.Pair functional$lambda$2(kotlin.Pair);
    Code:
       0: new           #16                 // class kotlin/Pair
       3: dup
       4: aload_0
       5: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       8: checkcast     #115                // class java/lang/Number
      11: invokevirtual #119                // Method java/lang/Number.intValue:()I
      14: iconst_1
      15: iadd
      16: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      19: aload_0
      20: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      23: checkcast     #115                // class java/lang/Number
      26: invokevirtual #119                // Method java/lang/Number.intValue:()I
      29: iconst_3
      30: irem
      31: iconst_1
      32: if_icmpne     50
      35: aload_0
      36: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      39: checkcast     #115                // class java/lang/Number
      42: invokevirtual #119                // Method java/lang/Number.intValue:()I
      45: iconst_1
      46: iadd
      47: goto          71
      50: aload_0
      51: invokevirtual #124                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      54: checkcast     #115                // class java/lang/Number
      57: invokevirtual #119                // Method java/lang/Number.intValue:()I
      60: aload_0
      61: invokevirtual #113                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      64: checkcast     #115                // class java/lang/Number
      67: invokevirtual #119                // Method java/lang/Number.intValue:()I
      70: iadd
      71: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      74: invokespecial #25                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      77: areturn

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

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

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

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

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

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

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

  static {};
    Code:
       0: new           #13                 // class Exercise3$Companion
       3: dup
       4: aconst_null
       5: invokespecial #16                 // Method Exercise3$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #20                 // Field Companion:LExercise3$Companion;
      11: return
}


import java.util.stream.Stream
import kotlin.math.absoluteValue
import kotlin.math.pow

class Exercise4 {

    companion object {
        fun functional(n: Double, e: Double): Double {
            val pair = Stream.iterate(
                Pair(0.0, n) // Definimos el comienzo como 0 (nos dicen que se calcula la raíz cúbica de un número positivo) y el valor del que queremos saber la raíz cúbica.
            ) {
                val middle = it.first.plus(it.second).div(2) // Calculamos el valor medio.
                // Analizamos donde puede estar aplicando búsqueda binaria (de inicio a medio y de medio a fin).
                if (middle.pow(3) > n && it.first.pow(3) < n) Pair(it.first, middle)
                else if (middle.pow(3) < n && it.second.pow(3) > n) Pair(middle, it.second)
                else it
            }.filter { it.first.plus(it.second).div(2).pow(3).minus(n).absoluteValue < e.pow(3) }.findFirst() // Indicamos que termine cuando el error al cubo sea mayor que la resta del medio al cubo con el valor del que qeremos saber su rai´z cúbica
                .orElse(Pair(0.0, 0.0))
            return pair.first.plus(pair.second).div(2)
        }

        fun iterativeWhile(n: Double, e: Double): Double {
            var current = Pair(0.0, n)
            var middle = n.div(2)
            while (middle.pow(3).minus(n).absoluteValue > e.pow(3)) {
                current = if (middle.pow(3) > n && current.first.pow(3) < n) Pair(current.first, middle)
                else if (middle.pow(3) < n && current.second.pow(3) > n) Pair(middle, current.second)
                else current
                middle = current.first.plus(current.second).div(2)
            }
            return middle
        }

        fun recursiveFinal(n: Double, e: Double): Double {
            return recursiveFinal(n, e, Pair(0.0, n), n.div(2))
        }

        private fun recursiveFinal(n: Double, e: Double, current: Pair<Double, Double>, middle: Double): Double {
            return if (middle.pow(3).minus(n).absoluteValue <= e.pow(3)) middle
            else {
                val auxCurrent = if (middle.pow(3) > n && current.first.pow(3) < n) Pair(current.first, middle)
                else if (middle.pow(3) < n && current.second.pow(3) > n) Pair(middle, current.second)
                else current
                val auxMiddle = auxCurrent.first.plus(auxCurrent.second).div(2)
                recursiveFinal(n, e, auxCurrent, auxMiddle)
            }
        }
    }

}

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

  public final double functional(double, double);
    Code:
       0: new           #14                 // class kotlin/Pair
       3: dup
       4: dconst_0
       5: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
       8: dload_1
       9: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      12: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      15: dload_1
      16: invokedynamic #43,  0             // InvokeDynamic #0:apply:(D)Ljava/util/function/UnaryOperator;
      21: invokestatic  #49                 // InterfaceMethod java/util/stream/Stream.iterate:(Ljava/lang/Object;Ljava/util/function/UnaryOperator;)Ljava/util/stream/Stream;
      24: dload_1
      25: dload_3
      26: invokedynamic #60,  0             // InvokeDynamic #1:invoke:(DD)Lkotlin/jvm/functions/Function1;
      31: invokedynamic #71,  0             // InvokeDynamic #2:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
      36: invokeinterface #75,  2           // InterfaceMethod java/util/stream/Stream.filter:(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;
      41: invokeinterface #79,  1           // InterfaceMethod java/util/stream/Stream.findFirst:()Ljava/util/Optional;
      46: new           #14                 // class kotlin/Pair
      49: dup
      50: dconst_0
      51: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      54: dconst_0
      55: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      58: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      61: invokevirtual #84                 // Method java/util/Optional.orElse:(Ljava/lang/Object;)Ljava/lang/Object;
      64: checkcast     #14                 // class kotlin/Pair
      67: astore        5
      69: aload         5
      71: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      74: checkcast     #90                 // class java/lang/Number
      77: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      80: aload         5
      82: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      85: checkcast     #90                 // class java/lang/Number
      88: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      91: dadd
      92: iconst_2
      93: i2d
      94: ddiv
      95: dreturn

  public final double iterativeWhile(double, double);
    Code:
       0: new           #14                 // class kotlin/Pair
       3: dup
       4: dconst_0
       5: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
       8: dload_1
       9: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      12: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      15: astore        5
      17: dload_1
      18: iconst_2
      19: i2d
      20: ddiv
      21: dstore        6
      23: dload         6
      25: iconst_3
      26: i2d
      27: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      30: dload_1
      31: dsub
      32: invokestatic  #112                // Method java/lang/Math.abs:(D)D
      35: dload_3
      36: iconst_3
      37: i2d
      38: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      41: dcmpl
      42: ifle          186
      45: dload         6
      47: iconst_3
      48: i2d
      49: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      52: dload_1
      53: dcmpl
      54: ifle          98
      57: aload         5
      59: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      62: checkcast     #90                 // class java/lang/Number
      65: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      68: iconst_3
      69: i2d
      70: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      73: dload_1
      74: dcmpg
      75: ifge          98
      78: new           #14                 // class kotlin/Pair
      81: dup
      82: aload         5
      84: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      87: dload         6
      89: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      92: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      95: goto          153
      98: dload         6
     100: iconst_3
     101: i2d
     102: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
     105: dload_1
     106: dcmpg
     107: ifge          151
     110: aload         5
     112: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     115: checkcast     #90                 // class java/lang/Number
     118: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
     121: iconst_3
     122: i2d
     123: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
     126: dload_1
     127: dcmpl
     128: ifle          151
     131: new           #14                 // class kotlin/Pair
     134: dup
     135: dload         6
     137: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     140: aload         5
     142: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     145: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     148: goto          153
     151: aload         5
     153: astore        5
     155: aload         5
     157: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     160: checkcast     #90                 // class java/lang/Number
     163: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
     166: aload         5
     168: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     171: checkcast     #90                 // class java/lang/Number
     174: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
     177: dadd
     178: iconst_2
     179: i2d
     180: ddiv
     181: dstore        6
     183: goto          23
     186: dload         6
     188: dreturn

  public final double recursiveFinal(double, double);
    Code:
       0: aload_0
       1: dload_1
       2: dload_3
       3: new           #14                 // class kotlin/Pair
       6: dup
       7: dconst_0
       8: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      11: dload_1
      12: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      15: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      18: dload_1
      19: iconst_2
      20: i2d
      21: ddiv
      22: invokespecial #118                // Method recursiveFinal:(DDLkotlin/Pair;D)D
      25: dreturn

  private final double recursiveFinal(double, double, kotlin.Pair<java.lang.Double, java.lang.Double>, double);
    Code:
       0: dload         6
       2: iconst_3
       3: i2d
       4: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
       7: dload_1
       8: dsub
       9: invokestatic  #112                // Method java/lang/Math.abs:(D)D
      12: dload_3
      13: iconst_3
      14: i2d
      15: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      18: dcmpg
      19: ifgt          27
      22: dload         6
      24: goto          175
      27: dload         6
      29: iconst_3
      30: i2d
      31: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      34: dload_1
      35: dcmpl
      36: ifle          80
      39: aload         5
      41: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      44: checkcast     #90                 // class java/lang/Number
      47: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      50: iconst_3
      51: i2d
      52: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      55: dload_1
      56: dcmpg
      57: ifge          80
      60: new           #14                 // class kotlin/Pair
      63: dup
      64: aload         5
      66: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      69: dload         6
      71: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      74: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      77: goto          135
      80: dload         6
      82: iconst_3
      83: i2d
      84: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      87: dload_1
      88: dcmpg
      89: ifge          133
      92: aload         5
      94: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      97: checkcast     #90                 // class java/lang/Number
     100: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
     103: iconst_3
     104: i2d
     105: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
     108: dload_1
     109: dcmpl
     110: ifle          133
     113: new           #14                 // class kotlin/Pair
     116: dup
     117: dload         6
     119: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     122: aload         5
     124: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     127: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     130: goto          135
     133: aload         5
     135: astore        8
     137: aload         8
     139: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     142: checkcast     #90                 // class java/lang/Number
     145: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
     148: aload         8
     150: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     153: checkcast     #90                 // class java/lang/Number
     156: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
     159: dadd
     160: iconst_2
     161: i2d
     162: ddiv
     163: dstore        9
     165: aload_0
     166: dload_1
     167: dload_3
     168: aload         8
     170: dload         9
     172: invokespecial #118                // Method recursiveFinal:(DDLkotlin/Pair;D)D
     175: dreturn

  private static final kotlin.Pair functional$lambda$0(double, kotlin.Pair);
    Code:
       0: aload_2
       1: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       4: checkcast     #90                 // class java/lang/Number
       7: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      10: aload_2
      11: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      14: checkcast     #90                 // class java/lang/Number
      17: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      20: dadd
      21: iconst_2
      22: i2d
      23: ddiv
      24: dstore_3
      25: dload_3
      26: iconst_3
      27: i2d
      28: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      31: dload_0
      32: dcmpl
      33: ifle          74
      36: aload_2
      37: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      40: checkcast     #90                 // class java/lang/Number
      43: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      46: iconst_3
      47: i2d
      48: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      51: dload_0
      52: dcmpg
      53: ifge          74
      56: new           #14                 // class kotlin/Pair
      59: dup
      60: aload_2
      61: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      64: dload_3
      65: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      68: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      71: goto          124
      74: dload_3
      75: iconst_3
      76: i2d
      77: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      80: dload_0
      81: dcmpg
      82: ifge          123
      85: aload_2
      86: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      89: checkcast     #90                 // class java/lang/Number
      92: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      95: iconst_3
      96: i2d
      97: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
     100: dload_0
     101: dcmpl
     102: ifle          123
     105: new           #14                 // class kotlin/Pair
     108: dup
     109: dload_3
     110: invokestatic  #20                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     113: aload_2
     114: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     117: invokespecial #23                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     120: goto          124
     123: aload_2
     124: areturn

  private static final boolean functional$lambda$1(double, double, kotlin.Pair);
    Code:
       0: aload         4
       2: invokevirtual #88                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       5: checkcast     #90                 // class java/lang/Number
       8: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      11: aload         4
      13: invokevirtual #97                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      16: checkcast     #90                 // class java/lang/Number
      19: invokevirtual #94                 // Method java/lang/Number.doubleValue:()D
      22: dadd
      23: iconst_2
      24: i2d
      25: ddiv
      26: iconst_3
      27: i2d
      28: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      31: dload_0
      32: dsub
      33: invokestatic  #112                // Method java/lang/Math.abs:(D)D
      36: dload_2
      37: iconst_3
      38: i2d
      39: invokestatic  #108                // Method java/lang/Math.pow:(DD)D
      42: dcmpg
      43: ifge          50
      46: iconst_1
      47: goto          51
      50: iconst_0
      51: ireturn

  private static final boolean functional$lambda$2(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #128,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #130                // class java/lang/Boolean
      10: invokevirtual #134                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

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

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

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

  static {};
    Code:
       0: new           #13                 // class Exercise4$Companion
       3: dup
       4: aconst_null
       5: invokespecial #16                 // Method Exercise4$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #20                 // Field Companion:LExercise4$Companion;
      11: return
}