package leetcode.problem0015

class ThreeSum {
    fun threeSum(nums: IntArray): List<List<Int>> {
        if (nums.isEmpty()) {
            return emptyList()
        }
        val answerMap = HashMap<Int, Int>()
        val answerSet = mutableSetOf<List<Int>>()
        nums.forEachIndexed { index, num ->
            if (answerMap.containsKey(num)) {
                return@forEachIndexed
            }

            val tmpList = nums.toMutableList()
            tmpList.removeAt(index)
            val twoSumList = twoSum(tmpList.toIntArray(), -num)
            twoSumList.forEach { twoSum ->
                if (twoSum.size != 2) {
                    return@forEach
                }
                val answer = listOf(num, twoSum[0], twoSum[1]).sorted()
                answerSet.add(answer)
            }
            answerMap[num] = index
        }

        return answerSet.toList()
    }

    private fun twoSum(nums: IntArray, target: Int): List<List<Int>> {
        val hashmap = HashMap<Int, Int>()

        val answerList = mutableListOf<List<Int>>()
        nums.forEachIndexed { index, value ->
            val missing = target - value
            if (hashmap.containsKey(missing) && hashmap[missing] != index) {
                hashmap[missing]?.let {
                    answerList.add(listOf(nums[it], value))
                }
            }
            hashmap[value] = index
        }
        return answerList
    }
}

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

  public final java.util.List<java.util.List<java.lang.Integer>> threeSum(int[]);
    Code:
       0: aload_1
       1: ldc           #16                 // String nums
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: arraylength
       8: ifne          15
      11: iconst_1
      12: goto          16
      15: iconst_0
      16: ifeq          23
      19: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      22: areturn
      23: new           #30                 // class java/util/HashMap
      26: dup
      27: invokespecial #31                 // Method java/util/HashMap."<init>":()V
      30: astore_2
      31: new           #33                 // class java/util/LinkedHashSet
      34: dup
      35: invokespecial #34                 // Method java/util/LinkedHashSet."<init>":()V
      38: checkcast     #36                 // class java/util/Set
      41: astore_3
      42: aload_1
      43: astore        4
      45: iconst_0
      46: istore        5
      48: iconst_0
      49: istore        6
      51: iconst_0
      52: istore        7
      54: aload         4
      56: arraylength
      57: istore        8
      59: iload         7
      61: iload         8
      63: if_icmpge     300
      66: aload         4
      68: iload         7
      70: iaload
      71: istore        9
      73: iload         6
      75: iinc          6, 1
      78: iload         9
      80: istore        10
      82: istore        11
      84: iconst_0
      85: istore        12
      87: aload_2
      88: iload         10
      90: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      93: invokevirtual #46                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
      96: ifeq          102
      99: goto          293
     102: aload_1
     103: invokestatic  #51                 // Method kotlin/collections/ArraysKt.toMutableList:([I)Ljava/util/List;
     106: astore        13
     108: aload         13
     110: iload         11
     112: invokeinterface #57,  2           // InterfaceMethod java/util/List.remove:(I)Ljava/lang/Object;
     117: pop
     118: aload_0
     119: aload         13
     121: checkcast     #59                 // class java/util/Collection
     124: invokestatic  #63                 // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I
     127: iload         10
     129: ineg
     130: invokespecial #67                 // Method twoSum:([II)Ljava/util/List;
     133: astore        14
     135: aload         14
     137: checkcast     #69                 // class java/lang/Iterable
     140: astore        15
     142: iconst_0
     143: istore        16
     145: aload         15
     147: invokeinterface #73,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     152: astore        17
     154: aload         17
     156: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     161: ifeq          263
     164: aload         17
     166: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     171: astore        18
     173: aload         18
     175: checkcast     #53                 // class java/util/List
     178: astore        19
     180: iconst_0
     181: istore        20
     183: aload         19
     185: invokeinterface #87,  1           // InterfaceMethod java/util/List.size:()I
     190: iconst_2
     191: if_icmpeq     197
     194: goto          259
     197: iconst_3
     198: anewarray     #38                 // class java/lang/Integer
     201: astore        21
     203: aload         21
     205: iconst_0
     206: iload         10
     208: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     211: aastore
     212: aload         21
     214: iconst_1
     215: aload         19
     217: iconst_0
     218: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     223: aastore
     224: aload         21
     226: iconst_2
     227: aload         19
     229: iconst_1
     230: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     235: aastore
     236: aload         21
     238: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     241: checkcast     #69                 // class java/lang/Iterable
     244: invokestatic  #98                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
     247: astore        22
     249: aload_3
     250: aload         22
     252: invokeinterface #101,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     257: pop
     258: nop
     259: nop
     260: goto          154
     263: nop
     264: iload         10
     266: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     269: astore        16
     271: iload         11
     273: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     276: astore        17
     278: aload_2
     279: checkcast     #103                // class java/util/Map
     282: aload         16
     284: aload         17
     286: invokeinterface #107,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     291: pop
     292: nop
     293: nop
     294: iinc          7, 1
     297: goto          59
     300: nop
     301: aload_3
     302: checkcast     #69                 // class java/lang/Iterable
     305: invokestatic  #110                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     308: areturn

  private final java.util.List<java.util.List<java.lang.Integer>> twoSum(int[], int);
    Code:
       0: new           #30                 // class java/util/HashMap
       3: dup
       4: invokespecial #31                 // Method java/util/HashMap."<init>":()V
       7: astore_3
       8: new           #137                // class java/util/ArrayList
      11: dup
      12: invokespecial #138                // Method java/util/ArrayList."<init>":()V
      15: checkcast     #53                 // class java/util/List
      18: astore        4
      20: aload_1
      21: astore        5
      23: iconst_0
      24: istore        6
      26: iconst_0
      27: istore        7
      29: iconst_0
      30: istore        8
      32: aload         5
      34: arraylength
      35: istore        9
      37: iload         8
      39: iload         9
      41: if_icmpge     221
      44: aload         5
      46: iload         8
      48: iaload
      49: istore        10
      51: iload         7
      53: iinc          7, 1
      56: iload         10
      58: istore        11
      60: istore        12
      62: iconst_0
      63: istore        13
      65: iload_2
      66: iload         11
      68: isub
      69: istore        14
      71: aload_3
      72: iload         14
      74: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      77: invokevirtual #46                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
      80: ifeq          185
      83: aload_3
      84: iload         14
      86: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      89: invokevirtual #141                // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
      92: checkcast     #38                 // class java/lang/Integer
      95: iload         12
      97: istore        15
      99: dup
     100: ifnonnull     107
     103: pop
     104: goto          115
     107: invokevirtual #144                // Method java/lang/Integer.intValue:()I
     110: iload         15
     112: if_icmpeq     185
     115: aload_3
     116: iload         14
     118: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     121: invokevirtual #141                // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     124: checkcast     #38                 // class java/lang/Integer
     127: dup
     128: ifnull        184
     131: checkcast     #146                // class java/lang/Number
     134: invokevirtual #147                // Method java/lang/Number.intValue:()I
     137: istore        16
     139: iconst_0
     140: istore        17
     142: aload         4
     144: iconst_2
     145: anewarray     #38                 // class java/lang/Integer
     148: astore        18
     150: aload         18
     152: iconst_0
     153: aload_1
     154: iload         16
     156: iaload
     157: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     160: aastore
     161: aload         18
     163: iconst_1
     164: iload         11
     166: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     169: aastore
     170: aload         18
     172: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     175: invokeinterface #148,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     180: pop
     181: goto          185
     184: pop
     185: iload         11
     187: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     190: astore        19
     192: iload         12
     194: invokestatic  #42                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     197: astore        16
     199: aload_3
     200: checkcast     #103                // class java/util/Map
     203: aload         19
     205: aload         16
     207: invokeinterface #107,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     212: pop
     213: nop
     214: nop
     215: iinc          8, 1
     218: goto          37
     221: nop
     222: aload         4
     224: areturn
}


package leetcode.problem0123

import java.lang.IllegalArgumentException
import kotlin.math.max

class BestTimeToBuyAndSellStock3 {
    fun maxProfit(prices: IntArray): Int {
        val dp: Map<Boolean, Array<IntArray>> =
            mapOf(
                true to Array(prices.size) { IntArray(MAX_PURCHASE_COUNT) { -1 } },
                false to Array(prices.size) { IntArray(MAX_PURCHASE_COUNT) { -1 } }
            )
        return solve(prices, 0, false, 0, dp)
    }

    private fun solve(
        prices: IntArray,
        index: Int,
        hasStock: Boolean,
        count: Int,
        dp: Map<Boolean, Array<IntArray>>
    ): Int {
        val map = dp[hasStock] ?: throw IllegalArgumentException()
        return when {
            index == prices.size || count == MAX_PURCHASE_COUNT -> 0
            map[index][count] != -1 -> map[index][count]
            else -> {
                if (hasStock) {
                    max(
                        prices[index] + solve(prices, index + 1, false, count + 1, dp),
                        solve(prices, index + 1, true, count, dp)
                    )
                } else {
                    max(
                        -prices[index] + solve(prices, index + 1, true, count, dp),
                        solve(prices, index + 1, false, count, dp)
                    )
                }
                    .also {
                        map[index][count] = it
                    }
            }
        }
    }

    companion object {
        private const val MAX_PURCHASE_COUNT = 2
    }
}

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

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

Compiled from "BestTimeToBuyAndSellStock3.kt"
public final class leetcode.problem0123.BestTimeToBuyAndSellStock3 {
  public static final leetcode.problem0123.BestTimeToBuyAndSellStock3$Companion Companion;

  private static final int MAX_PURCHASE_COUNT;

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

  public final int maxProfit(int[]);
    Code:
       0: aload_1
       1: ldc           #15                 // String prices
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_2
       7: anewarray     #23                 // class kotlin/Pair
      10: astore_3
      11: aload_3
      12: iconst_0
      13: iconst_1
      14: invokestatic  #29                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
      17: iconst_0
      18: istore        4
      20: aload_1
      21: arraylength
      22: istore        5
      24: iload         5
      26: anewarray     #31                 // class "[I"
      29: astore        6
      31: astore        13
      33: istore        12
      35: astore        11
      37: iload         4
      39: iload         5
      41: if_icmpge     99
      44: iload         4
      46: istore        7
      48: aload         6
      50: iload         7
      52: iconst_0
      53: istore        8
      55: iconst_2
      56: newarray       int
      58: astore        9
      60: istore        15
      62: astore        14
      64: iload         8
      66: iconst_2
      67: if_icmpge     86
      70: iload         8
      72: istore        10
      74: aload         9
      76: iload         10
      78: iconst_m1
      79: iastore
      80: iinc          8, 1
      83: goto          64
      86: aload         14
      88: iload         15
      90: aload         9
      92: aastore
      93: iinc          4, 1
      96: goto          37
      99: aload         11
     101: iload         12
     103: aload         13
     105: aload         6
     107: invokestatic  #37                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     110: aastore
     111: aload_3
     112: iconst_1
     113: iconst_0
     114: invokestatic  #29                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
     117: iconst_0
     118: istore        4
     120: aload_1
     121: arraylength
     122: istore        5
     124: iload         5
     126: anewarray     #31                 // class "[I"
     129: astore        6
     131: astore        13
     133: istore        12
     135: astore        11
     137: iload         4
     139: iload         5
     141: if_icmpge     199
     144: iload         4
     146: istore        7
     148: aload         6
     150: iload         7
     152: iconst_0
     153: istore        8
     155: iconst_2
     156: newarray       int
     158: astore        9
     160: istore        15
     162: astore        14
     164: iload         8
     166: iconst_2
     167: if_icmpge     186
     170: iload         8
     172: istore        10
     174: aload         9
     176: iload         10
     178: iconst_m1
     179: iastore
     180: iinc          8, 1
     183: goto          164
     186: aload         14
     188: iload         15
     190: aload         9
     192: aastore
     193: iinc          4, 1
     196: goto          137
     199: aload         11
     201: iload         12
     203: aload         13
     205: aload         6
     207: invokestatic  #37                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     210: aastore
     211: aload_3
     212: invokestatic  #43                 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     215: astore_2
     216: aload_0
     217: aload_1
     218: iconst_0
     219: iconst_0
     220: iconst_0
     221: aload_2
     222: invokespecial #47                 // Method solve:([IIZILjava/util/Map;)I
     225: ireturn

  private final int solve(int[], int, boolean, int, java.util.Map<java.lang.Boolean, int[][]>);
    Code:
       0: aload         5
       2: iload_3
       3: invokestatic  #29                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
       6: invokeinterface #60,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      11: checkcast     #53                 // class "[[I"
      14: dup
      15: ifnonnull     27
      18: pop
      19: new           #62                 // class java/lang/IllegalArgumentException
      22: dup
      23: invokespecial #63                 // Method java/lang/IllegalArgumentException."<init>":()V
      26: athrow
      27: astore        6
      29: nop
      30: iload_2
      31: aload_1
      32: arraylength
      33: if_icmpeq     42
      36: iload         4
      38: iconst_2
      39: if_icmpne     46
      42: iconst_0
      43: goto          166
      46: aload         6
      48: iload_2
      49: aaload
      50: iload         4
      52: iaload
      53: iconst_m1
      54: if_icmpeq     67
      57: aload         6
      59: iload_2
      60: aaload
      61: iload         4
      63: iaload
      64: goto          166
      67: iload_3
      68: ifeq          110
      71: nop
      72: aload_1
      73: iload_2
      74: iaload
      75: aload_0
      76: aload_1
      77: iload_2
      78: iconst_1
      79: iadd
      80: iconst_0
      81: iload         4
      83: iconst_1
      84: iadd
      85: aload         5
      87: invokespecial #47                 // Method solve:([IIZILjava/util/Map;)I
      90: iadd
      91: aload_0
      92: aload_1
      93: iload_2
      94: iconst_1
      95: iadd
      96: iconst_1
      97: iload         4
      99: aload         5
     101: invokespecial #47                 // Method solve:([IIZILjava/util/Map;)I
     104: invokestatic  #69                 // Method java/lang/Math.max:(II)I
     107: goto          145
     110: nop
     111: aload_1
     112: iload_2
     113: iaload
     114: ineg
     115: aload_0
     116: aload_1
     117: iload_2
     118: iconst_1
     119: iadd
     120: iconst_1
     121: iload         4
     123: aload         5
     125: invokespecial #47                 // Method solve:([IIZILjava/util/Map;)I
     128: iadd
     129: aload_0
     130: aload_1
     131: iload_2
     132: iconst_1
     133: iadd
     134: iconst_0
     135: iload         4
     137: aload         5
     139: invokespecial #47                 // Method solve:([IIZILjava/util/Map;)I
     142: invokestatic  #69                 // Method java/lang/Math.max:(II)I
     145: istore        7
     147: iload         7
     149: istore        8
     151: iconst_0
     152: istore        9
     154: aload         6
     156: iload_2
     157: aaload
     158: iload         4
     160: iload         8
     162: iastore
     163: nop
     164: iload         7
     166: ireturn

  static {};
    Code:
       0: new           #80                 // class leetcode/problem0123/BestTimeToBuyAndSellStock3$Companion
       3: dup
       4: aconst_null
       5: invokespecial #83                 // Method leetcode/problem0123/BestTimeToBuyAndSellStock3$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #87                 // Field Companion:Lleetcode/problem0123/BestTimeToBuyAndSellStock3$Companion;
      11: return
}


package leetcode.problem0051

class NQueens {
    fun solveNQueens(n: Int): List<List<String>> {
        val answer = arrayListOf<List<String>>()

        val board = Array(n) { CharArray(n) { '.' } }

        solve(board, 0, answer)

        return answer
    }

    private fun solve(board: Array<CharArray>, row: Int, answer: ArrayList<List<String>>) {
        if (row == board.size) {
            answer.add(board.map { it.joinToString("") })
            return
        }

        board[row].indices.forEach { column ->
            if (canPlace(board, row, column)) {
                board[row][column] = 'Q'
                solve(board, row + 1, answer)
                board[row][column] = '.'
            }
        }
    }

    private fun canPlace(board: Array<CharArray>, row: Int, column: Int): Boolean {
        if ('Q' in board[row]) {
            return false
        }
        if ('Q' in board.map { it[column] }) {
            return false
        }
        val leftDiagonal = (0 until row).mapNotNull {
            val diff = column - row
            if (it + diff >= 0 && it + diff <= board.lastIndex) board[it][it + diff] else null
        }
        if ('Q' in leftDiagonal) {
            return false
        }
        val rightDiagonal = (0 until row).mapNotNull {
            val sum = row + column
            if (it <= sum && sum - it <= board.lastIndex) board[it][sum - it] else null
        }
        if ('Q' in rightDiagonal) {
            return false
        }
        return true
    }
}

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

  public final java.util.List<java.util.List<java.lang.String>> solveNQueens(int);
    Code:
       0: new           #16                 // class java/util/ArrayList
       3: dup
       4: invokespecial #17                 // Method java/util/ArrayList."<init>":()V
       7: astore_2
       8: iconst_0
       9: istore        4
      11: iload_1
      12: anewarray     #19                 // class "[C"
      15: astore        5
      17: iload         4
      19: iload_1
      20: if_icmpge     79
      23: iload         4
      25: istore        6
      27: aload         5
      29: iload         6
      31: iconst_0
      32: istore        7
      34: iload_1
      35: newarray       char
      37: astore        8
      39: istore        11
      41: astore        10
      43: iload         7
      45: iload_1
      46: if_icmpge     66
      49: iload         7
      51: istore        9
      53: aload         8
      55: iload         9
      57: bipush        46
      59: castore
      60: iinc          7, 1
      63: goto          43
      66: aload         10
      68: iload         11
      70: aload         8
      72: aastore
      73: iinc          4, 1
      76: goto          17
      79: aload         5
      81: astore_3
      82: aload_0
      83: aload_3
      84: iconst_0
      85: aload_2
      86: invokespecial #23                 // Method solve:([[CILjava/util/ArrayList;)V
      89: aload_2
      90: checkcast     #25                 // class java/util/List
      93: areturn

  private final void solve(char[][], int, java.util.ArrayList<java.util.List<java.lang.String>>);
    Code:
       0: iload_2
       1: aload_1
       2: checkcast     #35                 // class "[Ljava/lang/Object;"
       5: arraylength
       6: if_icmpne     126
       9: aload_3
      10: aload_1
      11: checkcast     #35                 // class "[Ljava/lang/Object;"
      14: astore        4
      16: astore        14
      18: iconst_0
      19: istore        5
      21: aload         4
      23: astore        6
      25: new           #16                 // class java/util/ArrayList
      28: dup
      29: aload         4
      31: arraylength
      32: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
      35: checkcast     #40                 // class java/util/Collection
      38: astore        7
      40: iconst_0
      41: istore        8
      43: iconst_0
      44: istore        9
      46: aload         6
      48: arraylength
      49: istore        10
      51: iload         9
      53: iload         10
      55: if_icmpge     112
      58: aload         6
      60: iload         9
      62: aaload
      63: astore        11
      65: aload         7
      67: aload         11
      69: checkcast     #19                 // class "[C"
      72: astore        12
      74: astore        15
      76: iconst_0
      77: istore        13
      79: aload         12
      81: ldc           #42                 // String
      83: checkcast     #44                 // class java/lang/CharSequence
      86: aconst_null
      87: aconst_null
      88: iconst_0
      89: aconst_null
      90: aconst_null
      91: bipush        62
      93: aconst_null
      94: invokestatic  #50                 // Method kotlin/collections/ArraysKt.joinToString$default:([CLjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      97: aload         15
      99: swap
     100: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     105: pop
     106: iinc          9, 1
     109: goto          51
     112: aload         7
     114: checkcast     #25                 // class java/util/List
     117: nop
     118: aload         14
     120: swap
     121: invokevirtual #55                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     124: pop
     125: return
     126: aload_1
     127: iload_2
     128: aaload
     129: invokestatic  #59                 // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;
     132: checkcast     #61                 // class java/lang/Iterable
     135: astore        4
     137: iconst_0
     138: istore        5
     140: aload         4
     142: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     147: astore        6
     149: aload         6
     151: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     156: ifeq          217
     159: aload         6
     161: checkcast     #73                 // class kotlin/collections/IntIterator
     164: invokevirtual #77                 // Method kotlin/collections/IntIterator.nextInt:()I
     167: istore        7
     169: iload         7
     171: istore        8
     173: iconst_0
     174: istore        9
     176: aload_0
     177: aload_1
     178: iload_2
     179: iload         8
     181: invokespecial #81                 // Method canPlace:([[CII)Z
     184: ifeq          212
     187: aload_1
     188: iload_2
     189: aaload
     190: iload         8
     192: bipush        81
     194: castore
     195: aload_0
     196: aload_1
     197: iload_2
     198: iconst_1
     199: iadd
     200: aload_3
     201: invokespecial #23                 // Method solve:([[CILjava/util/ArrayList;)V
     204: aload_1
     205: iload_2
     206: aaload
     207: iload         8
     209: bipush        46
     211: castore
     212: nop
     213: nop
     214: goto          149
     217: nop
     218: return

  private final boolean canPlace(char[][], int, int);
    Code:
       0: aload_1
       1: iload_2
       2: aaload
       3: bipush        81
       5: invokestatic  #102                // Method kotlin/collections/ArraysKt.contains:([CC)Z
       8: ifeq          13
      11: iconst_0
      12: ireturn
      13: aload_1
      14: checkcast     #35                 // class "[Ljava/lang/Object;"
      17: astore        4
      19: iconst_0
      20: istore        5
      22: aload         4
      24: astore        6
      26: new           #16                 // class java/util/ArrayList
      29: dup
      30: aload         4
      32: arraylength
      33: invokespecial #38                 // Method java/util/ArrayList."<init>":(I)V
      36: checkcast     #40                 // class java/util/Collection
      39: astore        7
      41: iconst_0
      42: istore        8
      44: iconst_0
      45: istore        9
      47: aload         6
      49: arraylength
      50: istore        10
      52: iload         9
      54: iload         10
      56: if_icmpge     102
      59: aload         6
      61: iload         9
      63: aaload
      64: astore        11
      66: aload         7
      68: aload         11
      70: checkcast     #19                 // class "[C"
      73: astore        12
      75: astore        22
      77: iconst_0
      78: istore        13
      80: aload         12
      82: iload_3
      83: caload
      84: invokestatic  #108                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      87: aload         22
      89: swap
      90: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      95: pop
      96: iinc          9, 1
      99: goto          52
     102: aload         7
     104: checkcast     #25                 // class java/util/List
     107: nop
     108: bipush        81
     110: invokestatic  #108                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     113: invokeinterface #110,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     118: ifeq          123
     121: iconst_0
     122: ireturn
     123: iconst_0
     124: iload_2
     125: invokestatic  #116                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     128: checkcast     #61                 // class java/lang/Iterable
     131: astore        5
     133: iconst_0
     134: istore        6
     136: aload         5
     138: astore        7
     140: new           #16                 // class java/util/ArrayList
     143: dup
     144: invokespecial #17                 // Method java/util/ArrayList."<init>":()V
     147: checkcast     #40                 // class java/util/Collection
     150: astore        8
     152: iconst_0
     153: istore        9
     155: aload         7
     157: astore        10
     159: iconst_0
     160: istore        11
     162: aload         10
     164: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     169: astore        12
     171: aload         12
     173: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     178: ifeq          277
     181: aload         12
     183: checkcast     #73                 // class kotlin/collections/IntIterator
     186: invokevirtual #77                 // Method kotlin/collections/IntIterator.nextInt:()I
     189: istore        13
     191: iload         13
     193: istore        14
     195: iconst_0
     196: istore        15
     198: iload         14
     200: istore        16
     202: iconst_0
     203: istore        17
     205: iload_3
     206: iload_2
     207: isub
     208: istore        18
     210: iload         16
     212: iload         18
     214: iadd
     215: iflt          249
     218: iload         16
     220: iload         18
     222: iadd
     223: aload_1
     224: checkcast     #35                 // class "[Ljava/lang/Object;"
     227: invokestatic  #120                // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I
     230: if_icmpgt     249
     233: aload_1
     234: iload         16
     236: aaload
     237: iload         16
     239: iload         18
     241: iadd
     242: caload
     243: invokestatic  #108                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     246: goto          250
     249: aconst_null
     250: dup
     251: ifnull        272
     254: astore        19
     256: iconst_0
     257: istore        20
     259: aload         8
     261: aload         19
     263: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     268: pop
     269: goto          273
     272: pop
     273: nop
     274: goto          171
     277: nop
     278: aload         8
     280: checkcast     #25                 // class java/util/List
     283: nop
     284: astore        4
     286: aload         4
     288: bipush        81
     290: invokestatic  #108                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     293: invokeinterface #110,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     298: ifeq          303
     301: iconst_0
     302: ireturn
     303: iconst_0
     304: iload_2
     305: invokestatic  #116                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     308: checkcast     #61                 // class java/lang/Iterable
     311: astore        6
     313: iconst_0
     314: istore        7
     316: aload         6
     318: astore        8
     320: new           #16                 // class java/util/ArrayList
     323: dup
     324: invokespecial #17                 // Method java/util/ArrayList."<init>":()V
     327: checkcast     #40                 // class java/util/Collection
     330: astore        9
     332: iconst_0
     333: istore        10
     335: aload         8
     337: astore        11
     339: iconst_0
     340: istore        12
     342: aload         11
     344: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     349: astore        13
     351: aload         13
     353: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     358: ifeq          456
     361: aload         13
     363: checkcast     #73                 // class kotlin/collections/IntIterator
     366: invokevirtual #77                 // Method kotlin/collections/IntIterator.nextInt:()I
     369: istore        14
     371: iload         14
     373: istore        15
     375: iconst_0
     376: istore        16
     378: iload         15
     380: istore        17
     382: iconst_0
     383: istore        18
     385: iload_2
     386: iload_3
     387: iadd
     388: istore        19
     390: iload         17
     392: iload         19
     394: if_icmpgt     428
     397: iload         19
     399: iload         17
     401: isub
     402: aload_1
     403: checkcast     #35                 // class "[Ljava/lang/Object;"
     406: invokestatic  #120                // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I
     409: if_icmpgt     428
     412: aload_1
     413: iload         17
     415: aaload
     416: iload         19
     418: iload         17
     420: isub
     421: caload
     422: invokestatic  #108                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     425: goto          429
     428: aconst_null
     429: dup
     430: ifnull        451
     433: astore        20
     435: iconst_0
     436: istore        21
     438: aload         9
     440: aload         20
     442: invokeinterface #54,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     447: pop
     448: goto          452
     451: pop
     452: nop
     453: goto          351
     456: nop
     457: aload         9
     459: checkcast     #25                 // class java/util/List
     462: nop
     463: astore        5
     465: aload         5
     467: bipush        81
     469: invokestatic  #108                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     472: invokeinterface #110,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     477: ifeq          482
     480: iconst_0
     481: ireturn
     482: iconst_1
     483: ireturn
}


package leetcode.problem0005

import kotlin.math.max

class LongestPalindromicSubstring {
    fun longestPalindrome(s: String): String {
        if (s.isEmpty()) {
            return ""
        }
        var startIndex = 0
        var endIndex = 0

        for (index in 0..s.length) {
            val temp1 = findPalindrome(s, index, index)
            val temp2 = findPalindrome(s, index, index + 1)
            val maxPalindromeLength = max(temp1, temp2)
            if (maxPalindromeLength > endIndex - startIndex) {
                startIndex = index - (maxPalindromeLength - 1) / 2
                endIndex = index + maxPalindromeLength / 2 + 1
            }
        }
        return s.substring(startIndex, endIndex)
    }

    private fun findPalindrome(s: String, start: Int, end: Int): Int {
        var length = end - start
        for (index in 0..s.length) {
            if (start - index < 0 || end + index >= s.length || s[start - index] != s[end + index]) {
                break
            }
            length += 2
        }
        return length - 1
    }
}

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

  public final java.lang.String longestPalindrome(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String s
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #23                 // class java/lang/CharSequence
      10: invokeinterface #27,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      15: ifne          22
      18: iconst_1
      19: goto          23
      22: iconst_0
      23: ifeq          29
      26: ldc           #29                 // String
      28: areturn
      29: iconst_0
      30: istore_2
      31: iconst_0
      32: istore_3
      33: iconst_0
      34: istore        4
      36: aload_1
      37: invokevirtual #32                 // Method java/lang/String.length:()I
      40: istore        5
      42: iload         4
      44: iload         5
      46: if_icmpgt     123
      49: aload_0
      50: aload_1
      51: iload         4
      53: iload         4
      55: invokespecial #36                 // Method findPalindrome:(Ljava/lang/String;II)I
      58: istore        6
      60: aload_0
      61: aload_1
      62: iload         4
      64: iload         4
      66: iconst_1
      67: iadd
      68: invokespecial #36                 // Method findPalindrome:(Ljava/lang/String;II)I
      71: istore        7
      73: iload         6
      75: iload         7
      77: invokestatic  #42                 // Method java/lang/Math.max:(II)I
      80: istore        8
      82: iload         8
      84: iload_3
      85: iload_2
      86: isub
      87: if_icmple     110
      90: iload         4
      92: iload         8
      94: iconst_1
      95: isub
      96: iconst_2
      97: idiv
      98: isub
      99: istore_2
     100: iload         4
     102: iload         8
     104: iconst_2
     105: idiv
     106: iadd
     107: iconst_1
     108: iadd
     109: istore_3
     110: iload         4
     112: iload         5
     114: if_icmpeq     123
     117: iinc          4, 1
     120: goto          49
     123: aload_1
     124: iload_2
     125: iload_3
     126: invokevirtual #46                 // Method java/lang/String.substring:(II)Ljava/lang/String;
     129: dup
     130: ldc           #48                 // String substring(...)
     132: invokestatic  #51                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     135: areturn

  private final int findPalindrome(java.lang.String, int, int);
    Code:
       0: iload_3
       1: iload_2
       2: isub
       3: istore        4
       5: iconst_0
       6: istore        5
       8: aload_1
       9: invokevirtual #32                 // Method java/lang/String.length:()I
      12: istore        6
      14: iload         5
      16: iload         6
      18: if_icmpgt     77
      21: iload_2
      22: iload         5
      24: isub
      25: iflt          58
      28: iload_3
      29: iload         5
      31: iadd
      32: aload_1
      33: invokevirtual #32                 // Method java/lang/String.length:()I
      36: if_icmpge     58
      39: aload_1
      40: iload_2
      41: iload         5
      43: isub
      44: invokevirtual #63                 // Method java/lang/String.charAt:(I)C
      47: aload_1
      48: iload_3
      49: iload         5
      51: iadd
      52: invokevirtual #63                 // Method java/lang/String.charAt:(I)C
      55: if_icmpeq     61
      58: goto          77
      61: iinc          4, 2
      64: iload         5
      66: iload         6
      68: if_icmpeq     77
      71: iinc          5, 1
      74: goto          21
      77: iload         4
      79: iconst_1
      80: isub
      81: ireturn
}


package leetcode.problem0018

class FourSum {
    fun fourSum(nums: IntArray, target: Int): List<List<Int>> {
        val sortedNums = nums.sorted()

        return kSum(sortedNums, target, 4)
    }

    private fun kSum(sortedNums: List<Int>, target: Int, k: Int): List<List<Int>> {
        if (sortedNums.isEmpty()) {
            return emptyList()
        }
        val answerMap = HashMap<Int, List<List<Int>>>()
        sortedNums.forEachIndexed { index, num ->
            if (answerMap[num] != null) {
                return@forEachIndexed
            }
            val remainingNums = sortedNums.drop(index + 1)
            val answerList = if (k == 3) {
                twoSum(remainingNums, target - num)
            } else {
                kSum(remainingNums, target - num, k - 1)
            }
            answerMap[num] = answerList.map { getAnswer(num, it) }
        }
        return answerMap.flatMap { it.value }.distinct()
    }

    private fun getAnswer(num: Int, numList: List<Int>): List<Int> =
        mutableListOf(num).also {
            it.addAll(numList)
        }

    private fun twoSum(sortedNums: List<Int>, target: Int): List<List<Int>> {
        if (sortedNums.size < 2) {
            return emptyList()
        }

        val answerList = mutableListOf<List<Int>>()
        var left = 0
        var right = sortedNums.lastIndex

        while (left < right) {
            val leftValue = sortedNums[left]
            val rightValue = sortedNums[right]
            when {
                leftValue + rightValue == target -> {
                    answerList.add(listOf(leftValue, rightValue))
                    left += 1
                }
                leftValue + rightValue < target -> left += 1
                leftValue + rightValue > target -> right -= 1
            }
        }
        return answerList
    }
}

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

  public final java.util.List<java.util.List<java.lang.Integer>> fourSum(int[], int);
    Code:
       0: aload_1
       1: ldc           #16                 // String nums
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #28                 // Method kotlin/collections/ArraysKt.sorted:([I)Ljava/util/List;
      10: astore_3
      11: aload_0
      12: aload_3
      13: iload_2
      14: iconst_4
      15: invokespecial #32                 // Method kSum:(Ljava/util/List;II)Ljava/util/List;
      18: areturn

  private final java.util.List<java.util.List<java.lang.Integer>> kSum(java.util.List<java.lang.Integer>, int, int);
    Code:
       0: aload_1
       1: invokeinterface #44,  1           // InterfaceMethod java/util/List.isEmpty:()Z
       6: ifeq          13
       9: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      12: areturn
      13: new           #52                 // class java/util/HashMap
      16: dup
      17: invokespecial #53                 // Method java/util/HashMap."<init>":()V
      20: astore        4
      22: aload_1
      23: checkcast     #55                 // class java/lang/Iterable
      26: astore        5
      28: iconst_0
      29: istore        6
      31: iconst_0
      32: istore        7
      34: aload         5
      36: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        8
      43: aload         8
      45: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          293
      53: aload         8
      55: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        9
      62: iload         7
      64: iinc          7, 1
      67: istore        10
      69: iload         10
      71: ifge          77
      74: invokestatic  #71                 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      77: iload         10
      79: aload         9
      81: checkcast     #73                 // class java/lang/Number
      84: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      87: istore        11
      89: istore        12
      91: iconst_0
      92: istore        13
      94: aload         4
      96: iload         11
      98: invokestatic  #83                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     101: invokevirtual #87                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     104: ifnull        110
     107: goto          289
     110: aload_1
     111: checkcast     #55                 // class java/lang/Iterable
     114: iload         12
     116: iconst_1
     117: iadd
     118: invokestatic  #91                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     121: astore        14
     123: iload_3
     124: iconst_3
     125: if_icmpne     141
     128: aload_0
     129: aload         14
     131: iload_2
     132: iload         11
     134: isub
     135: invokespecial #95                 // Method twoSum:(Ljava/util/List;I)Ljava/util/List;
     138: goto          154
     141: aload_0
     142: aload         14
     144: iload_2
     145: iload         11
     147: isub
     148: iload_3
     149: iconst_1
     150: isub
     151: invokespecial #32                 // Method kSum:(Ljava/util/List;II)Ljava/util/List;
     154: astore        15
     156: aload         4
     158: checkcast     #97                 // class java/util/Map
     161: astore        16
     163: iload         11
     165: invokestatic  #83                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     168: astore        17
     170: aload         15
     172: checkcast     #55                 // class java/lang/Iterable
     175: astore        18
     177: iconst_0
     178: istore        19
     180: aload         18
     182: astore        20
     184: new           #99                 // class java/util/ArrayList
     187: dup
     188: aload         18
     190: bipush        10
     192: invokestatic  #103                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     195: invokespecial #106                // Method java/util/ArrayList."<init>":(I)V
     198: checkcast     #108                // class java/util/Collection
     201: astore        21
     203: iconst_0
     204: istore        22
     206: aload         20
     208: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     213: astore        23
     215: aload         23
     217: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     222: ifeq          268
     225: aload         23
     227: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     232: astore        24
     234: aload         21
     236: aload         24
     238: checkcast     #40                 // class java/util/List
     241: astore        25
     243: astore        26
     245: iconst_0
     246: istore        27
     248: aload_0
     249: iload         11
     251: aload         25
     253: invokespecial #112                // Method getAnswer:(ILjava/util/List;)Ljava/util/List;
     256: aload         26
     258: swap
     259: invokeinterface #116,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     264: pop
     265: goto          215
     268: aload         21
     270: checkcast     #40                 // class java/util/List
     273: nop
     274: astore        18
     276: aload         16
     278: aload         17
     280: aload         18
     282: invokeinterface #120,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     287: pop
     288: nop
     289: nop
     290: goto          43
     293: nop
     294: aload         4
     296: checkcast     #97                 // class java/util/Map
     299: astore        5
     301: iconst_0
     302: istore        6
     304: aload         5
     306: astore        7
     308: new           #99                 // class java/util/ArrayList
     311: dup
     312: invokespecial #121                // Method java/util/ArrayList."<init>":()V
     315: checkcast     #108                // class java/util/Collection
     318: astore        8
     320: iconst_0
     321: istore        9
     323: aload         7
     325: invokeinterface #125,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     330: invokeinterface #128,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     335: astore        10
     337: aload         10
     339: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     344: ifeq          389
     347: aload         10
     349: invokeinterface #68,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     354: checkcast     #130                // class java/util/Map$Entry
     357: astore        11
     359: aload         11
     361: astore        12
     363: iconst_0
     364: istore        13
     366: aload         12
     368: invokeinterface #133,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     373: checkcast     #55                 // class java/lang/Iterable
     376: astore        12
     378: aload         8
     380: aload         12
     382: invokestatic  #137                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     385: pop
     386: goto          337
     389: aload         8
     391: checkcast     #40                 // class java/util/List
     394: nop
     395: checkcast     #55                 // class java/lang/Iterable
     398: invokestatic  #141                // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;
     401: areturn

  private final java.util.List<java.lang.Integer> getAnswer(int, java.util.List<java.lang.Integer>);
    Code:
       0: iconst_1
       1: anewarray     #79                 // class java/lang/Integer
       4: astore_3
       5: aload_3
       6: iconst_0
       7: iload_1
       8: invokestatic  #83                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      11: aastore
      12: aload_3
      13: invokestatic  #178                // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
      16: astore_3
      17: aload_3
      18: astore        4
      20: iconst_0
      21: istore        5
      23: aload         4
      25: aload_2
      26: checkcast     #108                // class java/util/Collection
      29: invokeinterface #181,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
      34: pop
      35: nop
      36: aload_3
      37: areturn

  private final java.util.List<java.util.List<java.lang.Integer>> twoSum(java.util.List<java.lang.Integer>, int);
    Code:
       0: aload_1
       1: invokeinterface #187,  1          // InterfaceMethod java/util/List.size:()I
       6: iconst_2
       7: if_icmpge     14
      10: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      13: areturn
      14: new           #99                 // class java/util/ArrayList
      17: dup
      18: invokespecial #121                // Method java/util/ArrayList."<init>":()V
      21: checkcast     #40                 // class java/util/List
      24: astore_3
      25: iconst_0
      26: istore        4
      28: aload_1
      29: invokestatic  #191                // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I
      32: istore        5
      34: iload         4
      36: iload         5
      38: if_icmpge     155
      41: aload_1
      42: iload         4
      44: invokeinterface #194,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      49: checkcast     #73                 // class java/lang/Number
      52: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      55: istore        6
      57: aload_1
      58: iload         5
      60: invokeinterface #194,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      65: checkcast     #73                 // class java/lang/Number
      68: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      71: istore        7
      73: nop
      74: iload         6
      76: iload         7
      78: iadd
      79: iload_2
      80: if_icmpne     125
      83: aload_3
      84: iconst_2
      85: anewarray     #79                 // class java/lang/Integer
      88: astore        8
      90: aload         8
      92: iconst_0
      93: iload         6
      95: invokestatic  #83                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      98: aastore
      99: aload         8
     101: iconst_1
     102: iload         7
     104: invokestatic  #83                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     107: aastore
     108: aload         8
     110: invokestatic  #197                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     113: invokeinterface #198,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     118: pop
     119: iinc          4, 1
     122: goto          34
     125: iload         6
     127: iload         7
     129: iadd
     130: iload_2
     131: if_icmpge     140
     134: iinc          4, 1
     137: goto          34
     140: iload         6
     142: iload         7
     144: iadd
     145: iload_2
     146: if_icmple     34
     149: iinc          5, -1
     152: goto          34
     155: aload_3
     156: areturn
}