package com.terencepeh.leetcodepractice

/**
 * Created by <NAME> on 26/10/22.
 */
/**
 * Definition for a binary tree node.
 * class TreeNode(var `val`: Int = 0) {
 *     var left: TreeNode? = null
 *     var right: TreeNode? = null
 * }
 */

class TreeNode(var `val`: Int = 0) {
    var left: TreeNode? = null
    var right: TreeNode? = null
}

fun lowestCommonAncestor(root: TreeNode?, p: TreeNode?, q: TreeNode?): TreeNode? {
    if (root == null) {
        return null
    }

    val current = root.`val`
    val pVal = p!!.`val`
    val qVal = q!!.`val`

    if (pVal > current && qVal > current) {
        return lowestCommonAncestor(root.right, p, q)
    }
    if (pVal < current && qVal < current) {
        return lowestCommonAncestor(root.left, p, q)
    }

    return root
}

fun lowestCommonAncestor2(root: TreeNode?, p: TreeNode?, q: TreeNode?): TreeNode? {
    if (root == null) {
        return null
    }

    var node = root
    val pVal = p!!.`val`
    val qVal = q!!.`val`

    while (node != null) {
        node = if (pVal > node.`val` && qVal > node.`val`) {
            node.right
        } else if (pVal < node.`val` && qVal < node.`val`) {
            node.left
        } else {
            break
        }
    }

    return node
}

fun main() {
    val input = TreeNode(6).apply {
        left = TreeNode(2).apply {
            left = TreeNode(0)
            right = TreeNode(4).apply {
                left = TreeNode(3)
                right = TreeNode(5)
            }
        }
        right = TreeNode(8).apply {
            left = TreeNode(7)
            right = TreeNode(9)
        }
    }

    print(input)

    var p = TreeNode(2)
    var q = TreeNode(8)

    println(lowestCommonAncestor(input, p, q)?.`val`)

    p = TreeNode(2)
    q = TreeNode(4)

    println(lowestCommonAncestor2(input, p, q)?.`val`)

    p = TreeNode(2)
    q = TreeNode(1)

    println(lowestCommonAncestor(input, p, q)?.`val`)
}

Compiled from "LowestCommonAncestorBST.kt"
public final class com.terencepeh.leetcodepractice.LowestCommonAncestorBSTKt {
  public static final com.terencepeh.leetcodepractice.TreeNode lowestCommonAncestor(com.terencepeh.leetcodepractice.TreeNode, com.terencepeh.leetcodepractice.TreeNode, com.terencepeh.leetcodepractice.TreeNode);
    Code:
       0: aload_0
       1: ifnonnull     6
       4: aconst_null
       5: areturn
       6: aload_0
       7: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      10: istore_3
      11: aload_1
      12: dup
      13: invokestatic  #19                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      16: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      19: istore        4
      21: aload_2
      22: dup
      23: invokestatic  #19                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      26: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      29: istore        5
      31: iload         4
      33: iload_3
      34: if_icmple     53
      37: iload         5
      39: iload_3
      40: if_icmple     53
      43: aload_0
      44: invokevirtual #23                 // Method com/terencepeh/leetcodepractice/TreeNode.getRight:()Lcom/terencepeh/leetcodepractice/TreeNode;
      47: aload_1
      48: aload_2
      49: invokestatic  #25                 // Method lowestCommonAncestor:(Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;)Lcom/terencepeh/leetcodepractice/TreeNode;
      52: areturn
      53: iload         4
      55: iload_3
      56: if_icmpge     75
      59: iload         5
      61: iload_3
      62: if_icmpge     75
      65: aload_0
      66: invokevirtual #28                 // Method com/terencepeh/leetcodepractice/TreeNode.getLeft:()Lcom/terencepeh/leetcodepractice/TreeNode;
      69: aload_1
      70: aload_2
      71: invokestatic  #25                 // Method lowestCommonAncestor:(Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;)Lcom/terencepeh/leetcodepractice/TreeNode;
      74: areturn
      75: aload_0
      76: areturn

  public static final com.terencepeh.leetcodepractice.TreeNode lowestCommonAncestor2(com.terencepeh.leetcodepractice.TreeNode, com.terencepeh.leetcodepractice.TreeNode, com.terencepeh.leetcodepractice.TreeNode);
    Code:
       0: aload_0
       1: ifnonnull     6
       4: aconst_null
       5: areturn
       6: aload_0
       7: astore_3
       8: aload_1
       9: dup
      10: invokestatic  #19                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      13: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      16: istore        4
      18: aload_2
      19: dup
      20: invokestatic  #19                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      23: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      26: istore        5
      28: aload_3
      29: ifnull        89
      32: iload         4
      34: aload_3
      35: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      38: if_icmple     57
      41: iload         5
      43: aload_3
      44: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      47: if_icmple     57
      50: aload_3
      51: invokevirtual #23                 // Method com/terencepeh/leetcodepractice/TreeNode.getRight:()Lcom/terencepeh/leetcodepractice/TreeNode;
      54: goto          85
      57: iload         4
      59: aload_3
      60: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      63: if_icmpge     82
      66: iload         5
      68: aload_3
      69: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
      72: if_icmpge     82
      75: aload_3
      76: invokevirtual #28                 // Method com/terencepeh/leetcodepractice/TreeNode.getLeft:()Lcom/terencepeh/leetcodepractice/TreeNode;
      79: goto          85
      82: goto          89
      85: astore_3
      86: goto          28
      89: aload_3
      90: areturn

  public static final void main();
    Code:
       0: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
       3: dup
       4: bipush        6
       6: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
       9: astore_1
      10: aload_1
      11: astore_2
      12: iconst_0
      13: istore_3
      14: aload_2
      15: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
      18: dup
      19: iconst_2
      20: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
      23: astore        4
      25: aload         4
      27: astore        5
      29: astore        6
      31: iconst_0
      32: istore        7
      34: aload         5
      36: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
      39: dup
      40: iconst_0
      41: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
      44: invokevirtual #48                 // Method com/terencepeh/leetcodepractice/TreeNode.setLeft:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
      47: aload         5
      49: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
      52: dup
      53: iconst_4
      54: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
      57: astore        8
      59: aload         8
      61: astore        9
      63: astore        10
      65: iconst_0
      66: istore        11
      68: aload         9
      70: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
      73: dup
      74: iconst_3
      75: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
      78: invokevirtual #48                 // Method com/terencepeh/leetcodepractice/TreeNode.setLeft:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
      81: aload         9
      83: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
      86: dup
      87: iconst_5
      88: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
      91: invokevirtual #51                 // Method com/terencepeh/leetcodepractice/TreeNode.setRight:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
      94: nop
      95: aload         10
      97: aload         8
      99: invokevirtual #51                 // Method com/terencepeh/leetcodepractice/TreeNode.setRight:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
     102: nop
     103: aload         6
     105: aload         4
     107: invokevirtual #48                 // Method com/terencepeh/leetcodepractice/TreeNode.setLeft:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
     110: aload_2
     111: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     114: dup
     115: bipush        8
     117: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     120: astore        4
     122: aload         4
     124: astore        5
     126: astore        6
     128: iconst_0
     129: istore        7
     131: aload         5
     133: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     136: dup
     137: bipush        7
     139: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     142: invokevirtual #48                 // Method com/terencepeh/leetcodepractice/TreeNode.setLeft:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
     145: aload         5
     147: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     150: dup
     151: bipush        9
     153: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     156: invokevirtual #51                 // Method com/terencepeh/leetcodepractice/TreeNode.setRight:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
     159: nop
     160: aload         6
     162: aload         4
     164: invokevirtual #51                 // Method com/terencepeh/leetcodepractice/TreeNode.setRight:(Lcom/terencepeh/leetcodepractice/TreeNode;)V
     167: nop
     168: aload_1
     169: astore_0
     170: getstatic     #57                 // Field java/lang/System.out:Ljava/io/PrintStream;
     173: aload_0
     174: invokevirtual #62                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
     177: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     180: dup
     181: iconst_2
     182: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     185: astore_1
     186: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     189: dup
     190: bipush        8
     192: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     195: astore_2
     196: aload_0
     197: aload_1
     198: aload_2
     199: invokestatic  #25                 // Method lowestCommonAncestor:(Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;)Lcom/terencepeh/leetcodepractice/TreeNode;
     202: dup
     203: ifnull        215
     206: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
     209: invokestatic  #68                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     212: goto          217
     215: pop
     216: aconst_null
     217: getstatic     #57                 // Field java/lang/System.out:Ljava/io/PrintStream;
     220: swap
     221: invokevirtual #71                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     224: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     227: dup
     228: iconst_2
     229: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     232: astore_1
     233: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     236: dup
     237: iconst_4
     238: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     241: astore_2
     242: aload_0
     243: aload_1
     244: aload_2
     245: invokestatic  #73                 // Method lowestCommonAncestor2:(Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;)Lcom/terencepeh/leetcodepractice/TreeNode;
     248: dup
     249: ifnull        261
     252: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
     255: invokestatic  #68                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     258: goto          263
     261: pop
     262: aconst_null
     263: getstatic     #57                 // Field java/lang/System.out:Ljava/io/PrintStream;
     266: swap
     267: invokevirtual #71                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     270: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     273: dup
     274: iconst_2
     275: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     278: astore_1
     279: new           #9                  // class com/terencepeh/leetcodepractice/TreeNode
     282: dup
     283: iconst_1
     284: invokespecial #44                 // Method com/terencepeh/leetcodepractice/TreeNode."<init>":(I)V
     287: astore_2
     288: aload_0
     289: aload_1
     290: aload_2
     291: invokestatic  #25                 // Method lowestCommonAncestor:(Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;Lcom/terencepeh/leetcodepractice/TreeNode;)Lcom/terencepeh/leetcodepractice/TreeNode;
     294: dup
     295: ifnull        307
     298: invokevirtual #13                 // Method com/terencepeh/leetcodepractice/TreeNode.getVal:()I
     301: invokestatic  #68                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     304: goto          309
     307: pop
     308: aconst_null
     309: getstatic     #57                 // Field java/lang/System.out:Ljava/io/PrintStream;
     312: swap
     313: invokevirtual #71                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     316: return

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


package com.terencepeh.leetcodepractice

fun sum(arr: IntArray): Int {
    println("Size = ${arr.size}")
    return when {
        arr.isEmpty() -> 0
        else -> arr[0] + sum(arr.copyOfRange(1, arr.size))
    }
}

fun count(list: List<Any>): Int {
    return when {
        list.isEmpty() -> 0
        else -> 1 + count(list.subList(1, list.size))
    }
}

private fun max(list: IntArray): Int = when {
    list.size == 2 -> if (list[0] > list[1]) list[0] else list[1]
    else -> {
        val subMax = max(list.copyOfRange(1, list.size))
        if (list[0] > subMax) list[0] else subMax
    }
}

fun main() {
    println(sum(intArrayOf(1, 2, 3, 4, 5)))
    println(count(listOf(1, 2, 3, 4, 5)))
    println(max(intArrayOf(1, 5, 10, 25, 16, 1))) // 25
}

Compiled from "RecursiveSum.kt"
public final class com.terencepeh.leetcodepractice.RecursiveSumKt {
  public static final int sum(int[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #17                 // class java/lang/StringBuilder
       9: dup
      10: invokespecial #21                 // Method java/lang/StringBuilder."<init>":()V
      13: ldc           #23                 // String Size =
      15: invokevirtual #27                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      18: aload_0
      19: arraylength
      20: invokevirtual #30                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      23: invokevirtual #34                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      26: getstatic     #40                 // Field java/lang/System.out:Ljava/io/PrintStream;
      29: swap
      30: invokevirtual #46                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      33: nop
      34: aload_0
      35: arraylength
      36: ifne          43
      39: iconst_1
      40: goto          44
      43: iconst_0
      44: ifeq          51
      47: iconst_0
      48: goto          65
      51: aload_0
      52: iconst_0
      53: iaload
      54: aload_0
      55: iconst_1
      56: aload_0
      57: arraylength
      58: invokestatic  #52                 // Method kotlin/collections/ArraysKt.copyOfRange:([III)[I
      61: invokestatic  #54                 // Method sum:([I)I
      64: iadd
      65: ireturn

  public static final int count(java.util.List<? extends java.lang.Object>);
    Code:
       0: aload_0
       1: ldc           #60                 // String list
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: nop
       7: aload_0
       8: invokeinterface #66,  1           // InterfaceMethod java/util/List.isEmpty:()Z
      13: ifeq          20
      16: iconst_0
      17: goto          38
      20: iconst_1
      21: aload_0
      22: iconst_1
      23: aload_0
      24: invokeinterface #70,  1           // InterfaceMethod java/util/List.size:()I
      29: invokeinterface #74,  3           // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;
      34: invokestatic  #76                 // Method count:(Ljava/util/List;)I
      37: iadd
      38: ireturn

  private static final int max(int[]);
    Code:
       0: nop
       1: aload_0
       2: arraylength
       3: iconst_2
       4: if_icmpne     28
       7: aload_0
       8: iconst_0
       9: iaload
      10: aload_0
      11: iconst_1
      12: iaload
      13: if_icmple     22
      16: aload_0
      17: iconst_0
      18: iaload
      19: goto          53
      22: aload_0
      23: iconst_1
      24: iaload
      25: goto          53
      28: aload_0
      29: iconst_1
      30: aload_0
      31: arraylength
      32: invokestatic  #52                 // Method kotlin/collections/ArraysKt.copyOfRange:([III)[I
      35: invokestatic  #80                 // Method max:([I)I
      38: istore_1
      39: aload_0
      40: iconst_0
      41: iaload
      42: iload_1
      43: if_icmple     52
      46: aload_0
      47: iconst_0
      48: iaload
      49: goto          53
      52: iload_1
      53: ireturn

  public static final void main();
    Code:
       0: iconst_5
       1: newarray       int
       3: astore_0
       4: aload_0
       5: iconst_0
       6: iconst_1
       7: iastore
       8: aload_0
       9: iconst_1
      10: iconst_2
      11: iastore
      12: aload_0
      13: iconst_2
      14: iconst_3
      15: iastore
      16: aload_0
      17: iconst_3
      18: iconst_4
      19: iastore
      20: aload_0
      21: iconst_4
      22: iconst_5
      23: iastore
      24: aload_0
      25: invokestatic  #54                 // Method sum:([I)I
      28: istore_0
      29: getstatic     #40                 // Field java/lang/System.out:Ljava/io/PrintStream;
      32: iload_0
      33: invokevirtual #87                 // Method java/io/PrintStream.println:(I)V
      36: iconst_5
      37: anewarray     #89                 // class java/lang/Integer
      40: astore_0
      41: aload_0
      42: iconst_0
      43: iconst_1
      44: invokestatic  #93                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      47: aastore
      48: aload_0
      49: iconst_1
      50: iconst_2
      51: invokestatic  #93                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      54: aastore
      55: aload_0
      56: iconst_2
      57: iconst_3
      58: invokestatic  #93                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      61: aastore
      62: aload_0
      63: iconst_3
      64: iconst_4
      65: invokestatic  #93                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      68: aastore
      69: aload_0
      70: iconst_4
      71: iconst_5
      72: invokestatic  #93                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      75: aastore
      76: aload_0
      77: invokestatic  #99                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      80: invokestatic  #76                 // Method count:(Ljava/util/List;)I
      83: istore_0
      84: getstatic     #40                 // Field java/lang/System.out:Ljava/io/PrintStream;
      87: iload_0
      88: invokevirtual #87                 // Method java/io/PrintStream.println:(I)V
      91: bipush        6
      93: newarray       int
      95: astore_0
      96: aload_0
      97: iconst_0
      98: iconst_1
      99: iastore
     100: aload_0
     101: iconst_1
     102: iconst_5
     103: iastore
     104: aload_0
     105: iconst_2
     106: bipush        10
     108: iastore
     109: aload_0
     110: iconst_3
     111: bipush        25
     113: iastore
     114: aload_0
     115: iconst_4
     116: bipush        16
     118: iastore
     119: aload_0
     120: iconst_5
     121: iconst_1
     122: iastore
     123: aload_0
     124: invokestatic  #80                 // Method max:([I)I
     127: istore_0
     128: getstatic     #40                 // Field java/lang/System.out:Ljava/io/PrintStream;
     131: iload_0
     132: invokevirtual #87                 // Method java/io/PrintStream.println:(I)V
     135: return

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


package com.terencepeh.leetcodepractice

// O(NKlogK)
// O(NK)
fun groupAnagrams(strs: Array<String>): List<List<String>> {
    if (strs.isEmpty()) {
        return emptyList()
    }

    val hashMap = hashMapOf<String, MutableList<String>>()

    for (s in strs) {
        val ca = s.toCharArray()
        ca.sort()
        val key = String(ca)
        if (!hashMap.containsKey(key)) {
            hashMap[key] = arrayListOf()
        }

        hashMap[key]!!.add(s)
    }

    return ArrayList(hashMap.values)
}

fun matchAnagrams(strs: Array<String>, originalWord: String): List<String> {
    if (originalWord.isBlank()) {
        return emptyList()
    }

    val input = originalWord.toCharArray()
    input.sort()
    val inputKey = String(input)

    val hashMap = hashMapOf<String, MutableList<String>>()

    for (s in strs) {
        val ca = s.toCharArray()
        ca.sort()
        val key = String(ca)
        if (!hashMap.containsKey(key)) {
            hashMap[key] = arrayListOf()
        }

        hashMap[key]!!.add(s)
    }

    return hashMap[inputKey] ?: emptyList()
}

fun main() {
    val strs = arrayOf("eat", "tea", "tan", "ate", "nat", "bat")

    println("groupAnagrams result: ${groupAnagrams(strs)}")
    println("matchAnagrams result: ${matchAnagrams(strs, "ant")}")
}

Compiled from "GroupAnagrams.kt"
public final class com.terencepeh.leetcodepractice.GroupAnagramsKt {
  public static final java.util.List<java.util.List<java.lang.String>> groupAnagrams(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #10                 // String strs
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: arraylength
       8: ifne          15
      11: iconst_1
      12: goto          16
      15: iconst_0
      16: ifeq          23
      19: invokestatic  #22                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      22: areturn
      23: new           #24                 // class java/util/HashMap
      26: dup
      27: invokespecial #28                 // Method java/util/HashMap."<init>":()V
      30: astore_1
      31: iconst_0
      32: istore_2
      33: aload_0
      34: arraylength
      35: istore_3
      36: iload_2
      37: iload_3
      38: if_icmpge     131
      41: aload_0
      42: iload_2
      43: aaload
      44: astore        4
      46: aload         4
      48: invokevirtual #34                 // Method java/lang/String.toCharArray:()[C
      51: dup
      52: ldc           #36                 // String toCharArray(...)
      54: invokestatic  #39                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      57: astore        5
      59: aload         5
      61: invokestatic  #45                 // Method kotlin/collections/ArraysKt.sort:([C)V
      64: new           #30                 // class java/lang/String
      67: dup
      68: aload         5
      70: invokespecial #47                 // Method java/lang/String."<init>":([C)V
      73: astore        6
      75: aload_1
      76: aload         6
      78: invokevirtual #51                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
      81: ifne          104
      84: nop
      85: aload_1
      86: checkcast     #53                 // class java/util/Map
      89: aload         6
      91: new           #55                 // class java/util/ArrayList
      94: dup
      95: invokespecial #56                 // Method java/util/ArrayList."<init>":()V
      98: invokeinterface #60,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     103: pop
     104: aload_1
     105: aload         6
     107: invokevirtual #64                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     110: dup
     111: invokestatic  #68                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     114: checkcast     #70                 // class java/util/List
     117: aload         4
     119: invokeinterface #73,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     124: pop
     125: iinc          2, 1
     128: goto          36
     131: new           #55                 // class java/util/ArrayList
     134: dup
     135: aload_1
     136: invokevirtual #77                 // Method java/util/HashMap.values:()Ljava/util/Collection;
     139: invokespecial #80                 // Method java/util/ArrayList."<init>":(Ljava/util/Collection;)V
     142: checkcast     #70                 // class java/util/List
     145: areturn

  public static final java.util.List<java.lang.String> matchAnagrams(java.lang.String[], java.lang.String);
    Code:
       0: aload_0
       1: ldc           #10                 // String strs
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #94                 // String originalWord
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: checkcast     #96                 // class java/lang/CharSequence
      16: invokestatic  #102                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      19: ifeq          26
      22: invokestatic  #22                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      25: areturn
      26: aload_1
      27: invokevirtual #34                 // Method java/lang/String.toCharArray:()[C
      30: dup
      31: ldc           #36                 // String toCharArray(...)
      33: invokestatic  #39                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      36: astore_2
      37: aload_2
      38: invokestatic  #45                 // Method kotlin/collections/ArraysKt.sort:([C)V
      41: new           #30                 // class java/lang/String
      44: dup
      45: aload_2
      46: invokespecial #47                 // Method java/lang/String."<init>":([C)V
      49: astore_3
      50: new           #24                 // class java/util/HashMap
      53: dup
      54: invokespecial #28                 // Method java/util/HashMap."<init>":()V
      57: astore        4
      59: iconst_0
      60: istore        5
      62: aload_0
      63: arraylength
      64: istore        6
      66: iload         5
      68: iload         6
      70: if_icmpge     167
      73: aload_0
      74: iload         5
      76: aaload
      77: astore        7
      79: aload         7
      81: invokevirtual #34                 // Method java/lang/String.toCharArray:()[C
      84: dup
      85: ldc           #36                 // String toCharArray(...)
      87: invokestatic  #39                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      90: astore        8
      92: aload         8
      94: invokestatic  #45                 // Method kotlin/collections/ArraysKt.sort:([C)V
      97: new           #30                 // class java/lang/String
     100: dup
     101: aload         8
     103: invokespecial #47                 // Method java/lang/String."<init>":([C)V
     106: astore        9
     108: aload         4
     110: aload         9
     112: invokevirtual #51                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
     115: ifne          139
     118: nop
     119: aload         4
     121: checkcast     #53                 // class java/util/Map
     124: aload         9
     126: new           #55                 // class java/util/ArrayList
     129: dup
     130: invokespecial #56                 // Method java/util/ArrayList."<init>":()V
     133: invokeinterface #60,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     138: pop
     139: aload         4
     141: aload         9
     143: invokevirtual #64                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     146: dup
     147: invokestatic  #68                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     150: checkcast     #70                 // class java/util/List
     153: aload         7
     155: invokeinterface #73,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     160: pop
     161: iinc          5, 1
     164: goto          66
     167: aload         4
     169: aload_3
     170: invokevirtual #64                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     173: checkcast     #70                 // class java/util/List
     176: dup
     177: ifnonnull     184
     180: pop
     181: invokestatic  #22                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
     184: areturn

  public static final void main();
    Code:
       0: bipush        6
       2: anewarray     #30                 // class java/lang/String
       5: astore_1
       6: aload_1
       7: iconst_0
       8: ldc           #108                // String eat
      10: aastore
      11: aload_1
      12: iconst_1
      13: ldc           #110                // String tea
      15: aastore
      16: aload_1
      17: iconst_2
      18: ldc           #112                // String tan
      20: aastore
      21: aload_1
      22: iconst_3
      23: ldc           #114                // String ate
      25: aastore
      26: aload_1
      27: iconst_4
      28: ldc           #116                // String nat
      30: aastore
      31: aload_1
      32: iconst_5
      33: ldc           #118                // String bat
      35: aastore
      36: aload_1
      37: astore_0
      38: new           #120                // class java/lang/StringBuilder
      41: dup
      42: invokespecial #121                // Method java/lang/StringBuilder."<init>":()V
      45: ldc           #123                // String groupAnagrams result:
      47: invokevirtual #127                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      50: aload_0
      51: invokestatic  #129                // Method groupAnagrams:([Ljava/lang/String;)Ljava/util/List;
      54: invokevirtual #132                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      57: invokevirtual #136                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      60: getstatic     #142                // Field java/lang/System.out:Ljava/io/PrintStream;
      63: swap
      64: invokevirtual #147                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      67: new           #120                // class java/lang/StringBuilder
      70: dup
      71: invokespecial #121                // Method java/lang/StringBuilder."<init>":()V
      74: ldc           #149                // String matchAnagrams result:
      76: invokevirtual #127                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      79: aload_0
      80: ldc           #151                // String ant
      82: invokestatic  #153                // Method matchAnagrams:([Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
      85: invokevirtual #132                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      88: invokevirtual #136                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      91: getstatic     #142                // Field java/lang/System.out:Ljava/io/PrintStream;
      94: swap
      95: invokevirtual #147                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      98: return

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


package com.terencepeh.leetcodepractice

/**
 * Created by <NAME> on 7/9/22.
 */

// o(n2)
fun maxProfitBruteForce(prices: IntArray): Int {
    var maxProfit = 0
    for (i in 0 until prices.size - 1) {
        for (j in i until prices.size) {
            val profit = prices[j] - prices[i]
            if (profit > maxProfit) {
                maxProfit = profit
            }
        }
    }
    return maxProfit
}

// O(n)
fun maxProfitTwoPointer(prices: IntArray): Int {
    var left = 0
    var right = 1
    var maxProfit = 0

    while (right < prices.size) {
        if (prices[left] < prices[right]) {
            val profit = prices[right] - prices[left]
            maxProfit = kotlin.math.max(maxProfit, profit)
        } else {
            left = right
        }

        right += 1
    }

    return maxProfit
}

fun maxProfit(prices: IntArray): Int {
    var minPrice = Integer.MAX_VALUE
    var maxProfit = 0

    for (i in prices.indices) {
        if (prices[i] < minPrice) {
            minPrice = prices[i]
        } else {
            val profit = prices[i] - minPrice
            maxProfit = kotlin.math.max(maxProfit, profit)
        }
    }

    return maxProfit
}

fun main() {
    val input1 = intArrayOf(7, 1, 5, 3, 6, 4)
    val input2 = intArrayOf(7, 6, 4, 3, 1)

    println("Prices input1 = ${maxProfitBruteForce(input1)}")
    println("Prices input2 = ${maxProfitBruteForce(input2)}")

    println("Prices input1 = ${maxProfitTwoPointer(input1)}")
    println("Prices input2 = ${maxProfitTwoPointer(input2)}")

    println("Prices input1 = ${maxProfit(input1)}")
    println("Prices input2 = ${maxProfit(input2)}")
}

Compiled from "BestTimeToBuyAndSellStock.kt"
public final class com.terencepeh.leetcodepractice.BestTimeToBuyAndSellStockKt {
  public static final int maxProfitBruteForce(int[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String prices
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_1
       8: iconst_0
       9: istore_2
      10: aload_0
      11: arraylength
      12: iconst_1
      13: isub
      14: istore_3
      15: iload_2
      16: iload_3
      17: if_icmpge     65
      20: iload_2
      21: istore        4
      23: aload_0
      24: arraylength
      25: istore        5
      27: iload         4
      29: iload         5
      31: if_icmpge     59
      34: aload_0
      35: iload         4
      37: iaload
      38: aload_0
      39: iload_2
      40: iaload
      41: isub
      42: istore        6
      44: iload         6
      46: iload_1
      47: if_icmple     53
      50: iload         6
      52: istore_1
      53: iinc          4, 1
      56: goto          27
      59: iinc          2, 1
      62: goto          15
      65: iload_1
      66: ireturn

  public static final int maxProfitTwoPointer(int[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String prices
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_1
       8: iconst_1
       9: istore_2
      10: iconst_0
      11: istore_3
      12: iload_2
      13: aload_0
      14: arraylength
      15: if_icmpge     54
      18: aload_0
      19: iload_1
      20: iaload
      21: aload_0
      22: iload_2
      23: iaload
      24: if_icmpge     46
      27: aload_0
      28: iload_2
      29: iaload
      30: aload_0
      31: iload_1
      32: iaload
      33: isub
      34: istore        4
      36: iload_3
      37: iload         4
      39: invokestatic  #28                 // Method java/lang/Math.max:(II)I
      42: istore_3
      43: goto          48
      46: iload_2
      47: istore_1
      48: iinc          2, 1
      51: goto          12
      54: iload_3
      55: ireturn

  public static final int maxProfit(int[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String prices
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #31                 // int 2147483647
       8: istore_1
       9: iconst_0
      10: istore_2
      11: iconst_0
      12: istore_3
      13: aload_0
      14: arraylength
      15: istore        4
      17: iload_3
      18: iload         4
      20: if_icmpge     57
      23: aload_0
      24: iload_3
      25: iaload
      26: iload_1
      27: if_icmpge     37
      30: aload_0
      31: iload_3
      32: iaload
      33: istore_1
      34: goto          51
      37: aload_0
      38: iload_3
      39: iaload
      40: iload_1
      41: isub
      42: istore        5
      44: iload_2
      45: iload         5
      47: invokestatic  #28                 // Method java/lang/Math.max:(II)I
      50: istore_2
      51: iinc          3, 1
      54: goto          17
      57: iload_2
      58: ireturn

  public static final void main();
    Code:
       0: bipush        6
       2: newarray       int
       4: astore_1
       5: aload_1
       6: iconst_0
       7: bipush        7
       9: iastore
      10: aload_1
      11: iconst_1
      12: iconst_1
      13: iastore
      14: aload_1
      15: iconst_2
      16: iconst_5
      17: iastore
      18: aload_1
      19: iconst_3
      20: iconst_3
      21: iastore
      22: aload_1
      23: iconst_4
      24: bipush        6
      26: iastore
      27: aload_1
      28: iconst_5
      29: iconst_4
      30: iastore
      31: aload_1
      32: astore_0
      33: iconst_5
      34: newarray       int
      36: astore_2
      37: aload_2
      38: iconst_0
      39: bipush        7
      41: iastore
      42: aload_2
      43: iconst_1
      44: bipush        6
      46: iastore
      47: aload_2
      48: iconst_2
      49: iconst_4
      50: iastore
      51: aload_2
      52: iconst_3
      53: iconst_3
      54: iastore
      55: aload_2
      56: iconst_4
      57: iconst_1
      58: iastore
      59: aload_2
      60: astore_1
      61: new           #37                 // class java/lang/StringBuilder
      64: dup
      65: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
      68: ldc           #42                 // String Prices input1 =
      70: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      73: aload_0
      74: invokestatic  #48                 // Method maxProfitBruteForce:([I)I
      77: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      80: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      83: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
      86: swap
      87: invokevirtual #67                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      90: new           #37                 // class java/lang/StringBuilder
      93: dup
      94: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
      97: ldc           #69                 // String Prices input2 =
      99: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     102: aload_1
     103: invokestatic  #48                 // Method maxProfitBruteForce:([I)I
     106: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     109: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     112: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
     115: swap
     116: invokevirtual #67                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     119: new           #37                 // class java/lang/StringBuilder
     122: dup
     123: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
     126: ldc           #42                 // String Prices input1 =
     128: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     131: aload_0
     132: invokestatic  #71                 // Method maxProfitTwoPointer:([I)I
     135: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     138: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     141: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
     144: swap
     145: invokevirtual #67                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     148: new           #37                 // class java/lang/StringBuilder
     151: dup
     152: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
     155: ldc           #69                 // String Prices input2 =
     157: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     160: aload_1
     161: invokestatic  #71                 // Method maxProfitTwoPointer:([I)I
     164: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     167: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     170: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
     173: swap
     174: invokevirtual #67                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     177: new           #37                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc           #42                 // String Prices input1 =
     186: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: aload_0
     190: invokestatic  #73                 // Method maxProfit:([I)I
     193: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     196: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     199: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
     202: swap
     203: invokevirtual #67                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     206: new           #37                 // class java/lang/StringBuilder
     209: dup
     210: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
     213: ldc           #69                 // String Prices input2 =
     215: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     218: aload_1
     219: invokestatic  #73                 // Method maxProfit:([I)I
     222: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     225: invokevirtual #55                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     228: getstatic     #61                 // Field java/lang/System.out:Ljava/io/PrintStream;
     231: swap
     232: invokevirtual #67                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     235: return

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


package dokerplp.bot.utli

import java.util.*

/*
Code was taken from
https://stackoverflow.com/questions/955110/similarity-string-comparison-in-java
 */

/**
 * Calculates the similarity (a number within 0 and 1) between two strings.
 */
fun stringSimilarity(s1: String, s2: String): Double {
  var longer = s1
  var shorter = s2
  if (s1.length < s2.length) { // longer should always have greater length
    longer = s2
    shorter = s1
  }
  val longerLength = longer.length
  return if (longerLength == 0) {
    1.0 /* both strings are zero length */
  } else (longerLength - editDistance(longer, shorter)) / longerLength.toDouble()
  /* // If you have Apache Commons Text, you can use it to calculate the edit distance:
  LevenshteinDistance levenshteinDistance = new LevenshteinDistance();
  return (longerLength - levenshteinDistance.apply(longer, shorter)) / (double) longerLength; */
}

// Example implementation of the Levenshtein Edit Distance
// See http://rosettacode.org/wiki/Levenshtein_distance#Java
private fun editDistance(s1: String, s2: String): Int {
  var s1 = s1
  var s2 = s2
  s1 = s1.lowercase(Locale.getDefault())
  s2 = s2.lowercase(Locale.getDefault())
  val costs = IntArray(s2.length + 1)
  for (i in 0..s1.length) {
    var lastValue = i
    for (j in 0..s2.length) {
      if (i == 0) costs[j] = j else {
        if (j > 0) {
          var newValue = costs[j - 1]
          if (s1[i - 1] != s2[j - 1]) newValue = Math.min(
            Math.min(newValue, lastValue),
            costs[j]
          ) + 1
          costs[j - 1] = lastValue
          lastValue = newValue
        }
      }
    }
    if (i > 0) costs[s2.length] = lastValue
  }
  return costs[s2.length]
}

Compiled from "StrignSimilarity.kt"
public final class dokerplp.bot.utli.StrignSimilarityKt {
  public static final double stringSimilarity(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: ldc           #9                  // String s1
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #17                 // String s2
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: astore_2
      14: aload_1
      15: astore_3
      16: aload_0
      17: invokevirtual #23                 // Method java/lang/String.length:()I
      20: aload_1
      21: invokevirtual #23                 // Method java/lang/String.length:()I
      24: if_icmpge     31
      27: aload_1
      28: astore_2
      29: aload_0
      30: astore_3
      31: aload_2
      32: invokevirtual #23                 // Method java/lang/String.length:()I
      35: istore        4
      37: iload         4
      39: ifne          46
      42: dconst_1
      43: goto          59
      46: iload         4
      48: aload_2
      49: aload_3
      50: invokestatic  #27                 // Method editDistance:(Ljava/lang/String;Ljava/lang/String;)I
      53: isub
      54: i2d
      55: iload         4
      57: i2d
      58: ddiv
      59: dreturn

  private static final int editDistance(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: astore_2
       2: aload_1
       3: astore_3
       4: aload_2
       5: astore        4
       7: invokestatic  #38                 // Method java/util/Locale.getDefault:()Ljava/util/Locale;
      10: dup
      11: ldc           #40                 // String getDefault(...)
      13: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      16: aload         4
      18: swap
      19: invokevirtual #47                 // Method java/lang/String.toLowerCase:(Ljava/util/Locale;)Ljava/lang/String;
      22: dup
      23: ldc           #49                 // String toLowerCase(...)
      25: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      28: astore_2
      29: aload_3
      30: astore        4
      32: invokestatic  #38                 // Method java/util/Locale.getDefault:()Ljava/util/Locale;
      35: dup
      36: ldc           #40                 // String getDefault(...)
      38: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      41: aload         4
      43: swap
      44: invokevirtual #47                 // Method java/lang/String.toLowerCase:(Ljava/util/Locale;)Ljava/lang/String;
      47: dup
      48: ldc           #49                 // String toLowerCase(...)
      50: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      53: astore_3
      54: aload_3
      55: invokevirtual #23                 // Method java/lang/String.length:()I
      58: iconst_1
      59: iadd
      60: newarray       int
      62: astore        4
      64: iconst_0
      65: istore        5
      67: aload_2
      68: invokevirtual #23                 // Method java/lang/String.length:()I
      71: istore        6
      73: iload         5
      75: iload         6
      77: if_icmpgt     220
      80: iload         5
      82: istore        7
      84: iconst_0
      85: istore        8
      87: aload_3
      88: invokevirtual #23                 // Method java/lang/String.length:()I
      91: istore        9
      93: iload         8
      95: iload         9
      97: if_icmpgt     193
     100: iload         5
     102: ifne          115
     105: aload         4
     107: iload         8
     109: iload         8
     111: iastore
     112: goto          180
     115: iload         8
     117: ifle          180
     120: aload         4
     122: iload         8
     124: iconst_1
     125: isub
     126: iaload
     127: istore        10
     129: aload_2
     130: iload         5
     132: iconst_1
     133: isub
     134: invokevirtual #53                 // Method java/lang/String.charAt:(I)C
     137: aload_3
     138: iload         8
     140: iconst_1
     141: isub
     142: invokevirtual #53                 // Method java/lang/String.charAt:(I)C
     145: if_icmpeq     167
     148: iload         10
     150: iload         7
     152: invokestatic  #59                 // Method java/lang/Math.min:(II)I
     155: aload         4
     157: iload         8
     159: iaload
     160: invokestatic  #59                 // Method java/lang/Math.min:(II)I
     163: iconst_1
     164: iadd
     165: istore        10
     167: aload         4
     169: iload         8
     171: iconst_1
     172: isub
     173: iload         7
     175: iastore
     176: iload         10
     178: istore        7
     180: iload         8
     182: iload         9
     184: if_icmpeq     193
     187: iinc          8, 1
     190: goto          100
     193: iload         5
     195: ifle          207
     198: aload         4
     200: aload_3
     201: invokevirtual #23                 // Method java/lang/String.length:()I
     204: iload         7
     206: iastore
     207: iload         5
     209: iload         6
     211: if_icmpeq     220
     214: iinc          5, 1
     217: goto          80
     220: aload         4
     222: aload_3
     223: invokevirtual #23                 // Method java/lang/String.length:()I
     226: iaload
     227: ireturn
}


package assertk.assertions.support

/**
 * List diffing using the Myers diff algorithm.
 */
internal object ListDiffer {

    fun diff(a: List<*>, b: List<*>): List<Edit> {
        val diff = mutableListOf<Edit>()
        backtrack(a, b) { prevX, prevY, x, y ->
            diff.add(
                0, when {
                    x == prevX -> Edit.Ins(prevY, b[prevY])
                    y == prevY -> Edit.Del(prevX, a[prevX])
                    else -> Edit.Eq(prevX, a[prevX], prevY, b[prevY])
                }
            )
        }
        return diff
    }

    sealed class Edit {
        sealed class Mod : Edit()
        data class Ins(val newIndex: Int, val newValue: Any?) : Mod()
        data class Del(val oldIndex: Int, val oldValue: Any?) : Mod()
        data class Eq(val oldIndex: Int, val oldValue: Any?, val newIndex: Int, val newValue: Any?) : Edit()
    }

    private fun shortestEdit(a: List<*>, b: List<*>): List<IntArray> {
        val n = a.size
        val m = b.size
        val max = n + m
        if (max == 0) {
            return emptyList()
        }
        val v = IntArray(2 * max + 1)
        val trace = mutableListOf<IntArray>()

        for (d in 0..max) {
            trace += v.copyOf()

            for (k in -d..d step 2) {
                var x = if (k == -d || (k != d && v.ringIndex(k - 1) < v.ringIndex(k + 1))) {
                    v.ringIndex(k + 1)
                } else {
                    v.ringIndex(k - 1) + 1
                }
                var y = x - k

                while (x < n && y < m && a[x] == b[y]) {
                    x += 1
                    y += 1
                }

                v.ringIndexAssign(k, x)

                if (x >= n && y >= m) {
                    return trace
                }
            }
        }

        return trace
    }

    private fun IntArray.ringIndex(index: Int): Int = this[if (index < 0) size + index else index]

    private fun IntArray.ringIndexAssign(index: Int, value: Int) {
        this[if (index < 0) size + index else index] = value
    }

    private fun backtrack(a: List<*>, b: List<*>, yield: (Int, Int, Int, Int) -> Unit) {
        var x = a.size
        var y = b.size

        val shortestEdit = shortestEdit(a, b)
        for (d in shortestEdit.size - 1 downTo 0) {
            val v = shortestEdit[d]

            val k = x - y

            val prevK = if (k == -d || (k != d && v.ringIndex(k - 1) < v.ringIndex(k + 1))) {
                k + 1
            } else {
                k - 1
            }

            val prevX = v.ringIndex(prevK)
            val prevY = prevX - prevK

            while (x > prevX && y > prevY) {
                yield(x - 1, y - 1, x, y)
                x -= 1
                y -= 1
            }
            if (d > 0) {
                yield(prevX, prevY, x, y)
            }
            x = prevX
            y = prevY
        }
    }
}

Compiled from "ListDiffer.kt"
public final class assertk.assertions.support.ListDiffer {
  public static final assertk.assertions.support.ListDiffer INSTANCE;

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

  public final java.util.List<assertk.assertions.support.ListDiffer$Edit> diff(java.util.List<?>, java.util.List<?>);
    Code:
       0: aload_1
       1: ldc           #16                 // String a
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #24                 // String b
       9: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #26                 // class java/util/ArrayList
      15: dup
      16: invokespecial #27                 // Method java/util/ArrayList."<init>":()V
      19: checkcast     #29                 // class java/util/List
      22: astore_3
      23: aload_0
      24: aload_1
      25: aload_2
      26: aload_3
      27: aload_2
      28: aload_1
      29: invokedynamic #49,  0             // InvokeDynamic #0:invoke:(Ljava/util/List;Ljava/util/List;Ljava/util/List;)Lkotlin/jvm/functions/Function4;
      34: invokespecial #53                 // Method backtrack:(Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function4;)V
      37: aload_3
      38: areturn

  private final java.util.List<int[]> shortestEdit(java.util.List<?>, java.util.List<?>);
    Code:
       0: aload_1
       1: invokeinterface #60,  1           // InterfaceMethod java/util/List.size:()I
       6: istore_3
       7: aload_2
       8: invokeinterface #60,  1           // InterfaceMethod java/util/List.size:()I
      13: istore        4
      15: iload_3
      16: iload         4
      18: iadd
      19: istore        5
      21: iload         5
      23: ifne          30
      26: invokestatic  #66                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      29: areturn
      30: iconst_2
      31: iload         5
      33: imul
      34: iconst_1
      35: iadd
      36: newarray       int
      38: astore        6
      40: new           #26                 // class java/util/ArrayList
      43: dup
      44: invokespecial #27                 // Method java/util/ArrayList."<init>":()V
      47: checkcast     #29                 // class java/util/List
      50: astore        7
      52: iconst_0
      53: istore        8
      55: iload         8
      57: iload         5
      59: if_icmpgt     281
      62: nop
      63: aload         7
      65: checkcast     #68                 // class java/util/Collection
      68: aload         6
      70: dup
      71: arraylength
      72: invokestatic  #74                 // Method java/util/Arrays.copyOf:([II)[I
      75: dup
      76: ldc           #76                 // String copyOf(...)
      78: invokestatic  #79                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      81: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      86: pop
      87: iload         8
      89: ineg
      90: istore        9
      92: iload         9
      94: istore        10
      96: iload         9
      98: iload         8
     100: iconst_2
     101: invokestatic  #89                 // Method kotlin/internal/ProgressionUtilKt.getProgressionLastElement:(III)I
     104: istore        11
     106: iload         10
     108: iload         11
     110: if_icmpgt     268
     113: iload         10
     115: iload         8
     117: ineg
     118: if_icmpeq     151
     121: iload         10
     123: iload         8
     125: if_icmpeq     164
     128: aload_0
     129: aload         6
     131: iload         10
     133: iconst_1
     134: isub
     135: invokespecial #93                 // Method ringIndex:([II)I
     138: aload_0
     139: aload         6
     141: iload         10
     143: iconst_1
     144: iadd
     145: invokespecial #93                 // Method ringIndex:([II)I
     148: if_icmpge     164
     151: aload_0
     152: aload         6
     154: iload         10
     156: iconst_1
     157: iadd
     158: invokespecial #93                 // Method ringIndex:([II)I
     161: goto          176
     164: aload_0
     165: aload         6
     167: iload         10
     169: iconst_1
     170: isub
     171: invokespecial #93                 // Method ringIndex:([II)I
     174: iconst_1
     175: iadd
     176: istore        12
     178: iload         12
     180: iload         10
     182: isub
     183: istore        13
     185: iload         12
     187: iload_3
     188: if_icmpge     229
     191: iload         13
     193: iload         4
     195: if_icmpge     229
     198: aload_1
     199: iload         12
     201: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     206: aload_2
     207: iload         13
     209: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     214: invokestatic  #101                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     217: ifeq          229
     220: iinc          12, 1
     223: iinc          13, 1
     226: goto          185
     229: aload_0
     230: aload         6
     232: iload         10
     234: iload         12
     236: invokespecial #105                // Method ringIndexAssign:([III)V
     239: iload         12
     241: iload_3
     242: if_icmplt     255
     245: iload         13
     247: iload         4
     249: if_icmplt     255
     252: aload         7
     254: areturn
     255: iload         10
     257: iload         11
     259: if_icmpeq     268
     262: iinc          10, 2
     265: goto          113
     268: iload         8
     270: iload         5
     272: if_icmpeq     281
     275: iinc          8, 1
     278: goto          62
     281: aload         7
     283: areturn

  private final int ringIndex(int[], int);
    Code:
       0: aload_1
       1: iload_2
       2: ifge          12
       5: aload_1
       6: arraylength
       7: iload_2
       8: iadd
       9: goto          13
      12: iload_2
      13: iaload
      14: ireturn

  private final void ringIndexAssign(int[], int, int);
    Code:
       0: aload_1
       1: iload_2
       2: ifge          12
       5: aload_1
       6: arraylength
       7: iload_2
       8: iadd
       9: goto          13
      12: iload_2
      13: iload_3
      14: iastore
      15: return

  private final void backtrack(java.util.List<?>, java.util.List<?>, kotlin.jvm.functions.Function4<? super java.lang.Integer, ? super java.lang.Integer, ? super java.lang.Integer, ? super java.lang.Integer, kotlin.Unit>);
    Code:
       0: aload_1
       1: invokeinterface #60,  1           // InterfaceMethod java/util/List.size:()I
       6: istore        4
       8: aload_2
       9: invokeinterface #60,  1           // InterfaceMethod java/util/List.size:()I
      14: istore        5
      16: aload_0
      17: aload_1
      18: aload_2
      19: invokespecial #124                // Method shortestEdit:(Ljava/util/List;Ljava/util/List;)Ljava/util/List;
      22: astore        6
      24: aload         6
      26: invokeinterface #60,  1           // InterfaceMethod java/util/List.size:()I
      31: iconst_1
      32: isub
      33: istore        7
      35: iconst_m1
      36: iload         7
      38: if_icmpge     230
      41: aload         6
      43: iload         7
      45: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      50: checkcast     #117                // class "[I"
      53: astore        8
      55: iload         4
      57: iload         5
      59: isub
      60: istore        9
      62: iload         9
      64: iload         7
      66: ineg
      67: if_icmpeq     100
      70: iload         9
      72: iload         7
      74: if_icmpeq     107
      77: aload_0
      78: aload         8
      80: iload         9
      82: iconst_1
      83: isub
      84: invokespecial #93                 // Method ringIndex:([II)I
      87: aload_0
      88: aload         8
      90: iload         9
      92: iconst_1
      93: iadd
      94: invokespecial #93                 // Method ringIndex:([II)I
      97: if_icmpge     107
     100: iload         9
     102: iconst_1
     103: iadd
     104: goto          111
     107: iload         9
     109: iconst_1
     110: isub
     111: istore        10
     113: aload_0
     114: aload         8
     116: iload         10
     118: invokespecial #93                 // Method ringIndex:([II)I
     121: istore        11
     123: iload         11
     125: iload         10
     127: isub
     128: istore        12
     130: iload         4
     132: iload         11
     134: if_icmple     184
     137: iload         5
     139: iload         12
     141: if_icmple     184
     144: aload_3
     145: iload         4
     147: iconst_1
     148: isub
     149: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     152: iload         5
     154: iconst_1
     155: isub
     156: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     159: iload         4
     161: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     164: iload         5
     166: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     169: invokeinterface #134,  5          // InterfaceMethod kotlin/jvm/functions/Function4.invoke:(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     174: pop
     175: iinc          4, -1
     178: iinc          5, -1
     181: goto          130
     184: iload         7
     186: ifle          216
     189: aload_3
     190: iload         11
     192: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     195: iload         12
     197: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     200: iload         4
     202: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     205: iload         5
     207: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     210: invokeinterface #134,  5          // InterfaceMethod kotlin/jvm/functions/Function4.invoke:(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     215: pop
     216: iload         11
     218: istore        4
     220: iload         12
     222: istore        5
     224: iinc          7, -1
     227: goto          35
     230: return

  private static final kotlin.Unit diff$lambda$0(java.util.List, java.util.List, java.util.List, int, int, int, int);
    Code:
       0: aload_0
       1: iconst_0
       2: iload         5
       4: iload_3
       5: if_icmpne     31
       8: new           #141                // class assertk/assertions/support/ListDiffer$Edit$Ins
      11: dup
      12: iload         4
      14: aload_1
      15: iload         4
      17: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      22: invokespecial #144                // Method assertk/assertions/support/ListDiffer$Edit$Ins."<init>":(ILjava/lang/Object;)V
      25: checkcast     #146                // class assertk/assertions/support/ListDiffer$Edit
      28: goto          87
      31: iload         6
      33: iload         4
      35: if_icmpne     59
      38: new           #148                // class assertk/assertions/support/ListDiffer$Edit$Del
      41: dup
      42: iload_3
      43: aload_2
      44: iload_3
      45: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      50: invokespecial #149                // Method assertk/assertions/support/ListDiffer$Edit$Del."<init>":(ILjava/lang/Object;)V
      53: checkcast     #146                // class assertk/assertions/support/ListDiffer$Edit
      56: goto          87
      59: new           #151                // class assertk/assertions/support/ListDiffer$Edit$Eq
      62: dup
      63: iload_3
      64: aload_2
      65: iload_3
      66: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      71: iload         4
      73: aload_1
      74: iload         4
      76: invokeinterface #97,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      81: invokespecial #154                // Method assertk/assertions/support/ListDiffer$Edit$Eq."<init>":(ILjava/lang/Object;ILjava/lang/Object;)V
      84: checkcast     #146                // class assertk/assertions/support/ListDiffer$Edit
      87: invokeinterface #156,  3          // InterfaceMethod java/util/List.add:(ILjava/lang/Object;)V
      92: getstatic     #162                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      95: areturn

  static {};
    Code:
       0: new           #2                  // class assertk/assertions/support/ListDiffer
       3: dup
       4: invokespecial #167                // Method "<init>":()V
       7: putstatic     #169                // Field INSTANCE:Lassertk/assertions/support/ListDiffer;
      10: return
}

Compiled from "ListDiffer.kt"
public final class assertk.assertions.support.ListDiffer$Edit$Eq extends assertk.assertions.support.ListDiffer$Edit {
  private final int oldIndex;

  private final java.lang.Object oldValue;

  private final int newIndex;

  private final java.lang.Object newValue;

  public assertk.assertions.support.ListDiffer$Edit$Eq(int, java.lang.Object, int, java.lang.Object);
    Code:
       0: aload_0
       1: aconst_null
       2: invokespecial #10                 // Method assertk/assertions/support/ListDiffer$Edit."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       5: aload_0
       6: iload_1
       7: putfield      #14                 // Field oldIndex:I
      10: aload_0
      11: aload_2
      12: putfield      #18                 // Field oldValue:Ljava/lang/Object;
      15: aload_0
      16: iload_3
      17: putfield      #21                 // Field newIndex:I
      20: aload_0
      21: aload         4
      23: putfield      #24                 // Field newValue:Ljava/lang/Object;
      26: return

  public final int getOldIndex();
    Code:
       0: aload_0
       1: getfield      #14                 // Field oldIndex:I
       4: ireturn

  public final java.lang.Object getOldValue();
    Code:
       0: aload_0
       1: getfield      #18                 // Field oldValue:Ljava/lang/Object;
       4: areturn

  public final int getNewIndex();
    Code:
       0: aload_0
       1: getfield      #21                 // Field newIndex:I
       4: ireturn

  public final java.lang.Object getNewValue();
    Code:
       0: aload_0
       1: getfield      #24                 // Field newValue:Ljava/lang/Object;
       4: areturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #14                 // Field oldIndex:I
       4: ireturn

  public final java.lang.Object component2();
    Code:
       0: aload_0
       1: getfield      #18                 // Field oldValue:Ljava/lang/Object;
       4: areturn

  public final int component3();
    Code:
       0: aload_0
       1: getfield      #21                 // Field newIndex:I
       4: ireturn

  public final java.lang.Object component4();
    Code:
       0: aload_0
       1: getfield      #24                 // Field newValue:Ljava/lang/Object;
       4: areturn

  public final assertk.assertions.support.ListDiffer$Edit$Eq copy(int, java.lang.Object, int, java.lang.Object);
    Code:
       0: new           #2                  // class assertk/assertions/support/ListDiffer$Edit$Eq
       3: dup
       4: iload_1
       5: aload_2
       6: iload_3
       7: aload         4
       9: invokespecial #41                 // Method "<init>":(ILjava/lang/Object;ILjava/lang/Object;)V
      12: areturn

  public static assertk.assertions.support.ListDiffer$Edit$Eq copy$default(assertk.assertions.support.ListDiffer$Edit$Eq, int, java.lang.Object, int, java.lang.Object, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #14                 // Field oldIndex:I
      11: istore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      23: astore_2
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #21                 // Field newIndex:I
      35: istore_3
      36: iload         5
      38: bipush        8
      40: iand
      41: ifeq          50
      44: aload_0
      45: getfield      #24                 // Field newValue:Ljava/lang/Object;
      48: astore        4
      50: aload_0
      51: iload_1
      52: aload_2
      53: iload_3
      54: aload         4
      56: invokevirtual #45                 // Method copy:(ILjava/lang/Object;ILjava/lang/Object;)Lassertk/assertions/support/ListDiffer$Edit$Eq;
      59: areturn

  public java.lang.String toString();
    Code:
       0: new           #49                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #52                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #54                 // String Eq(oldIndex=
       9: invokevirtual #58                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #14                 // Field oldIndex:I
      16: invokevirtual #61                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #63                 // String , oldValue=
      21: invokevirtual #58                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      28: invokevirtual #66                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: ldc           #68                 // String , newIndex=
      33: invokevirtual #58                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #21                 // Field newIndex:I
      40: invokevirtual #61                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: ldc           #70                 // String , newValue=
      45: invokevirtual #58                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: aload_0
      49: getfield      #24                 // Field newValue:Ljava/lang/Object;
      52: invokevirtual #66                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      55: bipush        41
      57: invokevirtual #73                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      60: invokevirtual #75                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      63: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #14                 // Field oldIndex:I
       4: invokestatic  #81                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      16: ifnonnull     23
      19: iconst_0
      20: goto          30
      23: aload_0
      24: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      27: invokevirtual #85                 // Method java/lang/Object.hashCode:()I
      30: iadd
      31: istore_1
      32: iload_1
      33: bipush        31
      35: imul
      36: aload_0
      37: getfield      #21                 // Field newIndex:I
      40: invokestatic  #81                 // Method java/lang/Integer.hashCode:(I)I
      43: iadd
      44: istore_1
      45: iload_1
      46: bipush        31
      48: imul
      49: aload_0
      50: getfield      #24                 // Field newValue:Ljava/lang/Object;
      53: ifnonnull     60
      56: iconst_0
      57: goto          67
      60: aload_0
      61: getfield      #24                 // Field newValue:Ljava/lang/Object;
      64: invokevirtual #85                 // Method java/lang/Object.hashCode:()I
      67: iadd
      68: istore_1
      69: iload_1
      70: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class assertk/assertions/support/ListDiffer$Edit$Eq
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class assertk/assertions/support/ListDiffer$Edit$Eq
      20: astore_2
      21: aload_0
      22: getfield      #14                 // Field oldIndex:I
      25: aload_2
      26: getfield      #14                 // Field oldIndex:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      38: aload_2
      39: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      42: invokestatic  #94                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      45: ifne          50
      48: iconst_0
      49: ireturn
      50: aload_0
      51: getfield      #21                 // Field newIndex:I
      54: aload_2
      55: getfield      #21                 // Field newIndex:I
      58: if_icmpeq     63
      61: iconst_0
      62: ireturn
      63: aload_0
      64: getfield      #24                 // Field newValue:Ljava/lang/Object;
      67: aload_2
      68: getfield      #24                 // Field newValue:Ljava/lang/Object;
      71: invokestatic  #94                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      74: ifne          79
      77: iconst_0
      78: ireturn
      79: iconst_1
      80: ireturn
}

Compiled from "ListDiffer.kt"
public abstract class assertk.assertions.support.ListDiffer$Edit$Mod extends assertk.assertions.support.ListDiffer$Edit {
  private assertk.assertions.support.ListDiffer$Edit$Mod();
    Code:
       0: aload_0
       1: aconst_null
       2: invokespecial #9                  // Method assertk/assertions/support/ListDiffer$Edit."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       5: return

  public assertk.assertions.support.ListDiffer$Edit$Mod(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #13                 // Method "<init>":()V
       4: return
}

Compiled from "ListDiffer.kt"
public final class assertk.assertions.support.ListDiffer$Edit$Ins extends assertk.assertions.support.ListDiffer$Edit$Mod {
  private final int newIndex;

  private final java.lang.Object newValue;

  public assertk.assertions.support.ListDiffer$Edit$Ins(int, java.lang.Object);
    Code:
       0: aload_0
       1: aconst_null
       2: invokespecial #10                 // Method assertk/assertions/support/ListDiffer$Edit$Mod."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       5: aload_0
       6: iload_1
       7: putfield      #14                 // Field newIndex:I
      10: aload_0
      11: aload_2
      12: putfield      #18                 // Field newValue:Ljava/lang/Object;
      15: return

  public final int getNewIndex();
    Code:
       0: aload_0
       1: getfield      #14                 // Field newIndex:I
       4: ireturn

  public final java.lang.Object getNewValue();
    Code:
       0: aload_0
       1: getfield      #18                 // Field newValue:Ljava/lang/Object;
       4: areturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #14                 // Field newIndex:I
       4: ireturn

  public final java.lang.Object component2();
    Code:
       0: aload_0
       1: getfield      #18                 // Field newValue:Ljava/lang/Object;
       4: areturn

  public final assertk.assertions.support.ListDiffer$Edit$Ins copy(int, java.lang.Object);
    Code:
       0: new           #2                  // class assertk/assertions/support/ListDiffer$Edit$Ins
       3: dup
       4: iload_1
       5: aload_2
       6: invokespecial #31                 // Method "<init>":(ILjava/lang/Object;)V
       9: areturn

  public static assertk.assertions.support.ListDiffer$Edit$Ins copy$default(assertk.assertions.support.ListDiffer$Edit$Ins, int, java.lang.Object, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #14                 // Field newIndex:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #18                 // Field newValue:Ljava/lang/Object;
      21: astore_2
      22: aload_0
      23: iload_1
      24: aload_2
      25: invokevirtual #35                 // Method copy:(ILjava/lang/Object;)Lassertk/assertions/support/ListDiffer$Edit$Ins;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #39                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #42                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #44                 // String Ins(newIndex=
       9: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #14                 // Field newIndex:I
      16: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #53                 // String , newValue=
      21: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #18                 // Field newValue:Ljava/lang/Object;
      28: invokevirtual #56                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #59                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #61                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #14                 // Field newIndex:I
       4: invokestatic  #67                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #18                 // Field newValue:Ljava/lang/Object;
      16: ifnonnull     23
      19: iconst_0
      20: goto          30
      23: aload_0
      24: getfield      #18                 // Field newValue:Ljava/lang/Object;
      27: invokevirtual #71                 // Method java/lang/Object.hashCode:()I
      30: iadd
      31: istore_1
      32: iload_1
      33: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class assertk/assertions/support/ListDiffer$Edit$Ins
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class assertk/assertions/support/ListDiffer$Edit$Ins
      20: astore_2
      21: aload_0
      22: getfield      #14                 // Field newIndex:I
      25: aload_2
      26: getfield      #14                 // Field newIndex:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #18                 // Field newValue:Ljava/lang/Object;
      38: aload_2
      39: getfield      #18                 // Field newValue:Ljava/lang/Object;
      42: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      45: ifne          50
      48: iconst_0
      49: ireturn
      50: iconst_1
      51: ireturn
}

Compiled from "ListDiffer.kt"
public abstract class assertk.assertions.support.ListDiffer$Edit {
  private assertk.assertions.support.ListDiffer$Edit();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public assertk.assertions.support.ListDiffer$Edit(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #12                 // Method "<init>":()V
       4: return
}

Compiled from "ListDiffer.kt"
public final class assertk.assertions.support.ListDiffer$Edit$Del extends assertk.assertions.support.ListDiffer$Edit$Mod {
  private final int oldIndex;

  private final java.lang.Object oldValue;

  public assertk.assertions.support.ListDiffer$Edit$Del(int, java.lang.Object);
    Code:
       0: aload_0
       1: aconst_null
       2: invokespecial #10                 // Method assertk/assertions/support/ListDiffer$Edit$Mod."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       5: aload_0
       6: iload_1
       7: putfield      #14                 // Field oldIndex:I
      10: aload_0
      11: aload_2
      12: putfield      #18                 // Field oldValue:Ljava/lang/Object;
      15: return

  public final int getOldIndex();
    Code:
       0: aload_0
       1: getfield      #14                 // Field oldIndex:I
       4: ireturn

  public final java.lang.Object getOldValue();
    Code:
       0: aload_0
       1: getfield      #18                 // Field oldValue:Ljava/lang/Object;
       4: areturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #14                 // Field oldIndex:I
       4: ireturn

  public final java.lang.Object component2();
    Code:
       0: aload_0
       1: getfield      #18                 // Field oldValue:Ljava/lang/Object;
       4: areturn

  public final assertk.assertions.support.ListDiffer$Edit$Del copy(int, java.lang.Object);
    Code:
       0: new           #2                  // class assertk/assertions/support/ListDiffer$Edit$Del
       3: dup
       4: iload_1
       5: aload_2
       6: invokespecial #31                 // Method "<init>":(ILjava/lang/Object;)V
       9: areturn

  public static assertk.assertions.support.ListDiffer$Edit$Del copy$default(assertk.assertions.support.ListDiffer$Edit$Del, int, java.lang.Object, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #14                 // Field oldIndex:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      21: astore_2
      22: aload_0
      23: iload_1
      24: aload_2
      25: invokevirtual #35                 // Method copy:(ILjava/lang/Object;)Lassertk/assertions/support/ListDiffer$Edit$Del;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #39                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #42                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #44                 // String Del(oldIndex=
       9: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #14                 // Field oldIndex:I
      16: invokevirtual #51                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #53                 // String , oldValue=
      21: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      28: invokevirtual #56                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #59                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #61                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #14                 // Field oldIndex:I
       4: invokestatic  #67                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      16: ifnonnull     23
      19: iconst_0
      20: goto          30
      23: aload_0
      24: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      27: invokevirtual #71                 // Method java/lang/Object.hashCode:()I
      30: iadd
      31: istore_1
      32: iload_1
      33: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class assertk/assertions/support/ListDiffer$Edit$Del
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class assertk/assertions/support/ListDiffer$Edit$Del
      20: astore_2
      21: aload_0
      22: getfield      #14                 // Field oldIndex:I
      25: aload_2
      26: getfield      #14                 // Field oldIndex:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      38: aload_2
      39: getfield      #18                 // Field oldValue:Ljava/lang/Object;
      42: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      45: ifne          50
      48: iconst_0
      49: ireturn
      50: iconst_1
      51: ireturn
}