kt_path
stringlengths
35
167
kt_source
stringlengths
626
28.9k
classes
listlengths
1
17
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0063_UniquePathsII.kt
// https://leetcode.com/problems/unique-paths-ii fun uniquePathsWithObstacles(obstacleGrid: Array<IntArray>): Int { val lastRowIndex = obstacleGrid.lastIndex val lastColIndex = obstacleGrid.first().lastIndex val hasObstacle = obstacleGrid[lastRowIndex][lastColIndex] == 1 obstacleGrid[lastRowIndex][lastColIndex] = if (hasObstacle) 0 else 1 for (rowIndex in lastRowIndex - 1 downTo 0) { val row = obstacleGrid[rowIndex] if (row[lastColIndex] == 1 || obstacleGrid[rowIndex + 1][lastColIndex] == 0) { row[lastColIndex] = 0 } else { row[lastColIndex] = 1 } } for (colIndex in lastColIndex - 1 downTo 0) { val row = obstacleGrid.last() if (row[colIndex] == 1 || row[colIndex + 1] == 0) { row[colIndex] = 0 } else { row[colIndex] = 1 } } for (rowIndex in lastRowIndex - 1 downTo 0) { for (colIndex in lastColIndex - 1 downTo 0) { if (obstacleGrid[rowIndex][colIndex] == 1) { obstacleGrid[rowIndex][colIndex] = 0 } else { obstacleGrid[rowIndex][colIndex] = obstacleGrid[rowIndex + 1][colIndex] + obstacleGrid[rowIndex][colIndex + 1] } } } return obstacleGrid[0][0] }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0063_UniquePathsIIKt.class", "javap": "Compiled from \"_0063_UniquePathsII.kt\"\npublic final class _0063_UniquePathsIIKt {\n public static final int uniquePathsWithObstacles(int[][]);\n Code:\n 0: aload_0\n 1: ldc #9 // String obstacleGrid\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #17 // class \"[Ljava/lang/Object;\"\n 10: invokestatic #23 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I\n 13: istore_1\n 14: aload_0\n 15: checkcast #17 // class \"[Ljava/lang/Object;\"\n 18: invokestatic #27 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 21: checkcast #29 // class \"[I\"\n 24: invokestatic #32 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 27: istore_2\n 28: aload_0\n 29: iload_1\n 30: aaload\n 31: iload_2\n 32: iaload\n 33: iconst_1\n 34: if_icmpne 41\n 37: iconst_1\n 38: goto 42\n 41: iconst_0\n 42: istore_3\n 43: aload_0\n 44: iload_1\n 45: aaload\n 46: iload_2\n 47: iload_3\n 48: ifeq 55\n 51: iconst_0\n 52: goto 56\n 55: iconst_1\n 56: iastore\n 57: iload_1\n 58: iconst_1\n 59: isub\n 60: istore 4\n 62: iconst_m1\n 63: iload 4\n 65: if_icmpge 112\n 68: aload_0\n 69: iload 4\n 71: aaload\n 72: astore 5\n 74: aload 5\n 76: iload_2\n 77: iaload\n 78: iconst_1\n 79: if_icmpeq 93\n 82: aload_0\n 83: iload 4\n 85: iconst_1\n 86: iadd\n 87: aaload\n 88: iload_2\n 89: iaload\n 90: ifne 101\n 93: aload 5\n 95: iload_2\n 96: iconst_0\n 97: iastore\n 98: goto 106\n 101: aload 5\n 103: iload_2\n 104: iconst_1\n 105: iastore\n 106: iinc 4, -1\n 109: goto 62\n 112: iload_2\n 113: iconst_1\n 114: isub\n 115: istore 4\n 117: iconst_m1\n 118: iload 4\n 120: if_icmpge 175\n 123: aload_0\n 124: checkcast #17 // class \"[Ljava/lang/Object;\"\n 127: invokestatic #35 // Method kotlin/collections/ArraysKt.last:([Ljava/lang/Object;)Ljava/lang/Object;\n 130: checkcast #29 // class \"[I\"\n 133: astore 5\n 135: aload 5\n 137: iload 4\n 139: iaload\n 140: iconst_1\n 141: if_icmpeq 154\n 144: aload 5\n 146: iload 4\n 148: iconst_1\n 149: iadd\n 150: iaload\n 151: ifne 163\n 154: aload 5\n 156: iload 4\n 158: iconst_0\n 159: iastore\n 160: goto 169\n 163: aload 5\n 165: iload 4\n 167: iconst_1\n 168: iastore\n 169: iinc 4, -1\n 172: goto 117\n 175: iload_1\n 176: iconst_1\n 177: isub\n 178: istore 4\n 180: iconst_m1\n 181: iload 4\n 183: if_icmpge 257\n 186: iload_2\n 187: iconst_1\n 188: isub\n 189: istore 5\n 191: iconst_m1\n 192: iload 5\n 194: if_icmpge 251\n 197: aload_0\n 198: iload 4\n 200: aaload\n 201: iload 5\n 203: iaload\n 204: iconst_1\n 205: if_icmpne 219\n 208: aload_0\n 209: iload 4\n 211: aaload\n 212: iload 5\n 214: iconst_0\n 215: iastore\n 216: goto 245\n 219: aload_0\n 220: iload 4\n 222: aaload\n 223: iload 5\n 225: aload_0\n 226: iload 4\n 228: iconst_1\n 229: iadd\n 230: aaload\n 231: iload 5\n 233: iaload\n 234: aload_0\n 235: iload 4\n 237: aaload\n 238: iload 5\n 240: iconst_1\n 241: iadd\n 242: iaload\n 243: iadd\n 244: iastore\n 245: iinc 5, -1\n 248: goto 191\n 251: iinc 4, -1\n 254: goto 180\n 257: aload_0\n 258: iconst_0\n 259: aaload\n 260: iconst_0\n 261: iaload\n 262: ireturn\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0039_CombinationSum.kt
// https://leetcode.com/problems/combination-sum fun combinationSum(candidates: IntArray, target: Int): List<List<Int>> { return mutableListOf<List<Int>>().also { buildCombinations(candidates, startIndex = 0, target = target, combination = mutableListOf(), combinations = it) } } private fun buildCombinations( candidates: IntArray, startIndex: Int, target: Int, combination: MutableList<Int>, combinations: MutableList<List<Int>> ) { if (target == 0) { combinations.add(combination.toList()) return } for (index in startIndex..candidates.lastIndex) { val candidate = candidates[index] if (candidate <= target) { combination.add(candidate) buildCombinations( candidates = candidates, startIndex = index, target = target - candidate, combination = combination, combinations = combinations ) combination.removeLast() } } }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0039_CombinationSumKt.class", "javap": "Compiled from \"_0039_CombinationSum.kt\"\npublic final class _0039_CombinationSumKt {\n public static final java.util.List<java.util.List<java.lang.Integer>> combinationSum(int[], int);\n Code:\n 0: aload_0\n 1: ldc #10 // String candidates\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #18 // class java/util/ArrayList\n 9: dup\n 10: invokespecial #22 // Method java/util/ArrayList.\"<init>\":()V\n 13: checkcast #24 // class java/util/List\n 16: astore_2\n 17: aload_2\n 18: astore_3\n 19: iconst_0\n 20: istore 4\n 22: aload_0\n 23: iconst_0\n 24: iload_1\n 25: new #18 // class java/util/ArrayList\n 28: dup\n 29: invokespecial #22 // Method java/util/ArrayList.\"<init>\":()V\n 32: checkcast #24 // class java/util/List\n 35: aload_3\n 36: invokestatic #28 // Method buildCombinations:([IIILjava/util/List;Ljava/util/List;)V\n 39: nop\n 40: aload_2\n 41: areturn\n\n private static final void buildCombinations(int[], int, int, java.util.List<java.lang.Integer>, java.util.List<java.util.List<java.lang.Integer>>);\n Code:\n 0: iload_2\n 1: ifne 20\n 4: aload 4\n 6: aload_3\n 7: checkcast #37 // class java/lang/Iterable\n 10: invokestatic #43 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: invokeinterface #47, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 18: pop\n 19: return\n 20: iload_1\n 21: istore 5\n 23: aload_0\n 24: invokestatic #53 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 27: istore 6\n 29: iload 5\n 31: iload 6\n 33: if_icmpgt 93\n 36: aload_0\n 37: iload 5\n 39: iaload\n 40: istore 7\n 42: iload 7\n 44: iload_2\n 45: if_icmpgt 80\n 48: aload_3\n 49: iload 7\n 51: invokestatic #59 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 54: invokeinterface #47, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 59: pop\n 60: aload_0\n 61: iload 5\n 63: iload_2\n 64: iload 7\n 66: isub\n 67: aload_3\n 68: aload 4\n 70: invokestatic #28 // Method buildCombinations:([IIILjava/util/List;Ljava/util/List;)V\n 73: aload_3\n 74: invokeinterface #63, 1 // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;\n 79: pop\n 80: iload 5\n 82: iload 6\n 84: if_icmpeq 93\n 87: iinc 5, 1\n 90: goto 36\n 93: return\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0054_SpiralMatrix.kt
// https://leetcode.com/problems/spiral-matrix fun spiralOrder(matrix: Array<IntArray>): List<Int> { val numIndices = matrix.size * matrix.first().size val spiral = mutableListOf<Int>() val viewed = Array(matrix.size) { BooleanArray(matrix.first().size) } var row = 0 var col = 0 var rowOffset = 0 var colOffset = 1 while (spiral.size < numIndices) { spiral.add(matrix[row][col]) viewed[row][col] = true val isNextIndexValid = validIndex( row = row + rowOffset, col = col + colOffset, lastRow = matrix.lastIndex, lastCol = matrix.first().lastIndex ) if (!isNextIndexValid || viewed[row + rowOffset][col + colOffset]) { when { colOffset == 1 -> { rowOffset = 1 colOffset = 0 } rowOffset == 1 -> { rowOffset = 0 colOffset = -1 } colOffset == -1 -> { rowOffset = -1 colOffset = 0 } else -> { rowOffset = 0 colOffset = 1 } } } row += rowOffset col += colOffset } return spiral } private fun validIndex(row: Int, col: Int, lastRow: Int, lastCol: Int): Boolean { return row in 0..lastRow && col in 0..lastCol }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0054_SpiralMatrixKt.class", "javap": "Compiled from \"_0054_SpiralMatrix.kt\"\npublic final class _0054_SpiralMatrixKt {\n public static final java.util.List<java.lang.Integer> spiralOrder(int[][]);\n Code:\n 0: aload_0\n 1: ldc #10 // String matrix\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #18 // class \"[Ljava/lang/Object;\"\n 10: arraylength\n 11: aload_0\n 12: checkcast #18 // class \"[Ljava/lang/Object;\"\n 15: invokestatic #24 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 18: checkcast #26 // class \"[I\"\n 21: arraylength\n 22: imul\n 23: istore_1\n 24: new #28 // class java/util/ArrayList\n 27: dup\n 28: invokespecial #32 // Method java/util/ArrayList.\"<init>\":()V\n 31: checkcast #34 // class java/util/List\n 34: astore_2\n 35: iconst_0\n 36: istore 4\n 38: aload_0\n 39: checkcast #18 // class \"[Ljava/lang/Object;\"\n 42: arraylength\n 43: istore 5\n 45: iload 5\n 47: anewarray #36 // class \"[Z\"\n 50: astore 6\n 52: iload 4\n 54: iload 5\n 56: if_icmpge 87\n 59: iload 4\n 61: istore 7\n 63: aload 6\n 65: iload 7\n 67: aload_0\n 68: checkcast #18 // class \"[Ljava/lang/Object;\"\n 71: invokestatic #24 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 74: checkcast #26 // class \"[I\"\n 77: arraylength\n 78: newarray boolean\n 80: aastore\n 81: iinc 4, 1\n 84: goto 52\n 87: aload 6\n 89: astore_3\n 90: iconst_0\n 91: istore 4\n 93: iconst_0\n 94: istore 5\n 96: iconst_0\n 97: istore 6\n 99: iconst_1\n 100: istore 7\n 102: aload_2\n 103: invokeinterface #40, 1 // InterfaceMethod java/util/List.size:()I\n 108: iload_1\n 109: if_icmpge 262\n 112: aload_2\n 113: aload_0\n 114: iload 4\n 116: aaload\n 117: iload 5\n 119: iaload\n 120: invokestatic #46 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 123: invokeinterface #50, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 128: pop\n 129: aload_3\n 130: iload 4\n 132: aaload\n 133: iload 5\n 135: iconst_1\n 136: bastore\n 137: iload 4\n 139: iload 6\n 141: iadd\n 142: iload 5\n 144: iload 7\n 146: iadd\n 147: aload_0\n 148: checkcast #18 // class \"[Ljava/lang/Object;\"\n 151: invokestatic #54 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I\n 154: aload_0\n 155: checkcast #18 // class \"[Ljava/lang/Object;\"\n 158: invokestatic #24 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 161: checkcast #26 // class \"[I\"\n 164: invokestatic #57 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 167: invokestatic #61 // Method validIndex:(IIII)Z\n 170: istore 8\n 172: iload 8\n 174: ifeq 193\n 177: aload_3\n 178: iload 4\n 180: iload 6\n 182: iadd\n 183: aaload\n 184: iload 5\n 186: iload 7\n 188: iadd\n 189: baload\n 190: ifeq 245\n 193: nop\n 194: iload 7\n 196: iconst_1\n 197: if_icmpne 209\n 200: iconst_1\n 201: istore 6\n 203: iconst_0\n 204: istore 7\n 206: goto 245\n 209: iload 6\n 211: iconst_1\n 212: if_icmpne 224\n 215: iconst_0\n 216: istore 6\n 218: iconst_m1\n 219: istore 7\n 221: goto 245\n 224: iload 7\n 226: iconst_m1\n 227: if_icmpne 239\n 230: iconst_m1\n 231: istore 6\n 233: iconst_0\n 234: istore 7\n 236: goto 245\n 239: iconst_0\n 240: istore 6\n 242: iconst_1\n 243: istore 7\n 245: iload 4\n 247: iload 6\n 249: iadd\n 250: istore 4\n 252: iload 5\n 254: iload 7\n 256: iadd\n 257: istore 5\n 259: goto 102\n 262: aload_2\n 263: areturn\n\n private static final boolean validIndex(int, int, int, int);\n Code:\n 0: iconst_0\n 1: iload_0\n 2: if_icmpgt 18\n 5: iload_0\n 6: iload_2\n 7: if_icmpgt 14\n 10: iconst_1\n 11: goto 19\n 14: iconst_0\n 15: goto 19\n 18: iconst_0\n 19: ifeq 48\n 22: iconst_0\n 23: iload_1\n 24: if_icmpgt 40\n 27: iload_1\n 28: iload_3\n 29: if_icmpgt 36\n 32: iconst_1\n 33: goto 41\n 36: iconst_0\n 37: goto 41\n 40: iconst_0\n 41: ifeq 48\n 44: iconst_1\n 45: goto 49\n 48: iconst_0\n 49: ireturn\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0017_LetterCombinationsOfAPhoneNumber.kt
import java.lang.StringBuilder // https://leetcode.com/problems/letter-combinations-of-a-phone-number fun letterCombinations(digits: String): List<String> { val combinations = mutableListOf<String>() val digitToChars = mapOf( '2' to charArrayOf('a', 'b', 'c'), '3' to charArrayOf('d', 'e', 'f'), '4' to charArrayOf('g', 'h', 'i'), '5' to charArrayOf('j', 'k', 'l'), '6' to charArrayOf('m', 'n', 'o'), '7' to charArrayOf('p', 'q', 'r', 's'), '8' to charArrayOf('t', 'u', 'v'), '9' to charArrayOf('w', 'x', 'y', 'z') ) if (digits.isNotEmpty()) { buildCombinations(digits, 0, StringBuilder(), combinations, digitToChars) } return combinations } private fun buildCombinations( digits: String, index: Int, combination: StringBuilder, combinations: MutableList<String>, digitToChars: Map<Char, CharArray> ) { if (index == digits.length) { combinations.add(combination.toString()) return } for (char in digitToChars.getValue(digits[index])) { combination.append(char) buildCombinations(digits, index + 1, combination, combinations, digitToChars) combination.setLength(combination.length - 1) } }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0017_LetterCombinationsOfAPhoneNumberKt.class", "javap": "Compiled from \"_0017_LetterCombinationsOfAPhoneNumber.kt\"\npublic final class _0017_LetterCombinationsOfAPhoneNumberKt {\n public static final java.util.List<java.lang.String> letterCombinations(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #10 // String digits\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #18 // class java/util/ArrayList\n 9: dup\n 10: invokespecial #22 // Method java/util/ArrayList.\"<init>\":()V\n 13: checkcast #24 // class java/util/List\n 16: astore_1\n 17: bipush 8\n 19: anewarray #26 // class kotlin/Pair\n 22: astore_3\n 23: aload_3\n 24: iconst_0\n 25: bipush 50\n 27: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 30: iconst_3\n 31: newarray char\n 33: astore 4\n 35: aload 4\n 37: iconst_0\n 38: bipush 97\n 40: castore\n 41: aload 4\n 43: iconst_1\n 44: bipush 98\n 46: castore\n 47: aload 4\n 49: iconst_2\n 50: bipush 99\n 52: castore\n 53: aload 4\n 55: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 58: aastore\n 59: aload_3\n 60: iconst_1\n 61: bipush 51\n 63: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 66: iconst_3\n 67: newarray char\n 69: astore 4\n 71: aload 4\n 73: iconst_0\n 74: bipush 100\n 76: castore\n 77: aload 4\n 79: iconst_1\n 80: bipush 101\n 82: castore\n 83: aload 4\n 85: iconst_2\n 86: bipush 102\n 88: castore\n 89: aload 4\n 91: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 94: aastore\n 95: aload_3\n 96: iconst_2\n 97: bipush 52\n 99: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 102: iconst_3\n 103: newarray char\n 105: astore 4\n 107: aload 4\n 109: iconst_0\n 110: bipush 103\n 112: castore\n 113: aload 4\n 115: iconst_1\n 116: bipush 104\n 118: castore\n 119: aload 4\n 121: iconst_2\n 122: bipush 105\n 124: castore\n 125: aload 4\n 127: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 130: aastore\n 131: aload_3\n 132: iconst_3\n 133: bipush 53\n 135: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 138: iconst_3\n 139: newarray char\n 141: astore 4\n 143: aload 4\n 145: iconst_0\n 146: bipush 106\n 148: castore\n 149: aload 4\n 151: iconst_1\n 152: bipush 107\n 154: castore\n 155: aload 4\n 157: iconst_2\n 158: bipush 108\n 160: castore\n 161: aload 4\n 163: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 166: aastore\n 167: aload_3\n 168: iconst_4\n 169: bipush 54\n 171: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 174: iconst_3\n 175: newarray char\n 177: astore 4\n 179: aload 4\n 181: iconst_0\n 182: bipush 109\n 184: castore\n 185: aload 4\n 187: iconst_1\n 188: bipush 110\n 190: castore\n 191: aload 4\n 193: iconst_2\n 194: bipush 111\n 196: castore\n 197: aload 4\n 199: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 202: aastore\n 203: aload_3\n 204: iconst_5\n 205: bipush 55\n 207: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 210: iconst_4\n 211: newarray char\n 213: astore 4\n 215: aload 4\n 217: iconst_0\n 218: bipush 112\n 220: castore\n 221: aload 4\n 223: iconst_1\n 224: bipush 113\n 226: castore\n 227: aload 4\n 229: iconst_2\n 230: bipush 114\n 232: castore\n 233: aload 4\n 235: iconst_3\n 236: bipush 115\n 238: castore\n 239: aload 4\n 241: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 244: aastore\n 245: aload_3\n 246: bipush 6\n 248: bipush 56\n 250: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 253: iconst_3\n 254: newarray char\n 256: astore 4\n 258: aload 4\n 260: iconst_0\n 261: bipush 116\n 263: castore\n 264: aload 4\n 266: iconst_1\n 267: bipush 117\n 269: castore\n 270: aload 4\n 272: iconst_2\n 273: bipush 118\n 275: castore\n 276: aload 4\n 278: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 281: aastore\n 282: aload_3\n 283: bipush 7\n 285: bipush 57\n 287: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 290: iconst_4\n 291: newarray char\n 293: astore 4\n 295: aload 4\n 297: iconst_0\n 298: bipush 119\n 300: castore\n 301: aload 4\n 303: iconst_1\n 304: bipush 120\n 306: castore\n 307: aload 4\n 309: iconst_2\n 310: bipush 121\n 312: castore\n 313: aload 4\n 315: iconst_3\n 316: bipush 122\n 318: castore\n 319: aload 4\n 321: invokestatic #38 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 324: aastore\n 325: aload_3\n 326: invokestatic #44 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 329: astore_2\n 330: aload_0\n 331: checkcast #46 // class java/lang/CharSequence\n 334: invokeinterface #50, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 339: ifle 346\n 342: iconst_1\n 343: goto 347\n 346: iconst_0\n 347: ifeq 364\n 350: aload_0\n 351: iconst_0\n 352: new #52 // class java/lang/StringBuilder\n 355: dup\n 356: invokespecial #53 // Method java/lang/StringBuilder.\"<init>\":()V\n 359: aload_1\n 360: aload_2\n 361: invokestatic #57 // Method buildCombinations:(Ljava/lang/String;ILjava/lang/StringBuilder;Ljava/util/List;Ljava/util/Map;)V\n 364: aload_1\n 365: areturn\n\n private static final void buildCombinations(java.lang.String, int, java.lang.StringBuilder, java.util.List<java.lang.String>, java.util.Map<java.lang.Character, char[]>);\n Code:\n 0: iload_1\n 1: aload_0\n 2: invokevirtual #72 // Method java/lang/String.length:()I\n 5: if_icmpne 26\n 8: aload_3\n 9: aload_2\n 10: invokevirtual #76 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 13: dup\n 14: ldc #78 // String toString(...)\n 16: invokestatic #81 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: invokeinterface #85, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 24: pop\n 25: return\n 26: aload 4\n 28: aload_0\n 29: iload_1\n 30: invokevirtual #89 // Method java/lang/String.charAt:(I)C\n 33: invokestatic #32 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 36: invokestatic #93 // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;\n 39: checkcast #70 // class \"[C\"\n 42: astore 5\n 44: iconst_0\n 45: istore 6\n 47: aload 5\n 49: arraylength\n 50: istore 7\n 52: iload 6\n 54: iload 7\n 56: if_icmpge 100\n 59: aload 5\n 61: iload 6\n 63: caload\n 64: istore 8\n 66: aload_2\n 67: iload 8\n 69: invokevirtual #97 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 72: pop\n 73: aload_0\n 74: iload_1\n 75: iconst_1\n 76: iadd\n 77: aload_2\n 78: aload_3\n 79: aload 4\n 81: invokestatic #57 // Method buildCombinations:(Ljava/lang/String;ILjava/lang/StringBuilder;Ljava/util/List;Ljava/util/Map;)V\n 84: aload_2\n 85: aload_2\n 86: invokevirtual #98 // Method java/lang/StringBuilder.length:()I\n 89: iconst_1\n 90: isub\n 91: invokevirtual #102 // Method java/lang/StringBuilder.setLength:(I)V\n 94: iinc 6, 1\n 97: goto 52\n 100: return\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0072_EditDistance.kt
// https://leetcode.com/problems/edit-distance fun minDistance(word1: String, word2: String): Int { return minDistance(word1, word2, 0, 0, Array(word1.length) { IntArray(word2.length) { -1 } }) } private fun minDistance(word1: String, word2: String, index1: Int, index2: Int, memo: Array<IntArray>): Int { if (word1.length == index1) { return word2.length - index2 } if (word2.length == index2) { return word1.length - index1 } if (memo[index1][index2] != -1) { return memo[index1][index2] } memo[index1][index2] = if (word1[index1] == word2[index2]) { minDistance(word1, word2, index1 + 1, index2 + 1, memo) } else { val insert = minDistance(word1, word2, index1, index2 + 1, memo) val remove = minDistance(word1, word2, index1 + 1, index2, memo) val replace = minDistance(word1, word2, index1 + 1, index2 + 1, memo) 1 + minOf(insert, remove, replace) } return memo[index1][index2] }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0072_EditDistanceKt.class", "javap": "Compiled from \"_0072_EditDistance.kt\"\npublic final class _0072_EditDistanceKt {\n public static final int minDistance(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #9 // String word1\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #17 // String word2\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: aload_1\n 14: iconst_0\n 15: iconst_0\n 16: iconst_0\n 17: istore_2\n 18: aload_0\n 19: invokevirtual #23 // Method java/lang/String.length:()I\n 22: istore_3\n 23: iload_3\n 24: anewarray #25 // class \"[I\"\n 27: astore 4\n 29: istore 13\n 31: istore 12\n 33: astore 11\n 35: astore 10\n 37: iload_2\n 38: iload_3\n 39: if_icmpge 104\n 42: iload_2\n 43: istore 5\n 45: aload 4\n 47: iload 5\n 49: iconst_0\n 50: istore 6\n 52: aload_1\n 53: invokevirtual #23 // Method java/lang/String.length:()I\n 56: istore 7\n 58: iload 7\n 60: newarray int\n 62: astore 8\n 64: istore 15\n 66: astore 14\n 68: iload 6\n 70: iload 7\n 72: if_icmpge 91\n 75: iload 6\n 77: istore 9\n 79: aload 8\n 81: iload 9\n 83: iconst_m1\n 84: iastore\n 85: iinc 6, 1\n 88: goto 68\n 91: aload 14\n 93: iload 15\n 95: aload 8\n 97: aastore\n 98: iinc 2, 1\n 101: goto 37\n 104: aload 10\n 106: aload 11\n 108: iload 12\n 110: iload 13\n 112: aload 4\n 114: invokestatic #28 // Method minDistance:(Ljava/lang/String;Ljava/lang/String;II[[I)I\n 117: ireturn\n\n private static final int minDistance(java.lang.String, java.lang.String, int, int, int[][]);\n Code:\n 0: aload_0\n 1: invokevirtual #23 // Method java/lang/String.length:()I\n 4: iload_2\n 5: if_icmpne 15\n 8: aload_1\n 9: invokevirtual #23 // Method java/lang/String.length:()I\n 12: iload_3\n 13: isub\n 14: ireturn\n 15: aload_1\n 16: invokevirtual #23 // Method java/lang/String.length:()I\n 19: iload_3\n 20: if_icmpne 30\n 23: aload_0\n 24: invokevirtual #23 // Method java/lang/String.length:()I\n 27: iload_2\n 28: isub\n 29: ireturn\n 30: aload 4\n 32: iload_2\n 33: aaload\n 34: iload_3\n 35: iaload\n 36: iconst_m1\n 37: if_icmpeq 47\n 40: aload 4\n 42: iload_2\n 43: aaload\n 44: iload_3\n 45: iaload\n 46: ireturn\n 47: aload 4\n 49: iload_2\n 50: aaload\n 51: iload_3\n 52: aload_0\n 53: iload_2\n 54: invokevirtual #35 // Method java/lang/String.charAt:(I)C\n 57: aload_1\n 58: iload_3\n 59: invokevirtual #35 // Method java/lang/String.charAt:(I)C\n 62: if_icmpne 81\n 65: aload_0\n 66: aload_1\n 67: iload_2\n 68: iconst_1\n 69: iadd\n 70: iload_3\n 71: iconst_1\n 72: iadd\n 73: aload 4\n 75: invokestatic #28 // Method minDistance:(Ljava/lang/String;Ljava/lang/String;II[[I)I\n 78: goto 136\n 81: aload_0\n 82: aload_1\n 83: iload_2\n 84: iload_3\n 85: iconst_1\n 86: iadd\n 87: aload 4\n 89: invokestatic #28 // Method minDistance:(Ljava/lang/String;Ljava/lang/String;II[[I)I\n 92: istore 5\n 94: aload_0\n 95: aload_1\n 96: iload_2\n 97: iconst_1\n 98: iadd\n 99: iload_3\n 100: aload 4\n 102: invokestatic #28 // Method minDistance:(Ljava/lang/String;Ljava/lang/String;II[[I)I\n 105: istore 6\n 107: aload_0\n 108: aload_1\n 109: iload_2\n 110: iconst_1\n 111: iadd\n 112: iload_3\n 113: iconst_1\n 114: iadd\n 115: aload 4\n 117: invokestatic #28 // Method minDistance:(Ljava/lang/String;Ljava/lang/String;II[[I)I\n 120: istore 7\n 122: iconst_1\n 123: iload 5\n 125: iload 6\n 127: iload 7\n 129: invokestatic #41 // Method java/lang/Math.min:(II)I\n 132: invokestatic #41 // Method java/lang/Math.min:(II)I\n 135: iadd\n 136: iastore\n 137: aload 4\n 139: iload_2\n 140: aaload\n 141: iload_3\n 142: iaload\n 143: ireturn\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0040_CombinationSumII.kt
// https://leetcode.com/problems/combination-sum-ii fun combinationSum2(candidates: IntArray, target: Int): List<List<Int>> { candidates.sort() return mutableSetOf<List<Int>>().also { buildCombinations(candidates, startIndex = 0, target = target, combination = mutableListOf(), combinations = it) }.toList() } private fun buildCombinations( candidates: IntArray, startIndex: Int, target: Int, combination: MutableList<Int>, combinations: MutableSet<List<Int>> ) { if (target == 0) { combinations.add(combination.toList()) return } var index = startIndex while (index <= candidates.lastIndex) { val candidate = candidates[index] if (candidate <= target) { combination.add(candidate) buildCombinations( candidates = candidates, startIndex = index + 1, target = target - candidate, combination = combination, combinations = combinations ) combination.removeLast() } while (index <= candidates.lastIndex && candidates[index] == candidate) { index++ } } }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0040_CombinationSumIIKt.class", "javap": "Compiled from \"_0040_CombinationSumII.kt\"\npublic final class _0040_CombinationSumIIKt {\n public static final java.util.List<java.util.List<java.lang.Integer>> combinationSum2(int[], int);\n Code:\n 0: aload_0\n 1: ldc #10 // String candidates\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #22 // Method kotlin/collections/ArraysKt.sort:([I)V\n 10: new #24 // class java/util/LinkedHashSet\n 13: dup\n 14: invokespecial #28 // Method java/util/LinkedHashSet.\"<init>\":()V\n 17: checkcast #30 // class java/util/Set\n 20: astore_2\n 21: aload_2\n 22: astore_3\n 23: iconst_0\n 24: istore 4\n 26: aload_0\n 27: iconst_0\n 28: iload_1\n 29: new #32 // class java/util/ArrayList\n 32: dup\n 33: invokespecial #33 // Method java/util/ArrayList.\"<init>\":()V\n 36: checkcast #35 // class java/util/List\n 39: aload_3\n 40: invokestatic #39 // Method buildCombinations:([IIILjava/util/List;Ljava/util/Set;)V\n 43: nop\n 44: aload_2\n 45: checkcast #41 // class java/lang/Iterable\n 48: invokestatic #47 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 51: areturn\n\n private static final void buildCombinations(int[], int, int, java.util.List<java.lang.Integer>, java.util.Set<java.util.List<java.lang.Integer>>);\n Code:\n 0: iload_2\n 1: ifne 20\n 4: aload 4\n 6: aload_3\n 7: checkcast #41 // class java/lang/Iterable\n 10: invokestatic #47 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: invokeinterface #58, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 18: pop\n 19: return\n 20: iload_1\n 21: istore 5\n 23: iload 5\n 25: aload_0\n 26: invokestatic #62 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 29: if_icmpgt 102\n 32: aload_0\n 33: iload 5\n 35: iaload\n 36: istore 6\n 38: iload 6\n 40: iload_2\n 41: if_icmpgt 78\n 44: aload_3\n 45: iload 6\n 47: invokestatic #68 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 50: invokeinterface #69, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 55: pop\n 56: aload_0\n 57: iload 5\n 59: iconst_1\n 60: iadd\n 61: iload_2\n 62: iload 6\n 64: isub\n 65: aload_3\n 66: aload 4\n 68: invokestatic #39 // Method buildCombinations:([IIILjava/util/List;Ljava/util/Set;)V\n 71: aload_3\n 72: invokeinterface #73, 1 // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;\n 77: pop\n 78: iload 5\n 80: aload_0\n 81: invokestatic #62 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 84: if_icmpgt 23\n 87: aload_0\n 88: iload 5\n 90: iaload\n 91: iload 6\n 93: if_icmpne 23\n 96: iinc 5, 1\n 99: goto 78\n 102: return\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0064_MinimumPathSum.kt
import kotlin.math.min // https://leetcode.com/problems/minimum-path-sum fun minPathSum(grid: Array<IntArray>): Int { val lastRow = grid.lastIndex val lastCol = grid.first().lastIndex val memo = Array(lastRow + 1) { IntArray(lastCol + 1) } memo[lastRow][lastCol] = grid[lastRow][lastCol] for (row in lastRow - 1 downTo 0) { memo[row][lastCol] = grid[row][lastCol] + memo[row + 1][lastCol] } for (col in lastCol - 1 downTo 0) { memo[lastRow][col] = grid[lastRow][col] + memo[lastRow][col + 1] } for (row in lastRow - 1 downTo 0) { for (col in lastCol - 1 downTo 0) { memo[row][col] = grid[row][col] + min(memo[row + 1][col], memo[row][col + 1]) } } return memo[0][0] }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0064_MinimumPathSumKt.class", "javap": "Compiled from \"_0064_MinimumPathSum.kt\"\npublic final class _0064_MinimumPathSumKt {\n public static final int minPathSum(int[][]);\n Code:\n 0: aload_0\n 1: ldc #9 // String grid\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #17 // class \"[Ljava/lang/Object;\"\n 10: invokestatic #23 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I\n 13: istore_1\n 14: aload_0\n 15: checkcast #17 // class \"[Ljava/lang/Object;\"\n 18: invokestatic #27 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 21: checkcast #29 // class \"[I\"\n 24: invokestatic #32 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 27: istore_2\n 28: iconst_0\n 29: istore 4\n 31: iload_1\n 32: iconst_1\n 33: iadd\n 34: istore 5\n 36: iload 5\n 38: anewarray #29 // class \"[I\"\n 41: astore 6\n 43: iload 4\n 45: iload 5\n 47: if_icmpge 70\n 50: iload 4\n 52: istore 7\n 54: aload 6\n 56: iload 7\n 58: iload_2\n 59: iconst_1\n 60: iadd\n 61: newarray int\n 63: aastore\n 64: iinc 4, 1\n 67: goto 43\n 70: aload 6\n 72: astore_3\n 73: aload_3\n 74: iload_1\n 75: aaload\n 76: iload_2\n 77: aload_0\n 78: iload_1\n 79: aaload\n 80: iload_2\n 81: iaload\n 82: iastore\n 83: iload_1\n 84: iconst_1\n 85: isub\n 86: istore 4\n 88: iconst_m1\n 89: iload 4\n 91: if_icmpge 121\n 94: aload_3\n 95: iload 4\n 97: aaload\n 98: iload_2\n 99: aload_0\n 100: iload 4\n 102: aaload\n 103: iload_2\n 104: iaload\n 105: aload_3\n 106: iload 4\n 108: iconst_1\n 109: iadd\n 110: aaload\n 111: iload_2\n 112: iaload\n 113: iadd\n 114: iastore\n 115: iinc 4, -1\n 118: goto 88\n 121: iload_2\n 122: iconst_1\n 123: isub\n 124: istore 4\n 126: iconst_m1\n 127: iload 4\n 129: if_icmpge 159\n 132: aload_3\n 133: iload_1\n 134: aaload\n 135: iload 4\n 137: aload_0\n 138: iload_1\n 139: aaload\n 140: iload 4\n 142: iaload\n 143: aload_3\n 144: iload_1\n 145: aaload\n 146: iload 4\n 148: iconst_1\n 149: iadd\n 150: iaload\n 151: iadd\n 152: iastore\n 153: iinc 4, -1\n 156: goto 126\n 159: iload_1\n 160: iconst_1\n 161: isub\n 162: istore 4\n 164: iconst_m1\n 165: iload 4\n 167: if_icmpge 229\n 170: iload_2\n 171: iconst_1\n 172: isub\n 173: istore 5\n 175: iconst_m1\n 176: iload 5\n 178: if_icmpge 223\n 181: aload_3\n 182: iload 4\n 184: aaload\n 185: iload 5\n 187: aload_0\n 188: iload 4\n 190: aaload\n 191: iload 5\n 193: iaload\n 194: aload_3\n 195: iload 4\n 197: iconst_1\n 198: iadd\n 199: aaload\n 200: iload 5\n 202: iaload\n 203: aload_3\n 204: iload 4\n 206: aaload\n 207: iload 5\n 209: iconst_1\n 210: iadd\n 211: iaload\n 212: invokestatic #38 // Method java/lang/Math.min:(II)I\n 215: iadd\n 216: iastore\n 217: iinc 5, -1\n 220: goto 175\n 223: iinc 4, -1\n 226: goto 164\n 229: aload_3\n 230: iconst_0\n 231: aaload\n 232: iconst_0\n 233: iaload\n 234: ireturn\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0079_WordSearch.kt
// https://leetcode.com/problems/word-search fun exist(board: Array<CharArray>, word: String): Boolean { val visited = Array(board.size) { BooleanArray(board.first().size) } for (row in board.indices) { for (col in board.first().indices) { if (dfs(row = row, col = col, index = 0, word = word, board = board, visited = visited)) { return true } } } return false } fun dfs( row: Int, col: Int, index: Int, word: String, board: Array<CharArray>, visited: Array<BooleanArray> ): Boolean { if (visited[row][col] || board[row][col] != word[index]) return false if (index == word.lastIndex) return true visited[row][col] = true if (board.valid(row - 1, col) && dfs(row - 1, col, index + 1, word, board, visited)) return true if (board.valid(row + 1, col) && dfs(row + 1, col, index + 1, word, board, visited)) return true if (board.valid(row, col - 1) && dfs(row, col - 1, index + 1, word, board, visited)) return true if (board.valid(row, col + 1) && dfs(row, col + 1, index + 1, word, board, visited)) return true visited[row][col] = false return false } private fun Array<CharArray>.valid(row: Int, col: Int): Boolean { return row >= 0 && row <= this.lastIndex && col >= 0 && col <= this.first().lastIndex }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0079_WordSearchKt.class", "javap": "Compiled from \"_0079_WordSearch.kt\"\npublic final class _0079_WordSearchKt {\n public static final boolean exist(char[][], java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #9 // String board\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #17 // String word\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: iconst_0\n 13: istore_3\n 14: aload_0\n 15: checkcast #19 // class \"[Ljava/lang/Object;\"\n 18: arraylength\n 19: istore 4\n 21: iload 4\n 23: anewarray #21 // class \"[Z\"\n 26: astore 5\n 28: iload_3\n 29: iload 4\n 31: if_icmpge 61\n 34: iload_3\n 35: istore 6\n 37: aload 5\n 39: iload 6\n 41: aload_0\n 42: checkcast #19 // class \"[Ljava/lang/Object;\"\n 45: invokestatic #27 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 48: checkcast #29 // class \"[C\"\n 51: arraylength\n 52: newarray boolean\n 54: aastore\n 55: iinc 3, 1\n 58: goto 28\n 61: aload 5\n 63: astore_2\n 64: iconst_0\n 65: istore_3\n 66: aload_0\n 67: checkcast #19 // class \"[Ljava/lang/Object;\"\n 70: arraylength\n 71: istore 4\n 73: iload_3\n 74: iload 4\n 76: if_icmpge 129\n 79: iconst_0\n 80: istore 5\n 82: aload_0\n 83: checkcast #19 // class \"[Ljava/lang/Object;\"\n 86: invokestatic #27 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 89: checkcast #29 // class \"[C\"\n 92: arraylength\n 93: istore 6\n 95: iload 5\n 97: iload 6\n 99: if_icmpge 123\n 102: iload_3\n 103: iload 5\n 105: iconst_0\n 106: aload_1\n 107: aload_0\n 108: aload_2\n 109: invokestatic #33 // Method dfs:(IIILjava/lang/String;[[C[[Z)Z\n 112: ifeq 117\n 115: iconst_1\n 116: ireturn\n 117: iinc 5, 1\n 120: goto 95\n 123: iinc 3, 1\n 126: goto 73\n 129: iconst_0\n 130: ireturn\n\n public static final boolean dfs(int, int, int, java.lang.String, char[][], boolean[][]);\n Code:\n 0: aload_3\n 1: ldc #17 // String word\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload 4\n 8: ldc #9 // String board\n 10: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload 5\n 15: ldc #45 // String visited\n 17: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 20: aload 5\n 22: iload_0\n 23: aaload\n 24: iload_1\n 25: baload\n 26: ifne 43\n 29: aload 4\n 31: iload_0\n 32: aaload\n 33: iload_1\n 34: caload\n 35: aload_3\n 36: iload_2\n 37: invokevirtual #49 // Method java/lang/String.charAt:(I)C\n 40: if_icmpeq 45\n 43: iconst_0\n 44: ireturn\n 45: iload_2\n 46: aload_3\n 47: checkcast #51 // class java/lang/CharSequence\n 50: invokestatic #57 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 53: if_icmpne 58\n 56: iconst_1\n 57: ireturn\n 58: aload 5\n 60: iload_0\n 61: aaload\n 62: iload_1\n 63: iconst_1\n 64: bastore\n 65: aload 4\n 67: iload_0\n 68: iconst_1\n 69: isub\n 70: iload_1\n 71: invokestatic #61 // Method valid:([[CII)Z\n 74: ifeq 97\n 77: iload_0\n 78: iconst_1\n 79: isub\n 80: iload_1\n 81: iload_2\n 82: iconst_1\n 83: iadd\n 84: aload_3\n 85: aload 4\n 87: aload 5\n 89: invokestatic #33 // Method dfs:(IIILjava/lang/String;[[C[[Z)Z\n 92: ifeq 97\n 95: iconst_1\n 96: ireturn\n 97: aload 4\n 99: iload_0\n 100: iconst_1\n 101: iadd\n 102: iload_1\n 103: invokestatic #61 // Method valid:([[CII)Z\n 106: ifeq 129\n 109: iload_0\n 110: iconst_1\n 111: iadd\n 112: iload_1\n 113: iload_2\n 114: iconst_1\n 115: iadd\n 116: aload_3\n 117: aload 4\n 119: aload 5\n 121: invokestatic #33 // Method dfs:(IIILjava/lang/String;[[C[[Z)Z\n 124: ifeq 129\n 127: iconst_1\n 128: ireturn\n 129: aload 4\n 131: iload_0\n 132: iload_1\n 133: iconst_1\n 134: isub\n 135: invokestatic #61 // Method valid:([[CII)Z\n 138: ifeq 161\n 141: iload_0\n 142: iload_1\n 143: iconst_1\n 144: isub\n 145: iload_2\n 146: iconst_1\n 147: iadd\n 148: aload_3\n 149: aload 4\n 151: aload 5\n 153: invokestatic #33 // Method dfs:(IIILjava/lang/String;[[C[[Z)Z\n 156: ifeq 161\n 159: iconst_1\n 160: ireturn\n 161: aload 4\n 163: iload_0\n 164: iload_1\n 165: iconst_1\n 166: iadd\n 167: invokestatic #61 // Method valid:([[CII)Z\n 170: ifeq 193\n 173: iload_0\n 174: iload_1\n 175: iconst_1\n 176: iadd\n 177: iload_2\n 178: iconst_1\n 179: iadd\n 180: aload_3\n 181: aload 4\n 183: aload 5\n 185: invokestatic #33 // Method dfs:(IIILjava/lang/String;[[C[[Z)Z\n 188: ifeq 193\n 191: iconst_1\n 192: ireturn\n 193: aload 5\n 195: iload_0\n 196: aaload\n 197: iload_1\n 198: iconst_0\n 199: bastore\n 200: iconst_0\n 201: ireturn\n\n private static final boolean valid(char[][], int, int);\n Code:\n 0: iload_1\n 1: iflt 40\n 4: iload_1\n 5: aload_0\n 6: checkcast #19 // class \"[Ljava/lang/Object;\"\n 9: invokestatic #65 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I\n 12: if_icmpgt 40\n 15: iload_2\n 16: iflt 40\n 19: iload_2\n 20: aload_0\n 21: checkcast #19 // class \"[Ljava/lang/Object;\"\n 24: invokestatic #27 // Method kotlin/collections/ArraysKt.first:([Ljava/lang/Object;)Ljava/lang/Object;\n 27: checkcast #29 // class \"[C\"\n 30: invokestatic #68 // Method kotlin/collections/ArraysKt.getLastIndex:([C)I\n 33: if_icmpgt 40\n 36: iconst_1\n 37: goto 41\n 40: iconst_0\n 41: ireturn\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0018_4Sum.kt
// https://leetcode.com/problems/4sum fun fourSum(nums: IntArray, target: Int): List<List<Int>> { val targetLong = target.toLong() val quardruplets = mutableSetOf<Quardruplet>() nums.sort() for (first in 0..nums.lastIndex - 3) { for (second in first + 1..nums.lastIndex - 2) { var third = second + 1 var fourth = nums.lastIndex while (third < fourth) { val sum = nums[first].toLong() + nums[second] + nums[third] + nums[fourth] if (sum == targetLong) { quardruplets.add(Quardruplet(nums[first], nums[second], nums[third], nums[fourth])) third++ fourth-- } else if (sum > target) { fourth-- } else { third++ } } } } return quardruplets.toList().map { listOf(it.first, it.second, it.third, it.fourth) } } data class Quardruplet(val first: Int, val second: Int, val third: Int, val fourth: Int)
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0018_4SumKt.class", "javap": "Compiled from \"_0018_4Sum.kt\"\npublic final class _0018_4SumKt {\n public static final java.util.List<java.util.List<java.lang.Integer>> fourSum(int[], int);\n Code:\n 0: aload_0\n 1: ldc #10 // String nums\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iload_1\n 7: i2l\n 8: lstore_2\n 9: new #18 // class java/util/LinkedHashSet\n 12: dup\n 13: invokespecial #22 // Method java/util/LinkedHashSet.\"<init>\":()V\n 16: checkcast #24 // class java/util/Set\n 19: astore 4\n 21: aload_0\n 22: invokestatic #30 // Method kotlin/collections/ArraysKt.sort:([I)V\n 25: iconst_0\n 26: istore 5\n 28: aload_0\n 29: invokestatic #34 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 32: iconst_3\n 33: isub\n 34: istore 6\n 36: iload 5\n 38: iload 6\n 40: if_icmpgt 201\n 43: iload 5\n 45: iconst_1\n 46: iadd\n 47: istore 7\n 49: aload_0\n 50: invokestatic #34 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 53: iconst_2\n 54: isub\n 55: istore 8\n 57: iload 7\n 59: iload 8\n 61: if_icmpgt 188\n 64: iload 7\n 66: iconst_1\n 67: iadd\n 68: istore 9\n 70: aload_0\n 71: invokestatic #34 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 74: istore 10\n 76: iload 9\n 78: iload 10\n 80: if_icmpge 175\n 83: aload_0\n 84: iload 5\n 86: iaload\n 87: i2l\n 88: aload_0\n 89: iload 7\n 91: iaload\n 92: i2l\n 93: ladd\n 94: aload_0\n 95: iload 9\n 97: iaload\n 98: i2l\n 99: ladd\n 100: aload_0\n 101: iload 10\n 103: iaload\n 104: i2l\n 105: ladd\n 106: lstore 11\n 108: lload 11\n 110: lload_2\n 111: lcmp\n 112: ifne 155\n 115: aload 4\n 117: new #36 // class Quardruplet\n 120: dup\n 121: aload_0\n 122: iload 5\n 124: iaload\n 125: aload_0\n 126: iload 7\n 128: iaload\n 129: aload_0\n 130: iload 9\n 132: iaload\n 133: aload_0\n 134: iload 10\n 136: iaload\n 137: invokespecial #39 // Method Quardruplet.\"<init>\":(IIII)V\n 140: invokeinterface #43, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 145: pop\n 146: iinc 9, 1\n 149: iinc 10, -1\n 152: goto 76\n 155: lload 11\n 157: iload_1\n 158: i2l\n 159: lcmp\n 160: ifle 169\n 163: iinc 10, -1\n 166: goto 76\n 169: iinc 9, 1\n 172: goto 76\n 175: iload 7\n 177: iload 8\n 179: if_icmpeq 188\n 182: iinc 7, 1\n 185: goto 64\n 188: iload 5\n 190: iload 6\n 192: if_icmpeq 201\n 195: iinc 5, 1\n 198: goto 43\n 201: aload 4\n 203: checkcast #45 // class java/lang/Iterable\n 206: invokestatic #51 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 209: checkcast #45 // class java/lang/Iterable\n 212: astore 5\n 214: iconst_0\n 215: istore 6\n 217: aload 5\n 219: astore 7\n 221: new #53 // class java/util/ArrayList\n 224: dup\n 225: aload 5\n 227: bipush 10\n 229: invokestatic #57 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 232: invokespecial #60 // Method java/util/ArrayList.\"<init>\":(I)V\n 235: checkcast #62 // class java/util/Collection\n 238: astore 8\n 240: iconst_0\n 241: istore 9\n 243: aload 7\n 245: invokeinterface #66, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 250: astore 10\n 252: aload 10\n 254: invokeinterface #72, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 259: ifeq 356\n 262: aload 10\n 264: invokeinterface #76, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 269: astore 11\n 271: aload 8\n 273: aload 11\n 275: checkcast #36 // class Quardruplet\n 278: astore 12\n 280: astore 15\n 282: iconst_0\n 283: istore 13\n 285: iconst_4\n 286: anewarray #78 // class java/lang/Integer\n 289: astore 14\n 291: aload 14\n 293: iconst_0\n 294: aload 12\n 296: invokevirtual #82 // Method Quardruplet.getFirst:()I\n 299: invokestatic #86 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 302: aastore\n 303: aload 14\n 305: iconst_1\n 306: aload 12\n 308: invokevirtual #89 // Method Quardruplet.getSecond:()I\n 311: invokestatic #86 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 314: aastore\n 315: aload 14\n 317: iconst_2\n 318: aload 12\n 320: invokevirtual #92 // Method Quardruplet.getThird:()I\n 323: invokestatic #86 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 326: aastore\n 327: aload 14\n 329: iconst_3\n 330: aload 12\n 332: invokevirtual #95 // Method Quardruplet.getFourth:()I\n 335: invokestatic #86 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 338: aastore\n 339: aload 14\n 341: invokestatic #99 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 344: aload 15\n 346: swap\n 347: invokeinterface #100, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 352: pop\n 353: goto 252\n 356: aload 8\n 358: checkcast #102 // class java/util/List\n 361: nop\n 362: areturn\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0047_PermutationsII.kt
// https://leetcode.com/problems/permutations-ii fun permuteUnique(nums: IntArray): List<List<Int>> { nums.sort() return mutableListOf<List<Int>>().also { buildPermutations(nums, 0, it) } } private fun buildPermutations(nums: IntArray, startIndex: Int, permutations: MutableList<List<Int>>) { if (startIndex == nums.lastIndex) { permutations.add(nums.toList()) return } val swapped = mutableSetOf<Int>() var index = startIndex while (index <= nums.lastIndex) { swapped.add(nums[index]) nums.swap(startIndex, index) buildPermutations(nums = nums, startIndex = startIndex + 1, permutations = permutations) nums.swap(startIndex, index) index++ while (nums.getOrNull(index) == nums[startIndex] || swapped.contains(nums.getOrNull(index))) index++ } } private fun IntArray.swap(i: Int, j: Int) { if (i == j) return val temp = this[i] this[i] = this[j] this[j] = temp }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0047_PermutationsIIKt.class", "javap": "Compiled from \"_0047_PermutationsII.kt\"\npublic final class _0047_PermutationsIIKt {\n public static final java.util.List<java.util.List<java.lang.Integer>> permuteUnique(int[]);\n Code:\n 0: aload_0\n 1: ldc #10 // String nums\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #22 // Method kotlin/collections/ArraysKt.sort:([I)V\n 10: new #24 // class java/util/ArrayList\n 13: dup\n 14: invokespecial #28 // Method java/util/ArrayList.\"<init>\":()V\n 17: checkcast #30 // class java/util/List\n 20: astore_1\n 21: aload_1\n 22: astore_2\n 23: iconst_0\n 24: istore_3\n 25: aload_0\n 26: iconst_0\n 27: aload_2\n 28: invokestatic #34 // Method buildPermutations:([IILjava/util/List;)V\n 31: nop\n 32: aload_1\n 33: areturn\n\n private static final void buildPermutations(int[], int, java.util.List<java.util.List<java.lang.Integer>>);\n Code:\n 0: iload_1\n 1: aload_0\n 2: invokestatic #44 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 5: if_icmpne 20\n 8: aload_2\n 9: aload_0\n 10: invokestatic #47 // Method kotlin/collections/ArraysKt.toList:([I)Ljava/util/List;\n 13: invokeinterface #51, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 18: pop\n 19: return\n 20: new #53 // class java/util/LinkedHashSet\n 23: dup\n 24: invokespecial #54 // Method java/util/LinkedHashSet.\"<init>\":()V\n 27: checkcast #56 // class java/util/Set\n 30: astore_3\n 31: iload_1\n 32: istore 4\n 34: iload 4\n 36: aload_0\n 37: invokestatic #44 // Method kotlin/collections/ArraysKt.getLastIndex:([I)I\n 40: if_icmpgt 131\n 43: aload_3\n 44: aload_0\n 45: iload 4\n 47: iaload\n 48: invokestatic #62 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 51: invokeinterface #63, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 56: pop\n 57: aload_0\n 58: iload_1\n 59: iload 4\n 61: invokestatic #67 // Method swap:([III)V\n 64: aload_0\n 65: iload_1\n 66: iconst_1\n 67: iadd\n 68: aload_2\n 69: invokestatic #34 // Method buildPermutations:([IILjava/util/List;)V\n 72: aload_0\n 73: iload_1\n 74: iload 4\n 76: invokestatic #67 // Method swap:([III)V\n 79: iinc 4, 1\n 82: aload_0\n 83: iload 4\n 85: invokestatic #71 // Method kotlin/collections/ArraysKt.getOrNull:([II)Ljava/lang/Integer;\n 88: aload_0\n 89: iload_1\n 90: iaload\n 91: istore 5\n 93: dup\n 94: ifnonnull 101\n 97: pop\n 98: goto 109\n 101: invokevirtual #75 // Method java/lang/Integer.intValue:()I\n 104: iload 5\n 106: if_icmpeq 125\n 109: aload_3\n 110: checkcast #77 // class java/lang/Iterable\n 113: aload_0\n 114: iload 4\n 116: invokestatic #71 // Method kotlin/collections/ArraysKt.getOrNull:([II)Ljava/lang/Integer;\n 119: invokestatic #83 // Method kotlin/collections/CollectionsKt.contains:(Ljava/lang/Iterable;Ljava/lang/Object;)Z\n 122: ifeq 34\n 125: iinc 4, 1\n 128: goto 82\n 131: return\n\n private static final void swap(int[], int, int);\n Code:\n 0: iload_1\n 1: iload_2\n 2: if_icmpne 6\n 5: return\n 6: aload_0\n 7: iload_1\n 8: iaload\n 9: istore_3\n 10: aload_0\n 11: iload_1\n 12: aload_0\n 13: iload_2\n 14: iaload\n 15: iastore\n 16: aload_0\n 17: iload_2\n 18: iload_3\n 19: iastore\n 20: return\n}\n", "javap_err": "" } ]
ryandyoon__leetcode-kotlin__7f75078/src/main/kotlin/_0046_Permutations.kt
// https://leetcode.com/problems/permutations fun permute(nums: IntArray): List<List<Int>> { return mutableListOf<List<Int>>().also { buildPermutations( nums = nums, usedNums = BooleanArray(nums.size), permutation = mutableListOf(), permutations = it ) } } private fun buildPermutations( nums: IntArray, usedNums: BooleanArray, permutation: MutableList<Int>, permutations: MutableList<List<Int>> ) { if (permutation.size == nums.size) { permutations.add(permutation.toList()) return } for ((index, num) in nums.withIndex()) { if (usedNums[index]) continue usedNums[index] = true permutation.add(num) buildPermutations(nums = nums, usedNums = usedNums, permutation = permutation, permutations = permutations) permutation.remove(num) usedNums[index] = false } }
[ { "class_path": "ryandyoon__leetcode-kotlin__7f75078/_0046_PermutationsKt.class", "javap": "Compiled from \"_0046_Permutations.kt\"\npublic final class _0046_PermutationsKt {\n public static final java.util.List<java.util.List<java.lang.Integer>> permute(int[]);\n Code:\n 0: aload_0\n 1: ldc #10 // String nums\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #18 // class java/util/ArrayList\n 9: dup\n 10: invokespecial #22 // Method java/util/ArrayList.\"<init>\":()V\n 13: checkcast #24 // class java/util/List\n 16: astore_1\n 17: aload_1\n 18: astore_2\n 19: iconst_0\n 20: istore_3\n 21: aload_0\n 22: aload_0\n 23: arraylength\n 24: newarray boolean\n 26: new #18 // class java/util/ArrayList\n 29: dup\n 30: invokespecial #22 // Method java/util/ArrayList.\"<init>\":()V\n 33: checkcast #24 // class java/util/List\n 36: aload_2\n 37: invokestatic #28 // Method buildPermutations:([I[ZLjava/util/List;Ljava/util/List;)V\n 40: nop\n 41: aload_1\n 42: areturn\n\n private static final void buildPermutations(int[], boolean[], java.util.List<java.lang.Integer>, java.util.List<java.util.List<java.lang.Integer>>);\n Code:\n 0: aload_2\n 1: invokeinterface #38, 1 // InterfaceMethod java/util/List.size:()I\n 6: aload_0\n 7: arraylength\n 8: if_icmpne 26\n 11: aload_3\n 12: aload_2\n 13: checkcast #40 // class java/lang/Iterable\n 16: invokestatic #46 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 19: invokeinterface #50, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 24: pop\n 25: return\n 26: iconst_0\n 27: istore 4\n 29: aload_0\n 30: arraylength\n 31: istore 5\n 33: iload 4\n 35: iload 5\n 37: if_icmpge 104\n 40: iload 4\n 42: istore 6\n 44: aload_0\n 45: iload 4\n 47: iaload\n 48: istore 7\n 50: aload_1\n 51: iload 6\n 53: baload\n 54: ifne 98\n 57: aload_1\n 58: iload 6\n 60: iconst_1\n 61: bastore\n 62: aload_2\n 63: iload 7\n 65: invokestatic #56 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 68: invokeinterface #50, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 73: pop\n 74: aload_0\n 75: aload_1\n 76: aload_2\n 77: aload_3\n 78: invokestatic #28 // Method buildPermutations:([I[ZLjava/util/List;Ljava/util/List;)V\n 81: aload_2\n 82: iload 7\n 84: invokestatic #56 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 87: invokeinterface #59, 2 // InterfaceMethod java/util/List.remove:(Ljava/lang/Object;)Z\n 92: pop\n 93: aload_1\n 94: iload 6\n 96: iconst_0\n 97: bastore\n 98: iinc 4, 1\n 101: goto 33\n 104: return\n}\n", "javap_err": "" } ]
engividal__code-challenge__930a76a/q2/question2.kt
// 2. Check words with jumbled letters : // Our brain can read texts even if letters are jumbled, like the following sentence: “Yuo // cna porbalby raed tihs esaliy desptie teh msispeillgns.” Given two strings, write a // method to decide if one is a partial­permutation of the other. Consider a // partial­permutation only if: //­ The first letter hasn’t changed place // If word has more than 3 letters, up to 2/3 of the letters have changed place // Examples: // you, yuo ­> true // probably, porbalby ­> true // despite, desptie ­> true // moon, nmoo ­> false // misspellings, mpeissngslli ­> false fun main(args: Array<String>) { println(partialPermutation("you", "yuo")) println(partialPermutation("probably", "porbalby")) println(partialPermutation("despite", "desptie")) println(partialPermutation("moon", "nmoo")) println(partialPermutation("misspellings", "mpeissngslli")) } fun partialPermutation(source: String, dest: String): Boolean{ //­ The first letter hasn’t changed place if(source[0] != dest[0]){ return false } // If the size of the arrays are different if(source.length != dest.length){ return false } var jumbled = 0 for ((index, value) in source.withIndex()){ val indexDest = dest.indexOf(value) if ( indexDest != index ){ jumbled ++ } // If the character does not exist if ( indexDest == -1 ){ return false } } // If word has more than 3 letters, up to 2/3 of the letters have changed place val len = source.length if (len > 3){ if(jumbled > (len * 2/3)){ return false }else{ return true } } else { return jumbled > 0 } }
[ { "class_path": "engividal__code-challenge__930a76a/Question2Kt.class", "javap": "Compiled from \"question2.kt\"\npublic final class Question2Kt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: ldc #17 // String you\n 8: ldc #19 // String yuo\n 10: invokestatic #23 // Method partialPermutation:(Ljava/lang/String;Ljava/lang/String;)Z\n 13: istore_1\n 14: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 17: iload_1\n 18: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 21: ldc #37 // String probably\n 23: ldc #39 // String porbalby\n 25: invokestatic #23 // Method partialPermutation:(Ljava/lang/String;Ljava/lang/String;)Z\n 28: istore_1\n 29: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 32: iload_1\n 33: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 36: ldc #41 // String despite\n 38: ldc #43 // String desptie\n 40: invokestatic #23 // Method partialPermutation:(Ljava/lang/String;Ljava/lang/String;)Z\n 43: istore_1\n 44: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 47: iload_1\n 48: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 51: ldc #45 // String moon\n 53: ldc #47 // String nmoo\n 55: invokestatic #23 // Method partialPermutation:(Ljava/lang/String;Ljava/lang/String;)Z\n 58: istore_1\n 59: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 62: iload_1\n 63: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 66: ldc #49 // String misspellings\n 68: ldc #51 // String mpeissngslli\n 70: invokestatic #23 // Method partialPermutation:(Ljava/lang/String;Ljava/lang/String;)Z\n 73: istore_1\n 74: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 77: iload_1\n 78: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 81: return\n\n public static final boolean partialPermutation(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #54 // String source\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #56 // String dest\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: iconst_0\n 14: invokevirtual #62 // Method java/lang/String.charAt:(I)C\n 17: aload_1\n 18: iconst_0\n 19: invokevirtual #62 // Method java/lang/String.charAt:(I)C\n 22: if_icmpeq 27\n 25: iconst_0\n 26: ireturn\n 27: aload_0\n 28: invokevirtual #66 // Method java/lang/String.length:()I\n 31: aload_1\n 32: invokevirtual #66 // Method java/lang/String.length:()I\n 35: if_icmpeq 40\n 38: iconst_0\n 39: ireturn\n 40: iconst_0\n 41: istore_2\n 42: iconst_0\n 43: istore_3\n 44: aload_0\n 45: invokevirtual #66 // Method java/lang/String.length:()I\n 48: istore 4\n 50: iload_3\n 51: iload 4\n 53: if_icmpge 106\n 56: iload_3\n 57: istore 5\n 59: aload_0\n 60: iload_3\n 61: invokevirtual #62 // Method java/lang/String.charAt:(I)C\n 64: istore 6\n 66: aload_1\n 67: checkcast #68 // class java/lang/CharSequence\n 70: iload 6\n 72: iconst_0\n 73: iconst_0\n 74: bipush 6\n 76: aconst_null\n 77: invokestatic #74 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;CIZILjava/lang/Object;)I\n 80: istore 7\n 82: iload 7\n 84: iload 5\n 86: if_icmpeq 92\n 89: iinc 2, 1\n 92: iload 7\n 94: iconst_m1\n 95: if_icmpne 100\n 98: iconst_0\n 99: ireturn\n 100: iinc 3, 1\n 103: goto 50\n 106: aload_0\n 107: invokevirtual #66 // Method java/lang/String.length:()I\n 110: istore_3\n 111: iload_3\n 112: iconst_3\n 113: if_icmple 129\n 116: iload_2\n 117: iload_3\n 118: iconst_2\n 119: imul\n 120: iconst_3\n 121: idiv\n 122: if_icmple 127\n 125: iconst_0\n 126: ireturn\n 127: iconst_1\n 128: ireturn\n 129: iload_2\n 130: ifle 137\n 133: iconst_1\n 134: goto 138\n 137: iconst_0\n 138: ireturn\n}\n", "javap_err": "" } ]
engividal__code-challenge__930a76a/q3/question3.kt
// 3. Check words with typos: // There are three types of typos that can be performed on strings: insert a character, // remove a character, or replace a character. Given two strings, write a function to // check if they are one typo (or zero typos) away. // Examples: // pale, ple ­> true // pales, pale ­> true // pale, bale ­> true // pale, bake ­> false // https://www.cuelogic.com/blog/the-levenshtein-algorithm fun main(args: Array<String>) { println(checkTypos("pale", "ple")) //true println(checkTypos("pales", "pale")) //true println(checkTypos("pale", "bale")) //true println(checkTypos("pale", "bake")) //false println(checkTypos("HONDA", "HYUNDAI")) //false } fun checkTypos(s: String, t: String): Boolean { // degenerate cases if (s == t) return true if (s == "") return false if (t == "") return false // create two integer arrays of distances and initialize the first one val v0 = IntArray(t.length + 1) { it } // previous val v1 = IntArray(t.length + 1) // current var cost: Int for (i in 0 until s.length) { // calculate v1 from v0 v1[0] = i + 1 for (j in 0 until t.length) { cost = if (s[i] == t[j]) 0 else 1 v1[j + 1] = Math.min(v1[j] + 1, Math.min(v0[j + 1] + 1, v0[j] + cost)) } // copy v1 to v0 for next iteration for (j in 0 .. t.length) v0[j] = v1[j] } if(v1[t.length]>1){ return false }else{ return true } }
[ { "class_path": "engividal__code-challenge__930a76a/Question3Kt.class", "javap": "Compiled from \"question3.kt\"\npublic final class Question3Kt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: ldc #17 // String pale\n 8: ldc #19 // String ple\n 10: invokestatic #23 // Method checkTypos:(Ljava/lang/String;Ljava/lang/String;)Z\n 13: istore_1\n 14: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 17: iload_1\n 18: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 21: ldc #37 // String pales\n 23: ldc #17 // String pale\n 25: invokestatic #23 // Method checkTypos:(Ljava/lang/String;Ljava/lang/String;)Z\n 28: istore_1\n 29: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 32: iload_1\n 33: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 36: ldc #17 // String pale\n 38: ldc #39 // String bale\n 40: invokestatic #23 // Method checkTypos:(Ljava/lang/String;Ljava/lang/String;)Z\n 43: istore_1\n 44: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 47: iload_1\n 48: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 51: ldc #17 // String pale\n 53: ldc #41 // String bake\n 55: invokestatic #23 // Method checkTypos:(Ljava/lang/String;Ljava/lang/String;)Z\n 58: istore_1\n 59: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 62: iload_1\n 63: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 66: ldc #43 // String HONDA\n 68: ldc #45 // String HYUNDAI\n 70: invokestatic #23 // Method checkTypos:(Ljava/lang/String;Ljava/lang/String;)Z\n 73: istore_1\n 74: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream;\n 77: iload_1\n 78: invokevirtual #35 // Method java/io/PrintStream.println:(Z)V\n 81: return\n\n public static final boolean checkTypos(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #48 // String s\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #50 // String t\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: aload_1\n 14: invokestatic #54 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 17: ifeq 22\n 20: iconst_1\n 21: ireturn\n 22: aload_0\n 23: ldc #56 // String\n 25: invokestatic #54 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 28: ifeq 33\n 31: iconst_0\n 32: ireturn\n 33: aload_1\n 34: ldc #56 // String\n 36: invokestatic #54 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 39: ifeq 44\n 42: iconst_0\n 43: ireturn\n 44: iconst_0\n 45: istore_3\n 46: aload_1\n 47: invokevirtual #62 // Method java/lang/String.length:()I\n 50: iconst_1\n 51: iadd\n 52: istore 4\n 54: iload 4\n 56: newarray int\n 58: astore 5\n 60: iload_3\n 61: iload 4\n 63: if_icmpge 82\n 66: iload_3\n 67: istore 6\n 69: aload 5\n 71: iload 6\n 73: iload 6\n 75: iastore\n 76: iinc 3, 1\n 79: goto 60\n 82: aload 5\n 84: astore_2\n 85: aload_1\n 86: invokevirtual #62 // Method java/lang/String.length:()I\n 89: iconst_1\n 90: iadd\n 91: newarray int\n 93: astore_3\n 94: iconst_0\n 95: istore 4\n 97: iconst_0\n 98: istore 5\n 100: aload_0\n 101: invokevirtual #62 // Method java/lang/String.length:()I\n 104: istore 6\n 106: iload 5\n 108: iload 6\n 110: if_icmpge 240\n 113: aload_3\n 114: iconst_0\n 115: iload 5\n 117: iconst_1\n 118: iadd\n 119: iastore\n 120: iconst_0\n 121: istore 7\n 123: aload_1\n 124: invokevirtual #62 // Method java/lang/String.length:()I\n 127: istore 8\n 129: iload 7\n 131: iload 8\n 133: if_icmpge 197\n 136: aload_0\n 137: iload 5\n 139: invokevirtual #66 // Method java/lang/String.charAt:(I)C\n 142: aload_1\n 143: iload 7\n 145: invokevirtual #66 // Method java/lang/String.charAt:(I)C\n 148: if_icmpne 155\n 151: iconst_0\n 152: goto 156\n 155: iconst_1\n 156: istore 4\n 158: aload_3\n 159: iload 7\n 161: iconst_1\n 162: iadd\n 163: aload_3\n 164: iload 7\n 166: iaload\n 167: iconst_1\n 168: iadd\n 169: aload_2\n 170: iload 7\n 172: iconst_1\n 173: iadd\n 174: iaload\n 175: iconst_1\n 176: iadd\n 177: aload_2\n 178: iload 7\n 180: iaload\n 181: iload 4\n 183: iadd\n 184: invokestatic #72 // Method java/lang/Math.min:(II)I\n 187: invokestatic #72 // Method java/lang/Math.min:(II)I\n 190: iastore\n 191: iinc 7, 1\n 194: goto 129\n 197: iconst_0\n 198: istore 7\n 200: aload_1\n 201: invokevirtual #62 // Method java/lang/String.length:()I\n 204: istore 8\n 206: iload 7\n 208: iload 8\n 210: if_icmpgt 234\n 213: aload_2\n 214: iload 7\n 216: aload_3\n 217: iload 7\n 219: iaload\n 220: iastore\n 221: iload 7\n 223: iload 8\n 225: if_icmpeq 234\n 228: iinc 7, 1\n 231: goto 213\n 234: iinc 5, 1\n 237: goto 106\n 240: aload_3\n 241: aload_1\n 242: invokevirtual #62 // Method java/lang/String.length:()I\n 245: iaload\n 246: iconst_1\n 247: if_icmple 252\n 250: iconst_0\n 251: ireturn\n 252: iconst_1\n 253: ireturn\n}\n", "javap_err": "" } ]
eldarbogdanov__aoc-2022__bdac3ab/src/day9.kt
val di = listOf(-1, 0, 1, 0); val dj = listOf(0, 1, 0, -1); val dirMap: Map<String, Int> = mapOf("U" to 0, "R" to 1, "D" to 2, "L" to 3); fun dist(a: Pair<Int, Int>, b: Pair<Int, Int>): Int { return Math.max(Math.abs(a.first - b.first), Math.abs(a.second - b.second)); } fun dist2(a: Pair<Int, Int>, b: Pair<Int, Int>): Int { return Math.abs(a.first - b.first) + Math.abs(a.second - b.second); } fun newPos(oldPos: Pair<Int, Int>, leader: Pair<Int, Int>, dir: Int): Pair<Int, Int> { if (dist(oldPos, leader) <= 1) { return oldPos; } if (dir != -1) { val candidate = Pair(oldPos.first + di[dir], oldPos.second + dj[dir]); if (dist2(leader, candidate) == 1) { return candidate; } } var best = oldPos; for(dii in -1..1) { for(djj in -1..1) { val candidate = Pair(oldPos.first + dii, oldPos.second + djj); if (dist2(leader, candidate) == 1) { best = candidate; } } } if (dist2(leader, best) == 1) return best; for(dii in -1..1) { for(djj in -1..1) { val candidate = Pair(oldPos.first + dii, oldPos.second + djj); if (dist(leader, candidate) == 1) { best = candidate; } } } return best; } fun main() { val input = "" val st: MutableSet<Pair<Int, Int>> = mutableSetOf(Pair(0, 0)); var snake: MutableList<Pair<Int, Int>> = mutableListOf(); val knots = 10; for(i in 1..knots) { snake.add(Pair(0, 0)); } for(s in input.split("\n")) { val dir = dirMap[s.split(" ")[0]]!!; val num = Integer.parseInt(s.split(" ")[1]); for(k in 1..num) { val newSnake: MutableList<Pair<Int, Int>> = mutableListOf(); newSnake.add(Pair(snake[0].first + di[dir], snake[0].second + dj[dir])); for(knot in 1 until knots) { newSnake.add(newPos(snake[knot], newSnake[knot - 1], dir)); } st.add(newSnake[knots - 1]); snake = newSnake; //println(snake); } } println(st.size); }
[ { "class_path": "eldarbogdanov__aoc-2022__bdac3ab/Day9Kt.class", "javap": "Compiled from \"day9.kt\"\npublic final class Day9Kt {\n private static final java.util.List<java.lang.Integer> di;\n\n private static final java.util.List<java.lang.Integer> dj;\n\n private static final java.util.Map<java.lang.String, java.lang.Integer> dirMap;\n\n public static final java.util.List<java.lang.Integer> getDi();\n Code:\n 0: getstatic #12 // Field di:Ljava/util/List;\n 3: areturn\n\n public static final java.util.List<java.lang.Integer> getDj();\n Code:\n 0: getstatic #16 // Field dj:Ljava/util/List;\n 3: areturn\n\n public static final java.util.Map<java.lang.String, java.lang.Integer> getDirMap();\n Code:\n 0: getstatic #23 // Field dirMap:Ljava/util/Map;\n 3: areturn\n\n public static final int dist(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #28 // String a\n 3: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #36 // String b\n 9: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 16: checkcast #44 // class java/lang/Number\n 19: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 22: aload_1\n 23: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 26: checkcast #44 // class java/lang/Number\n 29: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 32: isub\n 33: invokestatic #54 // Method java/lang/Math.abs:(I)I\n 36: aload_0\n 37: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 40: checkcast #44 // class java/lang/Number\n 43: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 46: aload_1\n 47: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 50: checkcast #44 // class java/lang/Number\n 53: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 56: isub\n 57: invokestatic #54 // Method java/lang/Math.abs:(I)I\n 60: invokestatic #61 // Method java/lang/Math.max:(II)I\n 63: ireturn\n\n public static final int dist2(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #28 // String a\n 3: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #36 // String b\n 9: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 16: checkcast #44 // class java/lang/Number\n 19: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 22: aload_1\n 23: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 26: checkcast #44 // class java/lang/Number\n 29: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 32: isub\n 33: invokestatic #54 // Method java/lang/Math.abs:(I)I\n 36: aload_0\n 37: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 40: checkcast #44 // class java/lang/Number\n 43: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 46: aload_1\n 47: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 50: checkcast #44 // class java/lang/Number\n 53: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 56: isub\n 57: invokestatic #54 // Method java/lang/Math.abs:(I)I\n 60: iadd\n 61: ireturn\n\n public static final kotlin.Pair<java.lang.Integer, java.lang.Integer> newPos(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>, int);\n Code:\n 0: aload_0\n 1: ldc #68 // String oldPos\n 3: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #70 // String leader\n 9: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: aload_1\n 14: invokestatic #72 // Method dist:(Lkotlin/Pair;Lkotlin/Pair;)I\n 17: iconst_1\n 18: if_icmpgt 23\n 21: aload_0\n 22: areturn\n 23: iload_2\n 24: iconst_m1\n 25: if_icmpeq 105\n 28: new #38 // class kotlin/Pair\n 31: dup\n 32: aload_0\n 33: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 36: checkcast #44 // class java/lang/Number\n 39: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 42: getstatic #12 // Field di:Ljava/util/List;\n 45: iload_2\n 46: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 51: checkcast #44 // class java/lang/Number\n 54: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 57: iadd\n 58: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 61: aload_0\n 62: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 65: checkcast #44 // class java/lang/Number\n 68: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 71: getstatic #16 // Field dj:Ljava/util/List;\n 74: iload_2\n 75: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 80: checkcast #44 // class java/lang/Number\n 83: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 86: iadd\n 87: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 90: invokespecial #88 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 93: astore_3\n 94: aload_1\n 95: aload_3\n 96: invokestatic #90 // Method dist2:(Lkotlin/Pair;Lkotlin/Pair;)I\n 99: iconst_1\n 100: if_icmpne 105\n 103: aload_3\n 104: areturn\n 105: aload_0\n 106: astore_3\n 107: iconst_m1\n 108: istore 4\n 110: iload 4\n 112: iconst_2\n 113: if_icmpge 191\n 116: iconst_m1\n 117: istore 5\n 119: iload 5\n 121: iconst_2\n 122: if_icmpge 185\n 125: new #38 // class kotlin/Pair\n 128: dup\n 129: aload_0\n 130: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 133: checkcast #44 // class java/lang/Number\n 136: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 139: iload 4\n 141: iadd\n 142: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 145: aload_0\n 146: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 149: checkcast #44 // class java/lang/Number\n 152: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 155: iload 5\n 157: iadd\n 158: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 161: invokespecial #88 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 164: astore 6\n 166: aload_1\n 167: aload 6\n 169: invokestatic #90 // Method dist2:(Lkotlin/Pair;Lkotlin/Pair;)I\n 172: iconst_1\n 173: if_icmpne 179\n 176: aload 6\n 178: astore_3\n 179: iinc 5, 1\n 182: goto 119\n 185: iinc 4, 1\n 188: goto 110\n 191: aload_1\n 192: aload_3\n 193: invokestatic #90 // Method dist2:(Lkotlin/Pair;Lkotlin/Pair;)I\n 196: iconst_1\n 197: if_icmpne 202\n 200: aload_3\n 201: areturn\n 202: iconst_m1\n 203: istore 4\n 205: iload 4\n 207: iconst_2\n 208: if_icmpge 286\n 211: iconst_m1\n 212: istore 5\n 214: iload 5\n 216: iconst_2\n 217: if_icmpge 280\n 220: new #38 // class kotlin/Pair\n 223: dup\n 224: aload_0\n 225: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 228: checkcast #44 // class java/lang/Number\n 231: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 234: iload 4\n 236: iadd\n 237: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 240: aload_0\n 241: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 244: checkcast #44 // class java/lang/Number\n 247: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 250: iload 5\n 252: iadd\n 253: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 256: invokespecial #88 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 259: astore 6\n 261: aload_1\n 262: aload 6\n 264: invokestatic #72 // Method dist:(Lkotlin/Pair;Lkotlin/Pair;)I\n 267: iconst_1\n 268: if_icmpne 274\n 271: aload 6\n 273: astore_3\n 274: iinc 5, 1\n 277: goto 214\n 280: iinc 4, 1\n 283: goto 205\n 286: aload_3\n 287: areturn\n\n public static final void main();\n Code:\n 0: ldc #100 // String\n 2: astore_0\n 3: iconst_1\n 4: anewarray #38 // class kotlin/Pair\n 7: astore_2\n 8: aload_2\n 9: iconst_0\n 10: new #38 // class kotlin/Pair\n 13: dup\n 14: iconst_0\n 15: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 18: iconst_0\n 19: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 22: invokespecial #88 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 25: aastore\n 26: aload_2\n 27: invokestatic #106 // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;\n 30: astore_1\n 31: new #108 // class java/util/ArrayList\n 34: dup\n 35: invokespecial #110 // Method java/util/ArrayList.\"<init>\":()V\n 38: checkcast #74 // class java/util/List\n 41: astore_2\n 42: bipush 10\n 44: istore_3\n 45: iconst_1\n 46: istore 4\n 48: aload_2\n 49: new #38 // class kotlin/Pair\n 52: dup\n 53: iconst_0\n 54: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 57: iconst_0\n 58: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 61: invokespecial #88 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 64: invokeinterface #114, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 69: pop\n 70: iload 4\n 72: iload_3\n 73: if_icmpeq 82\n 76: iinc 4, 1\n 79: goto 48\n 82: aload_0\n 83: checkcast #116 // class java/lang/CharSequence\n 86: iconst_1\n 87: anewarray #118 // class java/lang/String\n 90: astore 5\n 92: aload 5\n 94: iconst_0\n 95: ldc #120 // String \\n\n 97: aastore\n 98: aload 5\n 100: iconst_0\n 101: iconst_0\n 102: bipush 6\n 104: aconst_null\n 105: invokestatic #126 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 108: invokeinterface #130, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 113: astore 4\n 115: aload 4\n 117: invokeinterface #136, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 122: ifeq 432\n 125: aload 4\n 127: invokeinterface #139, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 132: checkcast #118 // class java/lang/String\n 135: astore 5\n 137: getstatic #23 // Field dirMap:Ljava/util/Map;\n 140: aload 5\n 142: checkcast #116 // class java/lang/CharSequence\n 145: iconst_1\n 146: anewarray #118 // class java/lang/String\n 149: astore 7\n 151: aload 7\n 153: iconst_0\n 154: ldc #141 // String\n 156: aastore\n 157: aload 7\n 159: iconst_0\n 160: iconst_0\n 161: bipush 6\n 163: aconst_null\n 164: invokestatic #126 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 167: iconst_0\n 168: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 173: invokeinterface #146, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 178: dup\n 179: invokestatic #150 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 182: checkcast #44 // class java/lang/Number\n 185: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 188: istore 6\n 190: aload 5\n 192: checkcast #116 // class java/lang/CharSequence\n 195: iconst_1\n 196: anewarray #118 // class java/lang/String\n 199: astore 8\n 201: aload 8\n 203: iconst_0\n 204: ldc #141 // String\n 206: aastore\n 207: aload 8\n 209: iconst_0\n 210: iconst_0\n 211: bipush 6\n 213: aconst_null\n 214: invokestatic #126 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 217: iconst_1\n 218: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 223: checkcast #118 // class java/lang/String\n 226: invokestatic #154 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 229: istore 7\n 231: iconst_1\n 232: istore 8\n 234: iload 8\n 236: iload 7\n 238: if_icmpgt 115\n 241: new #108 // class java/util/ArrayList\n 244: dup\n 245: invokespecial #110 // Method java/util/ArrayList.\"<init>\":()V\n 248: checkcast #74 // class java/util/List\n 251: astore 9\n 253: aload 9\n 255: new #38 // class kotlin/Pair\n 258: dup\n 259: aload_2\n 260: iconst_0\n 261: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 266: checkcast #38 // class kotlin/Pair\n 269: invokevirtual #42 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 272: checkcast #44 // class java/lang/Number\n 275: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 278: getstatic #12 // Field di:Ljava/util/List;\n 281: iload 6\n 283: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 288: checkcast #44 // class java/lang/Number\n 291: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 294: iadd\n 295: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 298: aload_2\n 299: iconst_0\n 300: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 305: checkcast #38 // class kotlin/Pair\n 308: invokevirtual #57 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 311: checkcast #44 // class java/lang/Number\n 314: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 317: getstatic #16 // Field dj:Ljava/util/List;\n 320: iload 6\n 322: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 327: checkcast #44 // class java/lang/Number\n 330: invokevirtual #48 // Method java/lang/Number.intValue:()I\n 333: iadd\n 334: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 337: invokespecial #88 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 340: invokeinterface #114, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 345: pop\n 346: iconst_1\n 347: istore 10\n 349: iload 10\n 351: iload_3\n 352: if_icmpge 399\n 355: aload 9\n 357: aload_2\n 358: iload 10\n 360: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 365: checkcast #38 // class kotlin/Pair\n 368: aload 9\n 370: iload 10\n 372: iconst_1\n 373: isub\n 374: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 379: checkcast #38 // class kotlin/Pair\n 382: iload 6\n 384: invokestatic #156 // Method newPos:(Lkotlin/Pair;Lkotlin/Pair;I)Lkotlin/Pair;\n 387: invokeinterface #114, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 392: pop\n 393: iinc 10, 1\n 396: goto 349\n 399: aload_1\n 400: aload 9\n 402: iload_3\n 403: iconst_1\n 404: isub\n 405: invokeinterface #78, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 410: invokeinterface #159, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 415: pop\n 416: aload 9\n 418: astore_2\n 419: iload 8\n 421: iload 7\n 423: if_icmpeq 115\n 426: iinc 8, 1\n 429: goto 241\n 432: aload_1\n 433: invokeinterface #162, 1 // InterfaceMethod java/util/Set.size:()I\n 438: istore 4\n 440: getstatic #168 // Field java/lang/System.out:Ljava/io/PrintStream;\n 443: iload 4\n 445: invokevirtual #174 // Method java/io/PrintStream.println:(I)V\n 448: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #189 // Method main:()V\n 3: return\n\n static {};\n Code:\n 0: iconst_4\n 1: anewarray #80 // class java/lang/Integer\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: iconst_m1\n 8: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 11: aastore\n 12: aload_0\n 13: iconst_1\n 14: iconst_0\n 15: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 18: aastore\n 19: aload_0\n 20: iconst_2\n 21: iconst_1\n 22: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 25: aastore\n 26: aload_0\n 27: iconst_3\n 28: iconst_0\n 29: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 32: aastore\n 33: aload_0\n 34: invokestatic #198 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 37: putstatic #12 // Field di:Ljava/util/List;\n 40: iconst_4\n 41: anewarray #80 // class java/lang/Integer\n 44: astore_0\n 45: aload_0\n 46: iconst_0\n 47: iconst_0\n 48: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 51: aastore\n 52: aload_0\n 53: iconst_1\n 54: iconst_1\n 55: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 58: aastore\n 59: aload_0\n 60: iconst_2\n 61: iconst_0\n 62: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 65: aastore\n 66: aload_0\n 67: iconst_3\n 68: iconst_m1\n 69: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 72: aastore\n 73: aload_0\n 74: invokestatic #198 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 77: putstatic #16 // Field dj:Ljava/util/List;\n 80: iconst_4\n 81: anewarray #38 // class kotlin/Pair\n 84: astore_0\n 85: aload_0\n 86: iconst_0\n 87: ldc #200 // String U\n 89: iconst_0\n 90: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 93: invokestatic #206 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 96: aastore\n 97: aload_0\n 98: iconst_1\n 99: ldc #208 // String R\n 101: iconst_1\n 102: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 105: invokestatic #206 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 108: aastore\n 109: aload_0\n 110: iconst_2\n 111: ldc #210 // String D\n 113: iconst_2\n 114: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 117: invokestatic #206 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 120: aastore\n 121: aload_0\n 122: iconst_3\n 123: ldc #212 // String L\n 125: iconst_3\n 126: invokestatic #84 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 129: invokestatic #206 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 132: aastore\n 133: aload_0\n 134: invokestatic #218 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 137: putstatic #23 // Field dirMap:Ljava/util/Map;\n 140: return\n}\n", "javap_err": "" } ]
eldarbogdanov__aoc-2022__bdac3ab/src/day19.kt
import kotlin.math.max fun main() { data class State( val oreRobots: Int, val clayRobots: Int, val obsidianRobots: Int, val geodeRobots: Int, val clay: Int, val obsidian: Int, val geode: Int ) { fun next(): State { return State( oreRobots, clayRobots, obsidianRobots, geodeRobots, clay + clayRobots, obsidian + obsidianRobots, geode + geodeRobots ) } } fun solve(time: Int, oreOreCost: Int, clayOreCost: Int, obsidianOreCost: Int, obsidianClayCost: Int, geodeOreCost: Int, geodeObsidianCost: Int): Int { val best = Array(time + 1) { mutableMapOf<State, Int>() } best[0][State(1, 0, 0, 0, 0, 0, 0)] = 0 var ret = 0 fun put(t: Int, state: State, value: Int) { if (!best[t + 1].contains(state) || best[t + 1].getValue(state) < value) { best[t + 1][state] = value } } for(t in 0 until time) { for(entry in best[t]) { val state = entry.key ret = max(ret, state.next().geode) if (t == time - 1) continue; // don't build anything put(t, state.next(), entry.value + state.oreRobots); // build ore robot if (entry.value >= oreOreCost) { val newState = state.next().copy(oreRobots = state.oreRobots + 1) val newOre = entry.value - oreOreCost + state.oreRobots put(t, newState, newOre) } // build clay robot if (entry.value >= clayOreCost) { val newState = state.next().copy(clayRobots = state.clayRobots + 1) val newOre = entry.value - clayOreCost + state.oreRobots put(t, newState, newOre) } // build obsidian robot if (entry.value >= obsidianOreCost && state.clay >= obsidianClayCost) { val newState = state.next().copy(obsidianRobots = state.obsidianRobots + 1, clay = state.clay - obsidianClayCost + state.clayRobots) val newOre = entry.value - obsidianOreCost + state.oreRobots put(t, newState, newOre) } // build geode robot if (entry.value >= geodeOreCost && state.obsidian >= geodeObsidianCost) { val newState = state.next().copy(geodeRobots = state.geodeRobots + 1, obsidian = state.obsidian - geodeObsidianCost + state.obsidianRobots) val newOre = entry.value - geodeOreCost + state.oreRobots put(t, newState, newOre) } } } return ret } // val test = """Blueprint 1: Each ore robot costs 4 ore. Each clay robot costs 2 ore. Each obsidian robot costs 3 ore and 14 clay. Each geode robot costs 2 ore and 7 obsidian. //Blueprint 2: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 8 clay. Each geode robot costs 3 ore and 12 obsidian.""" val test = """Blueprint 1: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 16 clay. Each geode robot costs 4 ore and 16 obsidian. Blueprint 2: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 14 clay. Each geode robot costs 4 ore and 8 obsidian. Blueprint 3: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 18 clay. Each geode robot costs 4 ore and 16 obsidian.""" val regex = Regex("Blueprint ([0-9]+): Each ore robot costs ([0-9]+) ore. Each clay robot costs ([0-9]+) ore. Each obsidian robot costs ([0-9]+) ore and ([0-9]+) clay. Each geode robot costs ([0-9]+) ore and ([0-9]+) obsidian.") var ans = 0; for(s in test.split("\n")) { val list = regex.find(s)!!.groupValues println("Test " + list[1]) val geodes = solve( 32, Integer.parseInt(list[2]), Integer.parseInt(list[3]), Integer.parseInt(list[4]), Integer.parseInt(list[5]), Integer.parseInt(list[6]), Integer.parseInt(list[7]), ) println(geodes) ans += Integer.parseInt(list[1]) * geodes } println(ans) }
[ { "class_path": "eldarbogdanov__aoc-2022__bdac3ab/Day19Kt$main$State.class", "javap": "Compiled from \"day19.kt\"\npublic final class Day19Kt$main$State {\n private final int oreRobots;\n\n private final int clayRobots;\n\n private final int obsidianRobots;\n\n private final int geodeRobots;\n\n private final int clay;\n\n private final int obsidian;\n\n private final int geode;\n\n public Day19Kt$main$State(int, int, int, int, int, int, int);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: iload_1\n 6: putfield #13 // Field oreRobots:I\n 9: aload_0\n 10: iload_2\n 11: putfield #16 // Field clayRobots:I\n 14: aload_0\n 15: iload_3\n 16: putfield #19 // Field obsidianRobots:I\n 19: aload_0\n 20: iload 4\n 22: putfield #22 // Field geodeRobots:I\n 25: aload_0\n 26: iload 5\n 28: putfield #25 // Field clay:I\n 31: aload_0\n 32: iload 6\n 34: putfield #28 // Field obsidian:I\n 37: aload_0\n 38: iload 7\n 40: putfield #31 // Field geode:I\n 43: return\n\n public final int getOreRobots();\n Code:\n 0: aload_0\n 1: getfield #13 // Field oreRobots:I\n 4: ireturn\n\n public final int getClayRobots();\n Code:\n 0: aload_0\n 1: getfield #16 // Field clayRobots:I\n 4: ireturn\n\n public final int getObsidianRobots();\n Code:\n 0: aload_0\n 1: getfield #19 // Field obsidianRobots:I\n 4: ireturn\n\n public final int getGeodeRobots();\n Code:\n 0: aload_0\n 1: getfield #22 // Field geodeRobots:I\n 4: ireturn\n\n public final int getClay();\n Code:\n 0: aload_0\n 1: getfield #25 // Field clay:I\n 4: ireturn\n\n public final int getObsidian();\n Code:\n 0: aload_0\n 1: getfield #28 // Field obsidian:I\n 4: ireturn\n\n public final int getGeode();\n Code:\n 0: aload_0\n 1: getfield #31 // Field geode:I\n 4: ireturn\n\n public final Day19Kt$main$State next();\n Code:\n 0: new #2 // class Day19Kt$main$State\n 3: dup\n 4: aload_0\n 5: getfield #13 // Field oreRobots:I\n 8: aload_0\n 9: getfield #16 // Field clayRobots:I\n 12: aload_0\n 13: getfield #19 // Field obsidianRobots:I\n 16: aload_0\n 17: getfield #22 // Field geodeRobots:I\n 20: aload_0\n 21: getfield #25 // Field clay:I\n 24: aload_0\n 25: getfield #16 // Field clayRobots:I\n 28: iadd\n 29: aload_0\n 30: getfield #28 // Field obsidian:I\n 33: aload_0\n 34: getfield #19 // Field obsidianRobots:I\n 37: iadd\n 38: aload_0\n 39: getfield #31 // Field geode:I\n 42: aload_0\n 43: getfield #22 // Field geodeRobots:I\n 46: iadd\n 47: invokespecial #45 // Method \"<init>\":(IIIIIII)V\n 50: areturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field oreRobots:I\n 4: ireturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field clayRobots:I\n 4: ireturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #19 // Field obsidianRobots:I\n 4: ireturn\n\n public final int component4();\n Code:\n 0: aload_0\n 1: getfield #22 // Field geodeRobots:I\n 4: ireturn\n\n public final int component5();\n Code:\n 0: aload_0\n 1: getfield #25 // Field clay:I\n 4: ireturn\n\n public final int component6();\n Code:\n 0: aload_0\n 1: getfield #28 // Field obsidian:I\n 4: ireturn\n\n public final int component7();\n Code:\n 0: aload_0\n 1: getfield #31 // Field geode:I\n 4: ireturn\n\n public final Day19Kt$main$State copy(int, int, int, int, int, int, int);\n Code:\n 0: new #2 // class Day19Kt$main$State\n 3: dup\n 4: iload_1\n 5: iload_2\n 6: iload_3\n 7: iload 4\n 9: iload 5\n 11: iload 6\n 13: iload 7\n 15: invokespecial #45 // Method \"<init>\":(IIIIIII)V\n 18: areturn\n\n public static Day19Kt$main$State copy$default(Day19Kt$main$State, int, int, int, int, int, int, int, int, java.lang.Object);\n Code:\n 0: iload 8\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #13 // Field oreRobots:I\n 11: istore_1\n 12: iload 8\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #16 // Field clayRobots:I\n 23: istore_2\n 24: iload 8\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #19 // Field obsidianRobots:I\n 35: istore_3\n 36: iload 8\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #22 // Field geodeRobots:I\n 48: istore 4\n 50: iload 8\n 52: bipush 16\n 54: iand\n 55: ifeq 64\n 58: aload_0\n 59: getfield #25 // Field clay:I\n 62: istore 5\n 64: iload 8\n 66: bipush 32\n 68: iand\n 69: ifeq 78\n 72: aload_0\n 73: getfield #28 // Field obsidian:I\n 76: istore 6\n 78: iload 8\n 80: bipush 64\n 82: iand\n 83: ifeq 92\n 86: aload_0\n 87: getfield #31 // Field geode:I\n 90: istore 7\n 92: aload_0\n 93: iload_1\n 94: iload_2\n 95: iload_3\n 96: iload 4\n 98: iload 5\n 100: iload 6\n 102: iload 7\n 104: invokevirtual #58 // Method copy:(IIIIIII)LDay19Kt$main$State;\n 107: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #62 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #63 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #65 // String State(oreRobots=\n 9: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field oreRobots:I\n 16: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #74 // String , clayRobots=\n 21: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field clayRobots:I\n 28: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: ldc #76 // String , obsidianRobots=\n 33: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #19 // Field obsidianRobots:I\n 40: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: ldc #78 // String , geodeRobots=\n 45: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #22 // Field geodeRobots:I\n 52: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 55: ldc #80 // String , clay=\n 57: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 60: aload_0\n 61: getfield #25 // Field clay:I\n 64: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 67: ldc #82 // String , obsidian=\n 69: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 72: aload_0\n 73: getfield #28 // Field obsidian:I\n 76: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 79: ldc #84 // String , geode=\n 81: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 84: aload_0\n 85: getfield #31 // Field geode:I\n 88: invokevirtual #72 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 91: bipush 41\n 93: invokevirtual #87 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 96: invokevirtual #89 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 99: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field oreRobots:I\n 4: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field clayRobots:I\n 16: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #19 // Field obsidianRobots:I\n 29: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #22 // Field geodeRobots:I\n 42: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: bipush 31\n 50: imul\n 51: aload_0\n 52: getfield #25 // Field clay:I\n 55: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 58: iadd\n 59: istore_1\n 60: iload_1\n 61: bipush 31\n 63: imul\n 64: aload_0\n 65: getfield #28 // Field obsidian:I\n 68: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 71: iadd\n 72: istore_1\n 73: iload_1\n 74: bipush 31\n 76: imul\n 77: aload_0\n 78: getfield #31 // Field geode:I\n 81: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 84: iadd\n 85: istore_1\n 86: iload_1\n 87: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19Kt$main$State\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19Kt$main$State\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field oreRobots:I\n 25: aload_2\n 26: getfield #13 // Field oreRobots:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #16 // Field clayRobots:I\n 38: aload_2\n 39: getfield #16 // Field clayRobots:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: aload_0\n 48: getfield #19 // Field obsidianRobots:I\n 51: aload_2\n 52: getfield #19 // Field obsidianRobots:I\n 55: if_icmpeq 60\n 58: iconst_0\n 59: ireturn\n 60: aload_0\n 61: getfield #22 // Field geodeRobots:I\n 64: aload_2\n 65: getfield #22 // Field geodeRobots:I\n 68: if_icmpeq 73\n 71: iconst_0\n 72: ireturn\n 73: aload_0\n 74: getfield #25 // Field clay:I\n 77: aload_2\n 78: getfield #25 // Field clay:I\n 81: if_icmpeq 86\n 84: iconst_0\n 85: ireturn\n 86: aload_0\n 87: getfield #28 // Field obsidian:I\n 90: aload_2\n 91: getfield #28 // Field obsidian:I\n 94: if_icmpeq 99\n 97: iconst_0\n 98: ireturn\n 99: aload_0\n 100: getfield #31 // Field geode:I\n 103: aload_2\n 104: getfield #31 // Field geode:I\n 107: if_icmpeq 112\n 110: iconst_0\n 111: ireturn\n 112: iconst_1\n 113: ireturn\n}\n", "javap_err": "" }, { "class_path": "eldarbogdanov__aoc-2022__bdac3ab/Day19Kt.class", "javap": "Compiled from \"day19.kt\"\npublic final class Day19Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String Blueprint 1: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 16 clay. Each geode robot costs 4 ore and 16 obsidian.\\nBlueprint 2: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 14 clay. Each geode robot costs 4 ore and 8 obsidian.\\nBlueprint 3: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 18 clay. Each geode robot costs 4 ore and 16 obsidian.\n 2: astore_0\n 3: new #10 // class kotlin/text/Regex\n 6: dup\n 7: ldc #12 // String Blueprint ([0-9]+): Each ore robot costs ([0-9]+) ore. Each clay robot costs ([0-9]+) ore. Each obsidian robot costs ([0-9]+) ore and ([0-9]+) clay. Each geode robot costs ([0-9]+) ore and ([0-9]+) obsidian.\n 9: invokespecial #16 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 12: astore_1\n 13: iconst_0\n 14: istore_2\n 15: aload_0\n 16: checkcast #18 // class java/lang/CharSequence\n 19: iconst_1\n 20: anewarray #20 // class java/lang/String\n 23: astore 4\n 25: aload 4\n 27: iconst_0\n 28: ldc #22 // String \\n\n 30: aastore\n 31: aload 4\n 33: iconst_0\n 34: iconst_0\n 35: bipush 6\n 37: aconst_null\n 38: invokestatic #28 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 41: invokeinterface #34, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 46: astore_3\n 47: aload_3\n 48: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 250\n 56: aload_3\n 57: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: checkcast #20 // class java/lang/String\n 65: astore 4\n 67: aload_1\n 68: aload 4\n 70: checkcast #18 // class java/lang/CharSequence\n 73: iconst_0\n 74: iconst_2\n 75: aconst_null\n 76: invokestatic #48 // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;\n 79: dup\n 80: invokestatic #54 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 83: invokeinterface #60, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 88: astore 5\n 90: new #62 // class java/lang/StringBuilder\n 93: dup\n 94: invokespecial #64 // Method java/lang/StringBuilder.\"<init>\":()V\n 97: ldc #66 // String Test\n 99: invokevirtual #70 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 102: aload 5\n 104: iconst_1\n 105: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 110: checkcast #20 // class java/lang/String\n 113: invokevirtual #70 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 116: invokevirtual #78 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 119: getstatic #84 // Field java/lang/System.out:Ljava/io/PrintStream;\n 122: swap\n 123: invokevirtual #89 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 126: bipush 32\n 128: aload 5\n 130: iconst_2\n 131: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 136: checkcast #20 // class java/lang/String\n 139: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 142: aload 5\n 144: iconst_3\n 145: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 150: checkcast #20 // class java/lang/String\n 153: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 156: aload 5\n 158: iconst_4\n 159: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 164: checkcast #20 // class java/lang/String\n 167: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 170: aload 5\n 172: iconst_5\n 173: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 178: checkcast #20 // class java/lang/String\n 181: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 184: aload 5\n 186: bipush 6\n 188: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 193: checkcast #20 // class java/lang/String\n 196: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 199: aload 5\n 201: bipush 7\n 203: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 208: checkcast #20 // class java/lang/String\n 211: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 214: invokestatic #99 // Method main$solve:(IIIIIII)I\n 217: istore 6\n 219: getstatic #84 // Field java/lang/System.out:Ljava/io/PrintStream;\n 222: iload 6\n 224: invokevirtual #102 // Method java/io/PrintStream.println:(I)V\n 227: iload_2\n 228: aload 5\n 230: iconst_1\n 231: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 236: checkcast #20 // class java/lang/String\n 239: invokestatic #95 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 242: iload 6\n 244: imul\n 245: iadd\n 246: istore_2\n 247: goto 47\n 250: getstatic #84 // Field java/lang/System.out:Ljava/io/PrintStream;\n 253: iload_2\n 254: invokevirtual #102 // Method java/io/PrintStream.println:(I)V\n 257: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #115 // Method main:()V\n 3: return\n\n private static final void main$solve$put(java.util.Map<Day19Kt$main$State, java.lang.Integer>[], int, Day19Kt$main$State, int);\n Code:\n 0: aload_0\n 1: iload_1\n 2: iconst_1\n 3: iadd\n 4: aaload\n 5: aload_2\n 6: invokeinterface #126, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 11: ifeq 33\n 14: aload_0\n 15: iload_1\n 16: iconst_1\n 17: iadd\n 18: aaload\n 19: aload_2\n 20: invokestatic #132 // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;\n 23: checkcast #134 // class java/lang/Number\n 26: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 29: iload_3\n 30: if_icmpge 53\n 33: iload_3\n 34: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 37: astore 4\n 39: aload_0\n 40: iload_1\n 41: iconst_1\n 42: iadd\n 43: aaload\n 44: aload_2\n 45: aload 4\n 47: invokeinterface #146, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 52: pop\n 53: return\n\n private static final int main$solve(int, int, int, int, int, int, int);\n Code:\n 0: iconst_0\n 1: istore 8\n 3: iload_0\n 4: iconst_1\n 5: iadd\n 6: istore 9\n 8: iload 9\n 10: anewarray #122 // class java/util/Map\n 13: astore 10\n 15: iload 8\n 17: iload 9\n 19: if_icmpge 47\n 22: iload 8\n 24: istore 11\n 26: aload 10\n 28: iload 11\n 30: new #154 // class java/util/LinkedHashMap\n 33: dup\n 34: invokespecial #155 // Method java/util/LinkedHashMap.\"<init>\":()V\n 37: checkcast #122 // class java/util/Map\n 40: aastore\n 41: iinc 8, 1\n 44: goto 15\n 47: aload 10\n 49: astore 7\n 51: aload 7\n 53: iconst_0\n 54: aaload\n 55: new #157 // class Day19Kt$main$State\n 58: dup\n 59: iconst_1\n 60: iconst_0\n 61: iconst_0\n 62: iconst_0\n 63: iconst_0\n 64: iconst_0\n 65: iconst_0\n 66: invokespecial #160 // Method Day19Kt$main$State.\"<init>\":(IIIIIII)V\n 69: iconst_0\n 70: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 73: invokeinterface #146, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 78: pop\n 79: iconst_0\n 80: istore 8\n 82: iconst_0\n 83: istore 9\n 85: iload 9\n 87: iload_0\n 88: if_icmpge 561\n 91: aload 7\n 93: iload 9\n 95: aaload\n 96: invokeinterface #164, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 101: invokeinterface #167, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 106: astore 10\n 108: aload 10\n 110: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 115: ifeq 555\n 118: aload 10\n 120: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 125: checkcast #169 // class java/util/Map$Entry\n 128: astore 11\n 130: aload 11\n 132: invokeinterface #172, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 137: checkcast #157 // class Day19Kt$main$State\n 140: astore 12\n 142: iload 8\n 144: aload 12\n 146: invokevirtual #175 // Method Day19Kt$main$State.next:()LDay19Kt$main$State;\n 149: invokevirtual #178 // Method Day19Kt$main$State.getGeode:()I\n 152: invokestatic #184 // Method java/lang/Math.max:(II)I\n 155: istore 8\n 157: iload 9\n 159: iload_0\n 160: iconst_1\n 161: isub\n 162: if_icmpeq 108\n 165: aload 7\n 167: iload 9\n 169: aload 12\n 171: invokevirtual #175 // Method Day19Kt$main$State.next:()LDay19Kt$main$State;\n 174: aload 11\n 176: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 181: checkcast #134 // class java/lang/Number\n 184: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 187: aload 12\n 189: invokevirtual #189 // Method Day19Kt$main$State.getOreRobots:()I\n 192: iadd\n 193: invokestatic #191 // Method main$solve$put:([Ljava/util/Map;ILDay19Kt$main$State;I)V\n 196: aload 11\n 198: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 203: checkcast #134 // class java/lang/Number\n 206: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 209: iload_1\n 210: if_icmplt 273\n 213: aload 12\n 215: invokevirtual #175 // Method Day19Kt$main$State.next:()LDay19Kt$main$State;\n 218: aload 12\n 220: invokevirtual #189 // Method Day19Kt$main$State.getOreRobots:()I\n 223: iconst_1\n 224: iadd\n 225: iconst_0\n 226: iconst_0\n 227: iconst_0\n 228: iconst_0\n 229: iconst_0\n 230: iconst_0\n 231: bipush 126\n 233: aconst_null\n 234: invokestatic #195 // Method Day19Kt$main$State.copy$default:(LDay19Kt$main$State;IIIIIIIILjava/lang/Object;)LDay19Kt$main$State;\n 237: astore 13\n 239: aload 11\n 241: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 246: checkcast #134 // class java/lang/Number\n 249: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 252: iload_1\n 253: isub\n 254: aload 12\n 256: invokevirtual #189 // Method Day19Kt$main$State.getOreRobots:()I\n 259: iadd\n 260: istore 14\n 262: aload 7\n 264: iload 9\n 266: aload 13\n 268: iload 14\n 270: invokestatic #191 // Method main$solve$put:([Ljava/util/Map;ILDay19Kt$main$State;I)V\n 273: aload 11\n 275: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 280: checkcast #134 // class java/lang/Number\n 283: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 286: iload_2\n 287: if_icmplt 350\n 290: aload 12\n 292: invokevirtual #175 // Method Day19Kt$main$State.next:()LDay19Kt$main$State;\n 295: iconst_0\n 296: aload 12\n 298: invokevirtual #198 // Method Day19Kt$main$State.getClayRobots:()I\n 301: iconst_1\n 302: iadd\n 303: iconst_0\n 304: iconst_0\n 305: iconst_0\n 306: iconst_0\n 307: iconst_0\n 308: bipush 125\n 310: aconst_null\n 311: invokestatic #195 // Method Day19Kt$main$State.copy$default:(LDay19Kt$main$State;IIIIIIIILjava/lang/Object;)LDay19Kt$main$State;\n 314: astore 13\n 316: aload 11\n 318: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 323: checkcast #134 // class java/lang/Number\n 326: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 329: iload_2\n 330: isub\n 331: aload 12\n 333: invokevirtual #189 // Method Day19Kt$main$State.getOreRobots:()I\n 336: iadd\n 337: istore 14\n 339: aload 7\n 341: iload 9\n 343: aload 13\n 345: iload 14\n 347: invokestatic #191 // Method main$solve$put:([Ljava/util/Map;ILDay19Kt$main$State;I)V\n 350: aload 11\n 352: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 357: checkcast #134 // class java/lang/Number\n 360: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 363: iload_3\n 364: if_icmplt 450\n 367: aload 12\n 369: invokevirtual #201 // Method Day19Kt$main$State.getClay:()I\n 372: iload 4\n 374: if_icmplt 450\n 377: aload 12\n 379: invokevirtual #175 // Method Day19Kt$main$State.next:()LDay19Kt$main$State;\n 382: iconst_0\n 383: iconst_0\n 384: aload 12\n 386: invokevirtual #204 // Method Day19Kt$main$State.getObsidianRobots:()I\n 389: iconst_1\n 390: iadd\n 391: iconst_0\n 392: aload 12\n 394: invokevirtual #201 // Method Day19Kt$main$State.getClay:()I\n 397: iload 4\n 399: isub\n 400: aload 12\n 402: invokevirtual #198 // Method Day19Kt$main$State.getClayRobots:()I\n 405: iadd\n 406: iconst_0\n 407: iconst_0\n 408: bipush 107\n 410: aconst_null\n 411: invokestatic #195 // Method Day19Kt$main$State.copy$default:(LDay19Kt$main$State;IIIIIIIILjava/lang/Object;)LDay19Kt$main$State;\n 414: astore 13\n 416: aload 11\n 418: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 423: checkcast #134 // class java/lang/Number\n 426: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 429: iload_3\n 430: isub\n 431: aload 12\n 433: invokevirtual #189 // Method Day19Kt$main$State.getOreRobots:()I\n 436: iadd\n 437: istore 14\n 439: aload 7\n 441: iload 9\n 443: aload 13\n 445: iload 14\n 447: invokestatic #191 // Method main$solve$put:([Ljava/util/Map;ILDay19Kt$main$State;I)V\n 450: aload 11\n 452: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 457: checkcast #134 // class java/lang/Number\n 460: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 463: iload 5\n 465: if_icmplt 108\n 468: aload 12\n 470: invokevirtual #207 // Method Day19Kt$main$State.getObsidian:()I\n 473: iload 6\n 475: if_icmplt 108\n 478: aload 12\n 480: invokevirtual #175 // Method Day19Kt$main$State.next:()LDay19Kt$main$State;\n 483: iconst_0\n 484: iconst_0\n 485: iconst_0\n 486: aload 12\n 488: invokevirtual #210 // Method Day19Kt$main$State.getGeodeRobots:()I\n 491: iconst_1\n 492: iadd\n 493: iconst_0\n 494: aload 12\n 496: invokevirtual #207 // Method Day19Kt$main$State.getObsidian:()I\n 499: iload 6\n 501: isub\n 502: aload 12\n 504: invokevirtual #204 // Method Day19Kt$main$State.getObsidianRobots:()I\n 507: iadd\n 508: iconst_0\n 509: bipush 87\n 511: aconst_null\n 512: invokestatic #195 // Method Day19Kt$main$State.copy$default:(LDay19Kt$main$State;IIIIIIIILjava/lang/Object;)LDay19Kt$main$State;\n 515: astore 13\n 517: aload 11\n 519: invokeinterface #186, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 524: checkcast #134 // class java/lang/Number\n 527: invokevirtual #138 // Method java/lang/Number.intValue:()I\n 530: iload 5\n 532: isub\n 533: aload 12\n 535: invokevirtual #189 // Method Day19Kt$main$State.getOreRobots:()I\n 538: iadd\n 539: istore 14\n 541: aload 7\n 543: iload 9\n 545: aload 13\n 547: iload 14\n 549: invokestatic #191 // Method main$solve$put:([Ljava/util/Map;ILDay19Kt$main$State;I)V\n 552: goto 108\n 555: iinc 9, 1\n 558: goto 85\n 561: iload 8\n 563: ireturn\n}\n", "javap_err": "" } ]
eldarbogdanov__aoc-2022__bdac3ab/src/day7.kt
class Node(val name: String, val folders: MutableMap<String, Node>, val files: MutableMap<String, Long>); val parents: MutableMap<Node, Node> = mutableMapOf<Node, Node>(); val folderSizes: MutableMap<Node, Long> = mutableMapOf(); fun sumFiles(cur: Node, limit: Long): Pair<Long, Long> { var size: Long = cur.files.values.sum(); var ret: Long = 0; for(subfolder in cur.folders.keys) { val (folderSize, ans) = sumFiles(cur.folders[subfolder]!!, limit); size += folderSize; ret += ans; } folderSizes.put(cur, size); if (size <= limit) ret += size; return Pair(size, ret); } fun main() { val input = "" var root = Node("/", mutableMapOf<String, Node>(), mutableMapOf<String, Long>()); var currentNode: Node? = null; for(s in input.split("\n")) { //println(s + " " + currentNode?.name); if (!s.startsWith("$")) { if (s.startsWith("dir")) { val subfolder = s.split(" ")[1]; val newNode = Node(subfolder, mutableMapOf(), mutableMapOf()); currentNode!!.folders.put(subfolder, newNode); parents.put(newNode, currentNode); } else { val fileName = s.split(" ")[1]; val fileSize = Integer.parseInt(s.split(" ")[0]); currentNode!!.files.put(fileName, fileSize.toLong()); } } else if (s == "$ cd /") currentNode = root; else if (s == "$ cd ..") currentNode = parents[currentNode!!]; else if (s.startsWith("$ cd")) { //println(currentNode!!.folders); currentNode = currentNode!!.folders[s.split(" ")[2]]; } else { if (s != "$ ls") println("oops " + s); } } println(sumFiles(root, 100000).second); val totalSize = folderSizes[root]!!; var ans: Long = 1000000000; for(entry in folderSizes.entries.iterator()) { val size = entry.value; if (70000000 - totalSize + size >= 30000000 && size < ans) { ans = size; } } println(ans); }
[ { "class_path": "eldarbogdanov__aoc-2022__bdac3ab/Day7Kt.class", "javap": "Compiled from \"day7.kt\"\npublic final class Day7Kt {\n private static final java.util.Map<Node, Node> parents;\n\n private static final java.util.Map<Node, java.lang.Long> folderSizes;\n\n public static final java.util.Map<Node, Node> getParents();\n Code:\n 0: getstatic #12 // Field parents:Ljava/util/Map;\n 3: areturn\n\n public static final java.util.Map<Node, java.lang.Long> getFolderSizes();\n Code:\n 0: getstatic #17 // Field folderSizes:Ljava/util/Map;\n 3: areturn\n\n public static final kotlin.Pair<java.lang.Long, java.lang.Long> sumFiles(Node, long);\n Code:\n 0: aload_0\n 1: ldc #22 // String cur\n 3: invokestatic #28 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #33 // Method Node.getFiles:()Ljava/util/Map;\n 10: invokeinterface #39, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 15: checkcast #41 // class java/lang/Iterable\n 18: invokestatic #47 // Method kotlin/collections/CollectionsKt.sumOfLong:(Ljava/lang/Iterable;)J\n 21: lstore_3\n 22: lconst_0\n 23: lstore 5\n 25: aload_0\n 26: invokevirtual #50 // Method Node.getFolders:()Ljava/util/Map;\n 29: invokeinterface #54, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 34: invokeinterface #60, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 39: astore 7\n 41: aload 7\n 43: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 48: ifeq 128\n 51: aload 7\n 53: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 58: checkcast #72 // class java/lang/String\n 61: astore 8\n 63: aload_0\n 64: invokevirtual #50 // Method Node.getFolders:()Ljava/util/Map;\n 67: aload 8\n 69: invokeinterface #76, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 74: dup\n 75: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 78: checkcast #30 // class Node\n 81: lload_1\n 82: invokestatic #82 // Method sumFiles:(LNode;J)Lkotlin/Pair;\n 85: astore 9\n 87: aload 9\n 89: invokevirtual #87 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 92: checkcast #89 // class java/lang/Number\n 95: invokevirtual #93 // Method java/lang/Number.longValue:()J\n 98: lstore 10\n 100: aload 9\n 102: invokevirtual #96 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 105: checkcast #89 // class java/lang/Number\n 108: invokevirtual #93 // Method java/lang/Number.longValue:()J\n 111: lstore 12\n 113: lload_3\n 114: lload 10\n 116: ladd\n 117: lstore_3\n 118: lload 5\n 120: lload 12\n 122: ladd\n 123: lstore 5\n 125: goto 41\n 128: getstatic #17 // Field folderSizes:Ljava/util/Map;\n 131: aload_0\n 132: lload_3\n 133: invokestatic #102 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 136: invokeinterface #106, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 141: pop\n 142: lload_3\n 143: lload_1\n 144: lcmp\n 145: ifgt 154\n 148: lload 5\n 150: lload_3\n 151: ladd\n 152: lstore 5\n 154: new #84 // class kotlin/Pair\n 157: dup\n 158: lload_3\n 159: invokestatic #102 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 162: lload 5\n 164: invokestatic #102 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 167: invokespecial #110 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 170: areturn\n\n public static final void main();\n Code:\n 0: ldc #123 // String\n 2: astore_0\n 3: new #30 // class Node\n 6: dup\n 7: ldc #125 // String /\n 9: new #127 // class java/util/LinkedHashMap\n 12: dup\n 13: invokespecial #129 // Method java/util/LinkedHashMap.\"<init>\":()V\n 16: checkcast #35 // class java/util/Map\n 19: new #127 // class java/util/LinkedHashMap\n 22: dup\n 23: invokespecial #129 // Method java/util/LinkedHashMap.\"<init>\":()V\n 26: checkcast #35 // class java/util/Map\n 29: invokespecial #132 // Method Node.\"<init>\":(Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;)V\n 32: astore_1\n 33: aconst_null\n 34: astore_2\n 35: aload_0\n 36: checkcast #134 // class java/lang/CharSequence\n 39: iconst_1\n 40: anewarray #72 // class java/lang/String\n 43: astore 4\n 45: aload 4\n 47: iconst_0\n 48: ldc #136 // String \\n\n 50: aastore\n 51: aload 4\n 53: iconst_0\n 54: iconst_0\n 55: bipush 6\n 57: aconst_null\n 58: invokestatic #142 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 61: invokeinterface #145, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 66: astore_3\n 67: aload_3\n 68: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 73: ifeq 470\n 76: aload_3\n 77: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 82: checkcast #72 // class java/lang/String\n 85: astore 4\n 87: aload 4\n 89: ldc #147 // String $\n 91: iconst_0\n 92: iconst_2\n 93: aconst_null\n 94: invokestatic #151 // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z\n 97: ifne 319\n 100: aload 4\n 102: ldc #153 // String dir\n 104: iconst_0\n 105: iconst_2\n 106: aconst_null\n 107: invokestatic #151 // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z\n 110: ifeq 215\n 113: aload 4\n 115: checkcast #134 // class java/lang/CharSequence\n 118: iconst_1\n 119: anewarray #72 // class java/lang/String\n 122: astore 6\n 124: aload 6\n 126: iconst_0\n 127: ldc #155 // String\n 129: aastore\n 130: aload 6\n 132: iconst_0\n 133: iconst_0\n 134: bipush 6\n 136: aconst_null\n 137: invokestatic #142 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 140: iconst_1\n 141: invokeinterface #158, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 146: checkcast #72 // class java/lang/String\n 149: astore 5\n 151: new #30 // class Node\n 154: dup\n 155: aload 5\n 157: new #127 // class java/util/LinkedHashMap\n 160: dup\n 161: invokespecial #129 // Method java/util/LinkedHashMap.\"<init>\":()V\n 164: checkcast #35 // class java/util/Map\n 167: new #127 // class java/util/LinkedHashMap\n 170: dup\n 171: invokespecial #129 // Method java/util/LinkedHashMap.\"<init>\":()V\n 174: checkcast #35 // class java/util/Map\n 177: invokespecial #132 // Method Node.\"<init>\":(Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;)V\n 180: astore 6\n 182: aload_2\n 183: dup\n 184: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 187: invokevirtual #50 // Method Node.getFolders:()Ljava/util/Map;\n 190: aload 5\n 192: aload 6\n 194: invokeinterface #106, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 199: pop\n 200: getstatic #12 // Field parents:Ljava/util/Map;\n 203: aload 6\n 205: aload_2\n 206: invokeinterface #106, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 211: pop\n 212: goto 67\n 215: aload 4\n 217: checkcast #134 // class java/lang/CharSequence\n 220: iconst_1\n 221: anewarray #72 // class java/lang/String\n 224: astore 6\n 226: aload 6\n 228: iconst_0\n 229: ldc #155 // String\n 231: aastore\n 232: aload 6\n 234: iconst_0\n 235: iconst_0\n 236: bipush 6\n 238: aconst_null\n 239: invokestatic #142 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 242: iconst_1\n 243: invokeinterface #158, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 248: checkcast #72 // class java/lang/String\n 251: astore 5\n 253: aload 4\n 255: checkcast #134 // class java/lang/CharSequence\n 258: iconst_1\n 259: anewarray #72 // class java/lang/String\n 262: astore 7\n 264: aload 7\n 266: iconst_0\n 267: ldc #155 // String\n 269: aastore\n 270: aload 7\n 272: iconst_0\n 273: iconst_0\n 274: bipush 6\n 276: aconst_null\n 277: invokestatic #142 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 280: iconst_0\n 281: invokeinterface #158, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 286: checkcast #72 // class java/lang/String\n 289: invokestatic #164 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 292: istore 6\n 294: aload_2\n 295: dup\n 296: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 299: invokevirtual #33 // Method Node.getFiles:()Ljava/util/Map;\n 302: aload 5\n 304: iload 6\n 306: i2l\n 307: invokestatic #102 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 310: invokeinterface #106, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 315: pop\n 316: goto 67\n 319: aload 4\n 321: ldc #166 // String $ cd /\n 323: invokestatic #170 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 326: ifeq 334\n 329: aload_1\n 330: astore_2\n 331: goto 67\n 334: aload 4\n 336: ldc #172 // String $ cd ..\n 338: invokestatic #170 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 341: ifeq 364\n 344: getstatic #12 // Field parents:Ljava/util/Map;\n 347: aload_2\n 348: dup\n 349: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 352: invokeinterface #76, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 357: checkcast #30 // class Node\n 360: astore_2\n 361: goto 67\n 364: aload 4\n 366: ldc #174 // String $ cd\n 368: iconst_0\n 369: iconst_2\n 370: aconst_null\n 371: invokestatic #151 // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z\n 374: ifeq 430\n 377: aload_2\n 378: dup\n 379: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 382: invokevirtual #50 // Method Node.getFolders:()Ljava/util/Map;\n 385: aload 4\n 387: checkcast #134 // class java/lang/CharSequence\n 390: iconst_1\n 391: anewarray #72 // class java/lang/String\n 394: astore 5\n 396: aload 5\n 398: iconst_0\n 399: ldc #155 // String\n 401: aastore\n 402: aload 5\n 404: iconst_0\n 405: iconst_0\n 406: bipush 6\n 408: aconst_null\n 409: invokestatic #142 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 412: iconst_2\n 413: invokeinterface #158, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 418: invokeinterface #76, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 423: checkcast #30 // class Node\n 426: astore_2\n 427: goto 67\n 430: aload 4\n 432: ldc #176 // String $ ls\n 434: invokestatic #170 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 437: ifne 67\n 440: new #178 // class java/lang/StringBuilder\n 443: dup\n 444: invokespecial #179 // Method java/lang/StringBuilder.\"<init>\":()V\n 447: ldc #181 // String oops\n 449: invokevirtual #185 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 452: aload 4\n 454: invokevirtual #185 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 457: invokevirtual #189 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 460: getstatic #195 // Field java/lang/System.out:Ljava/io/PrintStream;\n 463: swap\n 464: invokevirtual #200 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 467: goto 67\n 470: aload_1\n 471: ldc2_w #201 // long 100000l\n 474: invokestatic #82 // Method sumFiles:(LNode;J)Lkotlin/Pair;\n 477: invokevirtual #205 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 480: checkcast #89 // class java/lang/Number\n 483: invokevirtual #93 // Method java/lang/Number.longValue:()J\n 486: lstore_3\n 487: getstatic #195 // Field java/lang/System.out:Ljava/io/PrintStream;\n 490: lload_3\n 491: invokevirtual #208 // Method java/io/PrintStream.println:(J)V\n 494: getstatic #17 // Field folderSizes:Ljava/util/Map;\n 497: aload_1\n 498: invokeinterface #76, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 503: dup\n 504: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 507: checkcast #89 // class java/lang/Number\n 510: invokevirtual #93 // Method java/lang/Number.longValue:()J\n 513: lstore_3\n 514: ldc2_w #209 // long 1000000000l\n 517: lstore 5\n 519: getstatic #17 // Field folderSizes:Ljava/util/Map;\n 522: invokeinterface #213, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 527: invokeinterface #60, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 532: astore 7\n 534: aload 7\n 536: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 541: ifeq 601\n 544: aload 7\n 546: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 551: checkcast #215 // class java/util/Map$Entry\n 554: astore 8\n 556: aload 8\n 558: invokeinterface #218, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 563: checkcast #89 // class java/lang/Number\n 566: invokevirtual #93 // Method java/lang/Number.longValue:()J\n 569: lstore 9\n 571: ldc #219 // int 70000000\n 573: i2l\n 574: lload_3\n 575: lsub\n 576: lload 9\n 578: ladd\n 579: ldc2_w #220 // long 30000000l\n 582: lcmp\n 583: iflt 534\n 586: lload 9\n 588: lload 5\n 590: lcmp\n 591: ifge 534\n 594: lload 9\n 596: lstore 5\n 598: goto 534\n 601: getstatic #195 // Field java/lang/System.out:Ljava/io/PrintStream;\n 604: lload 5\n 606: invokevirtual #208 // Method java/io/PrintStream.println:(J)V\n 609: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #235 // Method main:()V\n 3: return\n\n static {};\n Code:\n 0: new #127 // class java/util/LinkedHashMap\n 3: dup\n 4: invokespecial #129 // Method java/util/LinkedHashMap.\"<init>\":()V\n 7: checkcast #35 // class java/util/Map\n 10: putstatic #12 // Field parents:Ljava/util/Map;\n 13: new #127 // class java/util/LinkedHashMap\n 16: dup\n 17: invokespecial #129 // Method java/util/LinkedHashMap.\"<init>\":()V\n 20: checkcast #35 // class java/util/Map\n 23: putstatic #17 // Field folderSizes:Ljava/util/Map;\n 26: return\n}\n", "javap_err": "" } ]
eldarbogdanov__aoc-2022__bdac3ab/src/day12.kt
fun main() { val test = "" val di = listOf(-1, 0, 1, 0); val dj = listOf(0, 1, 0, -1); val mat = test.split("\n"); val n = mat.size; val m = mat[0].length; val best = Array(n) {Array(m) {n * m} }; val next: MutableList<Pair<Int, Int>> = mutableListOf(); for((i, s) in mat.withIndex()) { for(j in 0 until s.length) { // remove the 'a' clause for first subproblem if (mat[i][j] == 'S' || mat[i][j] == 'a') { next.add(Pair(i, j)); best[i][j] = 0; } } } var curInd = 0; while(curInd < next.size) { val cur = next[curInd++]; for(d in 0..3) { val newPos = Pair(cur.first + di[d], cur.second + dj[d]); if (newPos.first < 0 || newPos.first >= n || newPos.second < 0 || newPos.second >= m) continue; val curHeight = if (mat[cur.first][cur.second] == 'S') 0 else mat[cur.first][cur.second] - 'a'; val newHeight = if (mat[newPos.first][newPos.second] == 'E') 25 else mat[newPos.first][newPos.second] - 'a'; if (curHeight + 1 >= newHeight && best[newPos.first][newPos.second] > best[cur.first][cur.second] + 1) { best[newPos.first][newPos.second] = best[cur.first][cur.second] + 1; next.add(newPos); } } } for((i, s) in mat.withIndex()) { for(j in 0 until s.length) { if (mat[i][j] == 'E') { println(best[i][j]); } } } }
[ { "class_path": "eldarbogdanov__aoc-2022__bdac3ab/Day12Kt.class", "javap": "Compiled from \"day12.kt\"\npublic final class Day12Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String\n 2: astore_0\n 3: iconst_4\n 4: anewarray #10 // class java/lang/Integer\n 7: astore_2\n 8: aload_2\n 9: iconst_0\n 10: iconst_m1\n 11: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: aastore\n 15: aload_2\n 16: iconst_1\n 17: iconst_0\n 18: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 21: aastore\n 22: aload_2\n 23: iconst_2\n 24: iconst_1\n 25: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 28: aastore\n 29: aload_2\n 30: iconst_3\n 31: iconst_0\n 32: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 35: aastore\n 36: aload_2\n 37: invokestatic #20 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 40: astore_1\n 41: iconst_4\n 42: anewarray #10 // class java/lang/Integer\n 45: astore_3\n 46: aload_3\n 47: iconst_0\n 48: iconst_0\n 49: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 52: aastore\n 53: aload_3\n 54: iconst_1\n 55: iconst_1\n 56: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 59: aastore\n 60: aload_3\n 61: iconst_2\n 62: iconst_0\n 63: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 66: aastore\n 67: aload_3\n 68: iconst_3\n 69: iconst_m1\n 70: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 73: aastore\n 74: aload_3\n 75: invokestatic #20 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 78: astore_2\n 79: aload_0\n 80: checkcast #22 // class java/lang/CharSequence\n 83: iconst_1\n 84: anewarray #24 // class java/lang/String\n 87: astore 4\n 89: aload 4\n 91: iconst_0\n 92: ldc #26 // String \\n\n 94: aastore\n 95: aload 4\n 97: iconst_0\n 98: iconst_0\n 99: bipush 6\n 101: aconst_null\n 102: invokestatic #32 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 105: astore_3\n 106: aload_3\n 107: invokeinterface #38, 1 // InterfaceMethod java/util/List.size:()I\n 112: istore 4\n 114: aload_3\n 115: iconst_0\n 116: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 121: checkcast #24 // class java/lang/String\n 124: invokevirtual #45 // Method java/lang/String.length:()I\n 127: istore 5\n 129: iconst_0\n 130: istore 7\n 132: iload 4\n 134: anewarray #47 // class \"[Ljava/lang/Integer;\"\n 137: astore 8\n 139: iload 7\n 141: iload 4\n 143: if_icmpge 211\n 146: iload 7\n 148: istore 9\n 150: aload 8\n 152: iload 9\n 154: iconst_0\n 155: istore 10\n 157: iload 5\n 159: anewarray #10 // class java/lang/Integer\n 162: astore 11\n 164: istore 17\n 166: astore 16\n 168: iload 10\n 170: iload 5\n 172: if_icmpge 198\n 175: iload 10\n 177: istore 12\n 179: aload 11\n 181: iload 12\n 183: iload 4\n 185: iload 5\n 187: imul\n 188: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 191: aastore\n 192: iinc 10, 1\n 195: goto 168\n 198: aload 16\n 200: iload 17\n 202: aload 11\n 204: aastore\n 205: iinc 7, 1\n 208: goto 139\n 211: aload 8\n 213: astore 6\n 215: new #49 // class java/util/ArrayList\n 218: dup\n 219: invokespecial #52 // Method java/util/ArrayList.\"<init>\":()V\n 222: checkcast #34 // class java/util/List\n 225: astore 7\n 227: aload_3\n 228: checkcast #54 // class java/lang/Iterable\n 231: invokeinterface #58, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 236: astore 8\n 238: iconst_0\n 239: istore 9\n 241: aload 8\n 243: invokeinterface #64, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 248: ifeq 375\n 251: iload 9\n 253: istore 10\n 255: iload 9\n 257: iconst_1\n 258: iadd\n 259: istore 9\n 261: aload 8\n 263: invokeinterface #68, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 268: checkcast #24 // class java/lang/String\n 271: astore 11\n 273: iconst_0\n 274: istore 12\n 276: aload 11\n 278: invokevirtual #45 // Method java/lang/String.length:()I\n 281: istore 13\n 283: iload 12\n 285: iload 13\n 287: if_icmpge 241\n 290: aload_3\n 291: iload 10\n 293: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 298: checkcast #24 // class java/lang/String\n 301: iload 12\n 303: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 306: bipush 83\n 308: if_icmpeq 332\n 311: aload_3\n 312: iload 10\n 314: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 319: checkcast #24 // class java/lang/String\n 322: iload 12\n 324: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 327: bipush 97\n 329: if_icmpne 369\n 332: aload 7\n 334: new #74 // class kotlin/Pair\n 337: dup\n 338: iload 10\n 340: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 343: iload 12\n 345: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 348: invokespecial #77 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 351: invokeinterface #81, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 356: pop\n 357: aload 6\n 359: iload 10\n 361: aaload\n 362: iload 12\n 364: iconst_0\n 365: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 368: aastore\n 369: iinc 12, 1\n 372: goto 283\n 375: iconst_0\n 376: istore 8\n 378: iload 8\n 380: aload 7\n 382: invokeinterface #38, 1 // InterfaceMethod java/util/List.size:()I\n 387: if_icmpge 859\n 390: aload 7\n 392: iload 8\n 394: iinc 8, 1\n 397: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 402: checkcast #74 // class kotlin/Pair\n 405: astore 9\n 407: iconst_0\n 408: istore 10\n 410: iload 10\n 412: iconst_4\n 413: if_icmpge 378\n 416: new #74 // class kotlin/Pair\n 419: dup\n 420: aload 9\n 422: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 425: checkcast #86 // class java/lang/Number\n 428: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 431: aload_1\n 432: iload 10\n 434: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 439: checkcast #86 // class java/lang/Number\n 442: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 445: iadd\n 446: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 449: aload 9\n 451: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 454: checkcast #86 // class java/lang/Number\n 457: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 460: aload_2\n 461: iload 10\n 463: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 468: checkcast #86 // class java/lang/Number\n 471: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 474: iadd\n 475: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 478: invokespecial #77 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 481: astore 11\n 483: aload 11\n 485: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 488: checkcast #86 // class java/lang/Number\n 491: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 494: iflt 853\n 497: aload 11\n 499: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 502: checkcast #86 // class java/lang/Number\n 505: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 508: iload 4\n 510: if_icmpge 853\n 513: aload 11\n 515: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 518: checkcast #86 // class java/lang/Number\n 521: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 524: iflt 853\n 527: aload 11\n 529: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 532: checkcast #86 // class java/lang/Number\n 535: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 538: iload 5\n 540: if_icmplt 546\n 543: goto 853\n 546: aload_3\n 547: aload 9\n 549: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 552: checkcast #86 // class java/lang/Number\n 555: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 558: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 563: checkcast #24 // class java/lang/String\n 566: aload 9\n 568: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 571: checkcast #86 // class java/lang/Number\n 574: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 577: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 580: bipush 83\n 582: if_icmpne 589\n 585: iconst_0\n 586: goto 626\n 589: aload_3\n 590: aload 9\n 592: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 595: checkcast #86 // class java/lang/Number\n 598: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 601: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 606: checkcast #24 // class java/lang/String\n 609: aload 9\n 611: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 614: checkcast #86 // class java/lang/Number\n 617: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 620: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 623: bipush 97\n 625: isub\n 626: istore 12\n 628: aload_3\n 629: aload 11\n 631: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 634: checkcast #86 // class java/lang/Number\n 637: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 640: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 645: checkcast #24 // class java/lang/String\n 648: aload 11\n 650: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 653: checkcast #86 // class java/lang/Number\n 656: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 659: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 662: bipush 69\n 664: if_icmpne 672\n 667: bipush 25\n 669: goto 709\n 672: aload_3\n 673: aload 11\n 675: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 678: checkcast #86 // class java/lang/Number\n 681: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 684: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 689: checkcast #24 // class java/lang/String\n 692: aload 11\n 694: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 697: checkcast #86 // class java/lang/Number\n 700: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 703: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 706: bipush 97\n 708: isub\n 709: istore 13\n 711: iload 12\n 713: iconst_1\n 714: iadd\n 715: iload 13\n 717: if_icmplt 853\n 720: aload 6\n 722: aload 11\n 724: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 727: checkcast #86 // class java/lang/Number\n 730: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 733: aaload\n 734: aload 11\n 736: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 739: checkcast #86 // class java/lang/Number\n 742: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 745: aaload\n 746: invokevirtual #93 // Method java/lang/Integer.intValue:()I\n 749: aload 6\n 751: aload 9\n 753: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 756: checkcast #86 // class java/lang/Number\n 759: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 762: aaload\n 763: aload 9\n 765: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 768: checkcast #86 // class java/lang/Number\n 771: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 774: aaload\n 775: invokevirtual #93 // Method java/lang/Integer.intValue:()I\n 778: iconst_1\n 779: iadd\n 780: if_icmple 853\n 783: aload 6\n 785: aload 11\n 787: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 790: checkcast #86 // class java/lang/Number\n 793: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 796: aaload\n 797: aload 11\n 799: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 802: checkcast #86 // class java/lang/Number\n 805: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 808: aload 6\n 810: aload 9\n 812: invokevirtual #84 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 815: checkcast #86 // class java/lang/Number\n 818: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 821: aaload\n 822: aload 9\n 824: invokevirtual #92 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 827: checkcast #86 // class java/lang/Number\n 830: invokevirtual #89 // Method java/lang/Number.intValue:()I\n 833: aaload\n 834: invokevirtual #93 // Method java/lang/Integer.intValue:()I\n 837: iconst_1\n 838: iadd\n 839: invokestatic #14 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 842: aastore\n 843: aload 7\n 845: aload 11\n 847: invokeinterface #81, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 852: pop\n 853: iinc 10, 1\n 856: goto 410\n 859: aload_3\n 860: checkcast #54 // class java/lang/Iterable\n 863: invokeinterface #58, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 868: astore 9\n 870: iconst_0\n 871: istore 10\n 873: aload 9\n 875: invokeinterface #64, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 880: ifeq 970\n 883: iload 10\n 885: istore 11\n 887: iload 10\n 889: iconst_1\n 890: iadd\n 891: istore 10\n 893: aload 9\n 895: invokeinterface #68, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 900: checkcast #24 // class java/lang/String\n 903: astore 12\n 905: iconst_0\n 906: istore 13\n 908: aload 12\n 910: invokevirtual #45 // Method java/lang/String.length:()I\n 913: istore 14\n 915: iload 13\n 917: iload 14\n 919: if_icmpge 873\n 922: aload_3\n 923: iload 11\n 925: invokeinterface #42, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 930: checkcast #24 // class java/lang/String\n 933: iload 13\n 935: invokevirtual #72 // Method java/lang/String.charAt:(I)C\n 938: bipush 69\n 940: if_icmpne 964\n 943: aload 6\n 945: iload 11\n 947: aaload\n 948: iload 13\n 950: aaload\n 951: invokevirtual #93 // Method java/lang/Integer.intValue:()I\n 954: istore 15\n 956: getstatic #99 // Field java/lang/System.out:Ljava/io/PrintStream;\n 959: iload 15\n 961: invokevirtual #105 // Method java/io/PrintStream.println:(I)V\n 964: iinc 13, 1\n 967: goto 915\n 970: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #130 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
rajatenzyme__Coding-Journey__65a0570/Algo_Ds_Notes-master/Algo_Ds_Notes-master/Jhonson_Algoritm/Jhonson_Algorithm.kt
fun main() { var vert = 0 var edge = 0 var i = 0 var j = 0 var k = 0 var c = 0 var inf = 999999; var cost = Array(10, {IntArray(10)}) var adj = Array(10, {IntArray(10)}) println("Enter no of vertices: ") vert = readLine() !!.toInt() println("Enter no of Edges: "); edge = readLine() !!.toInt() println("Enter the EDGE cost: "); for (k in 1..edge) { i = readLine() !!.toInt() j = readLine() !!.toInt() c = readLine() !!.toInt() adj[i][j] = c cost[i][j] = c } for (i in 1..vert) for (j in 1..vert) { if (adj[i][j] == 0 && i != j) //If its not a edge put infinity adj[i][j] = inf } for (k in 1..vert) for (i in 1..vert) for (j in 1..vert) //Finding the minimum //find minimum path from i to j through k if ((adj[i][k] + adj[k][j]) > adj[i][j]) adj[i][j] = adj[i][j] else adj[i][j] = (adj[i][k] + adj[k][j]) println("The distance matrix of the graph."); // Output the resultant matrix for (i in 1..vert) { for (j in 1..vert) { if (adj[i][j] != inf) print("${adj[i][j]} "); } println(" "); } } /*Enter no of vertices: 3 Enter no of Edges: 5 Enter the EDGE cost: 1 2 8 2 1 12 1 3 22 3 1 6 2 3 4 The distance matrix of the graph. 0 8 12 10 0 4 6 14 0*/
[ { "class_path": "rajatenzyme__Coding-Journey__65a0570/Jhonson_AlgorithmKt.class", "javap": "Compiled from \"Jhonson_Algorithm.kt\"\npublic final class Jhonson_AlgorithmKt {\n public static final void main();\n Code:\n 0: iconst_0\n 1: istore_0\n 2: iconst_0\n 3: istore_1\n 4: iconst_0\n 5: istore_2\n 6: iconst_0\n 7: istore_3\n 8: iconst_0\n 9: istore 4\n 11: iconst_0\n 12: istore 5\n 14: ldc #7 // int 999999\n 16: istore 6\n 18: iconst_0\n 19: istore 8\n 21: bipush 10\n 23: anewarray #9 // class \"[I\"\n 26: astore 9\n 28: iload 8\n 30: bipush 10\n 32: if_icmpge 54\n 35: iload 8\n 37: istore 10\n 39: aload 9\n 41: iload 10\n 43: bipush 10\n 45: newarray int\n 47: aastore\n 48: iinc 8, 1\n 51: goto 28\n 54: aload 9\n 56: astore 7\n 58: iconst_0\n 59: istore 9\n 61: bipush 10\n 63: anewarray #9 // class \"[I\"\n 66: astore 10\n 68: iload 9\n 70: bipush 10\n 72: if_icmpge 94\n 75: iload 9\n 77: istore 11\n 79: aload 10\n 81: iload 11\n 83: bipush 10\n 85: newarray int\n 87: aastore\n 88: iinc 9, 1\n 91: goto 68\n 94: aload 10\n 96: astore 8\n 98: ldc #11 // String Enter no of vertices:\n 100: getstatic #17 // Field java/lang/System.out:Ljava/io/PrintStream;\n 103: swap\n 104: invokevirtual #23 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 107: invokestatic #29 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 110: dup\n 111: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 114: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 117: istore_0\n 118: ldc #42 // String Enter no of Edges:\n 120: getstatic #17 // Field java/lang/System.out:Ljava/io/PrintStream;\n 123: swap\n 124: invokevirtual #23 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 127: invokestatic #29 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 130: dup\n 131: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 134: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 137: istore_1\n 138: ldc #44 // String Enter the EDGE cost:\n 140: getstatic #17 // Field java/lang/System.out:Ljava/io/PrintStream;\n 143: swap\n 144: invokevirtual #23 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 147: iconst_1\n 148: istore 9\n 150: iload_1\n 151: istore 10\n 153: iload 9\n 155: iload 10\n 157: if_icmpgt 223\n 160: invokestatic #29 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 163: dup\n 164: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 167: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 170: istore_2\n 171: invokestatic #29 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 174: dup\n 175: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 178: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 181: istore_3\n 182: invokestatic #29 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 185: dup\n 186: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 189: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 192: istore 5\n 194: aload 8\n 196: iload_2\n 197: aaload\n 198: iload_3\n 199: iload 5\n 201: iastore\n 202: aload 7\n 204: iload_2\n 205: aaload\n 206: iload_3\n 207: iload 5\n 209: iastore\n 210: iload 9\n 212: iload 10\n 214: if_icmpeq 223\n 217: iinc 9, 1\n 220: goto 160\n 223: iconst_1\n 224: istore 9\n 226: iload_0\n 227: istore 10\n 229: iload 9\n 231: iload 10\n 233: if_icmpgt 303\n 236: iconst_1\n 237: istore 11\n 239: iload_0\n 240: istore 12\n 242: iload 11\n 244: iload 12\n 246: if_icmpgt 290\n 249: aload 8\n 251: iload 9\n 253: aaload\n 254: iload 11\n 256: iaload\n 257: ifne 277\n 260: iload 9\n 262: iload 11\n 264: if_icmpeq 277\n 267: aload 8\n 269: iload 9\n 271: aaload\n 272: iload 11\n 274: iload 6\n 276: iastore\n 277: iload 11\n 279: iload 12\n 281: if_icmpeq 290\n 284: iinc 11, 1\n 287: goto 249\n 290: iload 9\n 292: iload 10\n 294: if_icmpeq 303\n 297: iinc 9, 1\n 300: goto 236\n 303: iconst_1\n 304: istore 9\n 306: iload_0\n 307: istore 10\n 309: iload 9\n 311: iload 10\n 313: if_icmpgt 453\n 316: iconst_1\n 317: istore 11\n 319: iload_0\n 320: istore 12\n 322: iload 11\n 324: iload 12\n 326: if_icmpgt 440\n 329: iconst_1\n 330: istore 13\n 332: iload_0\n 333: istore 14\n 335: iload 13\n 337: iload 14\n 339: if_icmpgt 427\n 342: aload 8\n 344: iload 11\n 346: aaload\n 347: iload 9\n 349: iaload\n 350: aload 8\n 352: iload 9\n 354: aaload\n 355: iload 13\n 357: iaload\n 358: iadd\n 359: aload 8\n 361: iload 11\n 363: aaload\n 364: iload 13\n 366: iaload\n 367: if_icmple 389\n 370: aload 8\n 372: iload 11\n 374: aaload\n 375: iload 13\n 377: aload 8\n 379: iload 11\n 381: aaload\n 382: iload 13\n 384: iaload\n 385: iastore\n 386: goto 414\n 389: aload 8\n 391: iload 11\n 393: aaload\n 394: iload 13\n 396: aload 8\n 398: iload 11\n 400: aaload\n 401: iload 9\n 403: iaload\n 404: aload 8\n 406: iload 9\n 408: aaload\n 409: iload 13\n 411: iaload\n 412: iadd\n 413: iastore\n 414: iload 13\n 416: iload 14\n 418: if_icmpeq 427\n 421: iinc 13, 1\n 424: goto 342\n 427: iload 11\n 429: iload 12\n 431: if_icmpeq 440\n 434: iinc 11, 1\n 437: goto 329\n 440: iload 9\n 442: iload 10\n 444: if_icmpeq 453\n 447: iinc 9, 1\n 450: goto 316\n 453: ldc #46 // String The distance matrix of the graph.\n 455: getstatic #17 // Field java/lang/System.out:Ljava/io/PrintStream;\n 458: swap\n 459: invokevirtual #23 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 462: iconst_1\n 463: istore 9\n 465: iload_0\n 466: istore 10\n 468: iload 9\n 470: iload 10\n 472: if_icmpgt 569\n 475: iconst_1\n 476: istore 11\n 478: iload_0\n 479: istore 12\n 481: iload 11\n 483: iload 12\n 485: if_icmpgt 547\n 488: aload 8\n 490: iload 9\n 492: aaload\n 493: iload 11\n 495: iaload\n 496: iload 6\n 498: if_icmpeq 534\n 501: new #48 // class java/lang/StringBuilder\n 504: dup\n 505: invokespecial #51 // Method java/lang/StringBuilder.\"<init>\":()V\n 508: aload 8\n 510: iload 9\n 512: aaload\n 513: iload 11\n 515: iaload\n 516: invokevirtual #55 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 519: bipush 32\n 521: invokevirtual #58 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 524: invokevirtual #61 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 527: getstatic #17 // Field java/lang/System.out:Ljava/io/PrintStream;\n 530: swap\n 531: invokevirtual #64 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 534: iload 11\n 536: iload 12\n 538: if_icmpeq 547\n 541: iinc 11, 1\n 544: goto 488\n 547: ldc #66 // String\n 549: getstatic #17 // Field java/lang/System.out:Ljava/io/PrintStream;\n 552: swap\n 553: invokevirtual #23 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 556: iload 9\n 558: iload 10\n 560: if_icmpeq 569\n 563: iinc 9, 1\n 566: goto 475\n 569: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #81 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
rajatenzyme__Coding-Journey__65a0570/Algo_Ds_Notes-master/Algo_Ds_Notes-master/Knuth_Morris_Pratt_Algorithm/KMP.kt
/* <NAME> String Searching Algorithm Given a text txt[0..n-1] and a pattern pat[0..m-1], the algo will find all occurrences of pat[] in txt[] */ import java.util.* internal class KMP { fun kmpSearch(pat: String, txt: String) { val m = pat.length val n = txt.length // longest_prefix_suffix array val lps = IntArray(m) // index for pat[] var j = 0 //calculate lps[] array computeLPSArray(pat, m, lps) //index for txt[] var i = 0 while (i < n) { if (pat[j] == txt[i]) { j++ i++ } if (j == m) { println("Found pattern at index" + (i - j)) j = lps[j - 1] } else if (i < n && pat[j] != txt[i]) { if (j != 0) j = lps[j - 1] else i += 1 } } } // length of the previous longest prefix suffix private fun computeLPSArray(pat: String, M: Int, lps: IntArray) { var len = 0 var i = 1 //lps[0] is always 0 lps[0] = 0 //calculate lps[i] for i=1 to M-1 while (i < M) { if (pat[i] == pat[len]) { len++ lps[i] = len i++ } else { if (len != 0) len = lps[len - 1] else { lps[i] = len i++ } } } } companion object { //Driver program to test above function @JvmStatic fun main(args: Array<String>) { val sc = Scanner(System.`in`) val txt = sc.nextLine() val pat = sc.nextLine() KMP().kmpSearch(pat, txt) } } } /* Sample Input namanchamanbomanamansanam aman Sample Output: Patterns occur at shift = 1 Patterns occur at shift = 7 Patterns occur at shift = 16 */
[ { "class_path": "rajatenzyme__Coding-Journey__65a0570/KMP.class", "javap": "Compiled from \"KMP.kt\"\npublic final class KMP {\n public static final KMP$Companion Companion;\n\n public KMP();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final void kmpSearch(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String pat\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #23 // String txt\n 9: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_1\n 13: invokevirtual #29 // Method java/lang/String.length:()I\n 16: istore_3\n 17: aload_2\n 18: invokevirtual #29 // Method java/lang/String.length:()I\n 21: istore 4\n 23: iload_3\n 24: newarray int\n 26: astore 5\n 28: iconst_0\n 29: istore 6\n 31: aload_0\n 32: aload_1\n 33: iload_3\n 34: aload 5\n 36: invokespecial #33 // Method computeLPSArray:(Ljava/lang/String;I[I)V\n 39: iconst_0\n 40: istore 7\n 42: iload 7\n 44: iload 4\n 46: if_icmpge 163\n 49: aload_1\n 50: iload 6\n 52: invokevirtual #37 // Method java/lang/String.charAt:(I)C\n 55: aload_2\n 56: iload 7\n 58: invokevirtual #37 // Method java/lang/String.charAt:(I)C\n 61: if_icmpne 70\n 64: iinc 6, 1\n 67: iinc 7, 1\n 70: iload 6\n 72: iload_3\n 73: if_icmpne 118\n 76: new #39 // class java/lang/StringBuilder\n 79: dup\n 80: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 83: ldc #42 // String Found pattern at index\n 85: invokevirtual #46 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 88: iload 7\n 90: iload 6\n 92: isub\n 93: invokevirtual #49 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 96: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 99: getstatic #59 // Field java/lang/System.out:Ljava/io/PrintStream;\n 102: swap\n 103: invokevirtual #65 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 106: aload 5\n 108: iload 6\n 110: iconst_1\n 111: isub\n 112: iaload\n 113: istore 6\n 115: goto 42\n 118: iload 7\n 120: iload 4\n 122: if_icmpge 42\n 125: aload_1\n 126: iload 6\n 128: invokevirtual #37 // Method java/lang/String.charAt:(I)C\n 131: aload_2\n 132: iload 7\n 134: invokevirtual #37 // Method java/lang/String.charAt:(I)C\n 137: if_icmpeq 42\n 140: iload 6\n 142: ifeq 157\n 145: aload 5\n 147: iload 6\n 149: iconst_1\n 150: isub\n 151: iaload\n 152: istore 6\n 154: goto 42\n 157: iinc 7, 1\n 160: goto 42\n 163: return\n\n private final void computeLPSArray(java.lang.String, int, int[]);\n Code:\n 0: iconst_0\n 1: istore 4\n 3: iconst_1\n 4: istore 5\n 6: aload_3\n 7: iconst_0\n 8: iconst_0\n 9: iastore\n 10: iload 5\n 12: iload_2\n 13: if_icmpge 80\n 16: aload_1\n 17: iload 5\n 19: invokevirtual #37 // Method java/lang/String.charAt:(I)C\n 22: aload_1\n 23: iload 4\n 25: invokevirtual #37 // Method java/lang/String.charAt:(I)C\n 28: if_icmpne 49\n 31: iinc 4, 1\n 34: aload_3\n 35: iload 5\n 37: iload 4\n 39: iastore\n 40: iload 5\n 42: iinc 5, 1\n 45: pop\n 46: goto 10\n 49: iload 4\n 51: ifeq 65\n 54: aload_3\n 55: iload 4\n 57: iconst_1\n 58: isub\n 59: iaload\n 60: istore 4\n 62: goto 10\n 65: aload_3\n 66: iload 5\n 68: iload 4\n 70: iastore\n 71: iload 5\n 73: iinc 5, 1\n 76: pop\n 77: goto 10\n 80: return\n\n public static final void main(java.lang.String[]);\n Code:\n 0: getstatic #83 // Field Companion:LKMP$Companion;\n 3: aload_0\n 4: invokevirtual #87 // Method KMP$Companion.main:([Ljava/lang/String;)V\n 7: return\n\n static {};\n Code:\n 0: new #85 // class KMP$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #93 // Method KMP$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #83 // Field Companion:LKMP$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "rajatenzyme__Coding-Journey__65a0570/KMP$Companion.class", "javap": "Compiled from \"KMP.kt\"\npublic final class KMP$Companion {\n private KMP$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final void main(java.lang.String[]);\n Code:\n 0: aload_1\n 1: ldc #16 // String args\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #24 // class java/util/Scanner\n 9: dup\n 10: getstatic #30 // Field java/lang/System.in:Ljava/io/InputStream;\n 13: invokespecial #33 // Method java/util/Scanner.\"<init>\":(Ljava/io/InputStream;)V\n 16: astore_2\n 17: aload_2\n 18: invokevirtual #37 // Method java/util/Scanner.nextLine:()Ljava/lang/String;\n 21: astore_3\n 22: aload_2\n 23: invokevirtual #37 // Method java/util/Scanner.nextLine:()Ljava/lang/String;\n 26: astore 4\n 28: new #39 // class KMP\n 31: dup\n 32: invokespecial #40 // Method KMP.\"<init>\":()V\n 35: aload 4\n 37: invokestatic #44 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 40: aload 4\n 42: aload_3\n 43: invokestatic #44 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 46: aload_3\n 47: invokevirtual #48 // Method KMP.kmpSearch:(Ljava/lang/String;Ljava/lang/String;)V\n 50: return\n\n public KMP$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #56 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" } ]
rajatenzyme__Coding-Journey__65a0570/Algo_Ds_Notes-master/Algo_Ds_Notes-master/Quick_Sort/Quick_Sort.kt
/* QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.It's Best case complexity is n*log(n) & Worst case complexity is n^2. */ //partition array fun quick_sort(A: Array<Int>, p: Int, r: Int) { if (p < r) { var q: Int = partition(A, p, r) quick_sort(A, p, q - 1) quick_sort(A, q + 1, r) } } //assign last value as pivot fun partition(A: Array<Int>, p: Int, r: Int): Int { var x = A[r] var i = p - 1 for (j in p until r) { if (A[j] <= x) { i++ exchange(A, i, j) } } exchange(A, i + 1, r) return i + 1 } //swap fun exchange(A: Array<Int>, i: Int, j: Int) { var temp = A[i] A[i] = A[j] A[j] = temp } fun main(arg: Array<String>) { print("Enter no. of elements :") var n = readLine()!!.toInt() println("Enter elements : ") var A = Array(n, { 0 }) for (i in 0 until n) A[i] = readLine()!!.toInt() quick_sort(A, 0, A.size - 1) println("Sorted array is : ") for (i in 0 until n) print("${A[i]} ") } /*-------OUTPUT-------------- Enter no. of elements :6 Enter elements : 4 8 5 9 2 6 Sorted array is : 2 4 5 6 8 9 */
[ { "class_path": "rajatenzyme__Coding-Journey__65a0570/Quick_SortKt.class", "javap": "Compiled from \"Quick_Sort.kt\"\npublic final class Quick_SortKt {\n public static final void quick_sort(java.lang.Integer[], int, int);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iload_1\n 7: iload_2\n 8: if_icmpge 34\n 11: aload_0\n 12: iload_1\n 13: iload_2\n 14: invokestatic #19 // Method partition:([Ljava/lang/Integer;II)I\n 17: istore_3\n 18: aload_0\n 19: iload_1\n 20: iload_3\n 21: iconst_1\n 22: isub\n 23: invokestatic #21 // Method quick_sort:([Ljava/lang/Integer;II)V\n 26: aload_0\n 27: iload_3\n 28: iconst_1\n 29: iadd\n 30: iload_2\n 31: invokestatic #21 // Method quick_sort:([Ljava/lang/Integer;II)V\n 34: return\n\n public static final int partition(java.lang.Integer[], int, int);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_2\n 8: aaload\n 9: invokevirtual #32 // Method java/lang/Integer.intValue:()I\n 12: istore_3\n 13: iload_1\n 14: iconst_1\n 15: isub\n 16: istore 4\n 18: iload_1\n 19: istore 5\n 21: iload 5\n 23: iload_2\n 24: if_icmpge 55\n 27: aload_0\n 28: iload 5\n 30: aaload\n 31: invokevirtual #32 // Method java/lang/Integer.intValue:()I\n 34: iload_3\n 35: if_icmpgt 49\n 38: iinc 4, 1\n 41: aload_0\n 42: iload 4\n 44: iload 5\n 46: invokestatic #35 // Method exchange:([Ljava/lang/Integer;II)V\n 49: iinc 5, 1\n 52: goto 21\n 55: aload_0\n 56: iload 4\n 58: iconst_1\n 59: iadd\n 60: iload_2\n 61: invokestatic #35 // Method exchange:([Ljava/lang/Integer;II)V\n 64: iload 4\n 66: iconst_1\n 67: iadd\n 68: ireturn\n\n public static final void exchange(java.lang.Integer[], int, int);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_1\n 8: aaload\n 9: invokevirtual #32 // Method java/lang/Integer.intValue:()I\n 12: istore_3\n 13: aload_0\n 14: iload_1\n 15: aload_0\n 16: iload_2\n 17: aaload\n 18: aastore\n 19: aload_0\n 20: iload_2\n 21: iload_3\n 22: invokestatic #42 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 25: aastore\n 26: return\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #47 // String arg\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: ldc #49 // String Enter no. of elements :\n 8: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;\n 11: swap\n 12: invokevirtual #61 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 15: invokestatic #67 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 18: dup\n 19: invokestatic #70 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 22: invokestatic #74 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 25: istore_1\n 26: ldc #76 // String Enter elements :\n 28: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;\n 31: swap\n 32: invokevirtual #79 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 35: iconst_0\n 36: istore_3\n 37: iload_1\n 38: istore 4\n 40: iload 4\n 42: anewarray #28 // class java/lang/Integer\n 45: astore 5\n 47: iload_3\n 48: iload 4\n 50: if_icmpge 71\n 53: iload_3\n 54: istore 6\n 56: aload 5\n 58: iload 6\n 60: iconst_0\n 61: invokestatic #42 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 64: aastore\n 65: iinc 3, 1\n 68: goto 47\n 71: aload 5\n 73: astore_2\n 74: iconst_0\n 75: istore_3\n 76: iload_1\n 77: istore 4\n 79: iload_3\n 80: iload 4\n 82: if_icmpge 107\n 85: aload_2\n 86: iload_3\n 87: invokestatic #67 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 90: dup\n 91: invokestatic #70 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 94: invokestatic #74 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 97: invokestatic #42 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 100: aastore\n 101: iinc 3, 1\n 104: goto 79\n 107: aload_2\n 108: iconst_0\n 109: aload_2\n 110: arraylength\n 111: iconst_1\n 112: isub\n 113: invokestatic #21 // Method quick_sort:([Ljava/lang/Integer;II)V\n 116: ldc #81 // String Sorted array is :\n 118: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;\n 121: swap\n 122: invokevirtual #79 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 125: iconst_0\n 126: istore_3\n 127: iload_1\n 128: istore 4\n 130: iload_3\n 131: iload 4\n 133: if_icmpge 173\n 136: new #83 // class java/lang/StringBuilder\n 139: dup\n 140: invokespecial #87 // Method java/lang/StringBuilder.\"<init>\":()V\n 143: aload_2\n 144: iload_3\n 145: aaload\n 146: invokevirtual #32 // Method java/lang/Integer.intValue:()I\n 149: invokevirtual #91 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 152: ldc #93 // String\n 154: invokevirtual #96 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 157: invokevirtual #99 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 160: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;\n 163: swap\n 164: invokevirtual #61 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 167: iinc 3, 1\n 170: goto 130\n 173: return\n}\n", "javap_err": "" } ]
rajatenzyme__Coding-Journey__65a0570/Algo_Ds_Notes-master/Algo_Ds_Notes-master/Floyd_Warshall_Algorithm/Floyd_Warshall_Algorithm.kt
// version 1.1 object FloydWarshall { fun doCalcs(weights: Array<IntArray>, nVertices: Int) { val dist = Array(nVertices) { DoubleArray(nVertices) { Double.POSITIVE_INFINITY } } for (w in weights) dist[w[0] - 1][w[1] - 1] = w[2].toDouble() val next = Array(nVertices) { IntArray(nVertices) } for (i in 0 until next.size) { for (j in 0 until next.size) { if (i != j) next[i][j] = j + 1 } } for (k in 0 until nVertices) { for (i in 0 until nVertices) { for (j in 0 until nVertices) { if (dist[i][k] + dist[k][j] < dist[i][j]) { dist[i][j] = dist[i][k] + dist[k][j] next[i][j] = next[i][k] } } } } printResult(dist, next) } private fun printResult(dist: Array<DoubleArray>, next: Array<IntArray>) { var u: Int var v: Int var path: String println("pair dist path") for (i in 0 until next.size) { for (j in 0 until next.size) { if (i != j) { u = i + 1 v = j + 1 path = ("%d -> %d %2d %s").format(u, v, dist[i][j].toInt(), u) do { u = next[u - 1][v - 1] path += " -> " + u } while (u != v) println(path) } } } } } fun main(args: Array<String>) { val weights = arrayOf( intArrayOf(1, 3, -2), intArrayOf(2, 1, 4), intArrayOf(2, 3, 3), intArrayOf(3, 4, 2), intArrayOf(4, 2, -1) ) val nVertices = 4 FloydWarshall.doCalcs(weights, nVertices) } /* * Output: * * pair dist path * 1 -> 2 -1 1 -> 3 -> 4 -> 2 * 1 -> 3 -2 1 -> 3 * 1 -> 4 0 1 -> 3 -> 4 * 2 -> 1 4 2 -> 1 * 2 -> 3 2 2 -> 1 -> 3 * 2 -> 4 4 2 -> 1 -> 3 -> 4 * 3 -> 1 5 3 -> 4 -> 2 -> 1 * 3 -> 2 1 3 -> 4 -> 2 * 3 -> 4 2 3 -> 4 * 4 -> 1 3 4 -> 2 -> 1 * 4 -> 2 -1 4 -> 2 * 4 -> 3 1 4 -> 2 -> 1 -> 3 * */
[ { "class_path": "rajatenzyme__Coding-Journey__65a0570/Floyd_Warshall_AlgorithmKt.class", "javap": "Compiled from \"Floyd_Warshall_Algorithm.kt\"\npublic final class Floyd_Warshall_AlgorithmKt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_5\n 7: anewarray #17 // class \"[I\"\n 10: astore_2\n 11: aload_2\n 12: iconst_0\n 13: iconst_3\n 14: newarray int\n 16: astore_3\n 17: aload_3\n 18: iconst_0\n 19: iconst_1\n 20: iastore\n 21: aload_3\n 22: iconst_1\n 23: iconst_3\n 24: iastore\n 25: aload_3\n 26: iconst_2\n 27: bipush -2\n 29: iastore\n 30: aload_3\n 31: aastore\n 32: aload_2\n 33: iconst_1\n 34: iconst_3\n 35: newarray int\n 37: astore_3\n 38: aload_3\n 39: iconst_0\n 40: iconst_2\n 41: iastore\n 42: aload_3\n 43: iconst_1\n 44: iconst_1\n 45: iastore\n 46: aload_3\n 47: iconst_2\n 48: iconst_4\n 49: iastore\n 50: aload_3\n 51: aastore\n 52: aload_2\n 53: iconst_2\n 54: iconst_3\n 55: newarray int\n 57: astore_3\n 58: aload_3\n 59: iconst_0\n 60: iconst_2\n 61: iastore\n 62: aload_3\n 63: iconst_1\n 64: iconst_3\n 65: iastore\n 66: aload_3\n 67: iconst_2\n 68: iconst_3\n 69: iastore\n 70: aload_3\n 71: aastore\n 72: aload_2\n 73: iconst_3\n 74: iconst_3\n 75: newarray int\n 77: astore_3\n 78: aload_3\n 79: iconst_0\n 80: iconst_3\n 81: iastore\n 82: aload_3\n 83: iconst_1\n 84: iconst_4\n 85: iastore\n 86: aload_3\n 87: iconst_2\n 88: iconst_2\n 89: iastore\n 90: aload_3\n 91: aastore\n 92: aload_2\n 93: iconst_4\n 94: iconst_3\n 95: newarray int\n 97: astore_3\n 98: aload_3\n 99: iconst_0\n 100: iconst_4\n 101: iastore\n 102: aload_3\n 103: iconst_1\n 104: iconst_2\n 105: iastore\n 106: aload_3\n 107: iconst_2\n 108: iconst_m1\n 109: iastore\n 110: aload_3\n 111: aastore\n 112: aload_2\n 113: astore_1\n 114: iconst_4\n 115: istore_2\n 116: getstatic #23 // Field FloydWarshall.INSTANCE:LFloydWarshall;\n 119: aload_1\n 120: iload_2\n 121: invokevirtual #27 // Method FloydWarshall.doCalcs:([[II)V\n 124: return\n}\n", "javap_err": "" } ]
rajatenzyme__Coding-Journey__65a0570/Algo_Ds_Notes-master/Algo_Ds_Notes-master/Fenwick_Tree/Fenwick_Tree.kt
/*Fenwick Tree is used when there is a problem of range sum query with update i.e. RMQ. Suppose you have an array and you have been asked to find sum in range. It can be done in linear time with static array method. If will be difficult for one to do it in linear time when you have point updates. In this update operation is incrementing an index by some value. Brute force approach will take O(n^2) time but Fenwick Tree will take O(nlogn) time */ //Sum function fun sum(ft:Array<Int>, _index:Int):Int{ /* Argument ft : Fenwick Tree index : Index upto which you want to find prefix sum Initialize the result "s" then increment the value of index "index". Returns : sum of given arr[0..index]. This function assumes that the array is preprocessed and partial sums of array elements are stored in ft[]. */ // Initialize sum variable to 0 var s:Int = 0 // Increment index var index = _index + 1 while (index > 0){ // Adding tree node to sum s += ft[index] // Update tree node index -= index and (-index) } // Return total sum return s } // Update function fun update(ft:Array<Int>,size:Int,_index:Int,value:Int){ /* Arguments ft : Fenwick Tree index : Index of ft to be updated size : Length of the original array val : Add val to the index "index" Traverse all ancestors and add 'val'. Add 'val' to current node of Fenwick Tree. Update index to that of parent in update. */ var index = _index + 1 while (index <= size) { // Update tree node value ft[index] += value // Update node index index += index and (-index) } } // Construct function fun construct(array:Array<Int>, size:Int):Array<Int>{ /* Argument arr : The original array size : The length of the given array This function will construct the Fenwick Tree from the given array of length "size" Return : Fenwick Tree array ft[] */ // Init ft array of length size+1 with zero value initially var ft = Array(size+1,{0}) // Constructing Fenwick Tree by Update operation for (i in 0 until size){ // Update operation update(ft,size,i,array[i]) } // Return Fenwick Tree array return ft } fun main(){ /* INPUT ------- arr : [2, 1, 1, 3, 2, 3, 4, 5, 6, 7, 8, 9] Print sum of freq[0...5] Update position 4 by adding 16 Print sum of freq[2....7] after update Update position 5 by adding 10 Print sum of freq[2....7] after update OUTPUT ------ 12 33 43 */ // Given array var list = arrayOf(2, 1, 1, 3, 2, 3, 4, 5, 6, 7, 8, 9) // Build Fenwick Tree var ft = construct(list,list.size) // Print Sum of array from index = 0 to index = 5 println(sum(ft,5)) // Increment list[4] by 16 update(ft,list.size,4,16) // Print sum from index = 2 to index = 7 println(sum(ft,7) - sum(ft,2)) // Increment list[5] by 10 update(ft,list.size,5,10) // Print sum from index = 2 to index = 7 println(sum(ft,7) - sum(ft,2)) }
[ { "class_path": "rajatenzyme__Coding-Journey__65a0570/Fenwick_TreeKt.class", "javap": "Compiled from \"Fenwick_Tree.kt\"\npublic final class Fenwick_TreeKt {\n public static final int sum(java.lang.Integer[], int);\n Code:\n 0: aload_0\n 1: ldc #9 // String ft\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_0\n 7: istore_2\n 8: iload_1\n 9: iconst_1\n 10: iadd\n 11: istore_3\n 12: iload_3\n 13: ifle 35\n 16: iload_2\n 17: aload_0\n 18: iload_3\n 19: aaload\n 20: invokevirtual #21 // Method java/lang/Integer.intValue:()I\n 23: iadd\n 24: istore_2\n 25: iload_3\n 26: iload_3\n 27: iload_3\n 28: ineg\n 29: iand\n 30: isub\n 31: istore_3\n 32: goto 12\n 35: iload_2\n 36: ireturn\n\n public static final void update(java.lang.Integer[], int, int, int);\n Code:\n 0: aload_0\n 1: ldc #9 // String ft\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iload_2\n 7: iconst_1\n 8: iadd\n 9: istore 4\n 11: iload 4\n 13: iload_1\n 14: if_icmpgt 51\n 17: iload 4\n 19: istore 5\n 21: aload_0\n 22: iload 5\n 24: aload_0\n 25: iload 5\n 27: aaload\n 28: invokevirtual #21 // Method java/lang/Integer.intValue:()I\n 31: iload_3\n 32: iadd\n 33: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 36: aastore\n 37: iload 4\n 39: iload 4\n 41: iload 4\n 43: ineg\n 44: iand\n 45: iadd\n 46: istore 4\n 48: goto 11\n 51: return\n\n public static final java.lang.Integer[] construct(java.lang.Integer[], int);\n Code:\n 0: aload_0\n 1: ldc #38 // String array\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_0\n 7: istore_3\n 8: iload_1\n 9: iconst_1\n 10: iadd\n 11: istore 4\n 13: iload 4\n 15: anewarray #17 // class java/lang/Integer\n 18: astore 5\n 20: iload_3\n 21: iload 4\n 23: if_icmpge 44\n 26: iload_3\n 27: istore 6\n 29: aload 5\n 31: iload 6\n 33: iconst_0\n 34: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 37: aastore\n 38: iinc 3, 1\n 41: goto 20\n 44: aload 5\n 46: astore_2\n 47: iconst_0\n 48: istore_3\n 49: iload_3\n 50: iload_1\n 51: if_icmpge 72\n 54: aload_2\n 55: iload_1\n 56: iload_3\n 57: aload_0\n 58: iload_3\n 59: aaload\n 60: invokevirtual #21 // Method java/lang/Integer.intValue:()I\n 63: invokestatic #40 // Method update:([Ljava/lang/Integer;III)V\n 66: iinc 3, 1\n 69: goto 49\n 72: aload_2\n 73: areturn\n\n public static final void main();\n Code:\n 0: bipush 12\n 2: anewarray #17 // class java/lang/Integer\n 5: astore_1\n 6: aload_1\n 7: iconst_0\n 8: iconst_2\n 9: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 12: aastore\n 13: aload_1\n 14: iconst_1\n 15: iconst_1\n 16: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 19: aastore\n 20: aload_1\n 21: iconst_2\n 22: iconst_1\n 23: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 26: aastore\n 27: aload_1\n 28: iconst_3\n 29: iconst_3\n 30: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 33: aastore\n 34: aload_1\n 35: iconst_4\n 36: iconst_2\n 37: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 40: aastore\n 41: aload_1\n 42: iconst_5\n 43: iconst_3\n 44: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 47: aastore\n 48: aload_1\n 49: bipush 6\n 51: iconst_4\n 52: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 55: aastore\n 56: aload_1\n 57: bipush 7\n 59: iconst_5\n 60: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 63: aastore\n 64: aload_1\n 65: bipush 8\n 67: bipush 6\n 69: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 72: aastore\n 73: aload_1\n 74: bipush 9\n 76: bipush 7\n 78: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 81: aastore\n 82: aload_1\n 83: bipush 10\n 85: bipush 8\n 87: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 90: aastore\n 91: aload_1\n 92: bipush 11\n 94: bipush 9\n 96: invokestatic #32 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 99: aastore\n 100: aload_1\n 101: astore_0\n 102: aload_0\n 103: aload_0\n 104: arraylength\n 105: invokestatic #46 // Method construct:([Ljava/lang/Integer;I)[Ljava/lang/Integer;\n 108: astore_1\n 109: aload_1\n 110: iconst_5\n 111: invokestatic #48 // Method sum:([Ljava/lang/Integer;I)I\n 114: istore_2\n 115: getstatic #54 // Field java/lang/System.out:Ljava/io/PrintStream;\n 118: iload_2\n 119: invokevirtual #60 // Method java/io/PrintStream.println:(I)V\n 122: aload_1\n 123: aload_0\n 124: arraylength\n 125: iconst_4\n 126: bipush 16\n 128: invokestatic #40 // Method update:([Ljava/lang/Integer;III)V\n 131: aload_1\n 132: bipush 7\n 134: invokestatic #48 // Method sum:([Ljava/lang/Integer;I)I\n 137: aload_1\n 138: iconst_2\n 139: invokestatic #48 // Method sum:([Ljava/lang/Integer;I)I\n 142: isub\n 143: istore_2\n 144: getstatic #54 // Field java/lang/System.out:Ljava/io/PrintStream;\n 147: iload_2\n 148: invokevirtual #60 // Method java/io/PrintStream.println:(I)V\n 151: aload_1\n 152: aload_0\n 153: arraylength\n 154: iconst_5\n 155: bipush 10\n 157: invokestatic #40 // Method update:([Ljava/lang/Integer;III)V\n 160: aload_1\n 161: bipush 7\n 163: invokestatic #48 // Method sum:([Ljava/lang/Integer;I)I\n 166: aload_1\n 167: iconst_2\n 168: invokestatic #48 // Method sum:([Ljava/lang/Integer;I)I\n 171: isub\n 172: istore_2\n 173: getstatic #54 // Field java/lang/System.out:Ljava/io/PrintStream;\n 176: iload_2\n 177: invokevirtual #60 // Method java/io/PrintStream.println:(I)V\n 180: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #64 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day9.kt
import Direction.D import Direction.L import Direction.R import Direction.U import java.io.File import kotlin.math.abs import kotlin.math.max import kotlin.math.sign fun main() { val result = File("inputs/day_9.txt").useLines { tailPositions(it, 9) } println(result) } fun tailPositions(lines: Sequence<String>, tailLength: Int = 1) = max(lines.fold(listOf(Position(t = (0..tailLength).map { Point(0, 0) }))) { acc, line -> acc + moves(Move.parse(line), acc.last(), tailLength) } .distinctBy { it.t[tailLength - 1] } .count(), 1) data class Point(val x: Int, val y: Int) { operator fun plus(other: Point) = Point(x + other.x, y + other.y) fun diff(other: Point) = Point(other.x - x, other.y - y) fun follow(diff: Point) = when { max(abs(diff.x), abs(diff.y)) <= 1 -> this else -> copy(x = x + diff.x.sign, y = y + diff.y.sign) } } fun moves(move: Move, current: Position, tailLength: Int) = (1..move.steps).fold(listOf(current)) { positions, _ -> val previousPos = positions.last() val h = previousPos.h + next(move.direction) val t = (0 until tailLength).fold(listOf(previousPos.t[0].follow(previousPos.t[0].diff(h)))) { acc, i -> acc + previousPos.t[i + 1].follow(previousPos.t[i + 1].diff(acc.last())) } positions + Position(h, t) } fun next(direction: Direction) = when (direction) { R -> Point(0, 1) U -> Point(-1, 0) L -> Point(0, -1) D -> Point(1, 0) } data class Position(val h: Point = Point(0, 0), val t: List<Point>) data class Move(val direction: Direction, val steps: Int) { companion object { fun parse(line: String) = Move(toDirection(line), line.split(" ")[1].toInt()) private fun toDirection(line: String) = when (line.split(" ")[0]) { "R" -> R "U" -> U "L" -> L "D" -> D else -> throw IllegalArgumentException() } } } enum class Direction { R, U, L, D }
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day9Kt.class", "javap": "Compiled from \"Day9.kt\"\npublic final class Day9Kt {\n public static final void main();\n Code:\n 0: new #10 // class java/io/File\n 3: dup\n 4: ldc #12 // String inputs/day_9.txt\n 6: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: astore_1\n 10: getstatic #22 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_1\n 17: astore 4\n 19: sipush 8192\n 22: istore 5\n 24: aload 4\n 26: astore 6\n 28: new #24 // class java/io/InputStreamReader\n 31: dup\n 32: new #26 // class java/io/FileInputStream\n 35: dup\n 36: aload 6\n 38: invokespecial #29 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 41: checkcast #31 // class java/io/InputStream\n 44: aload_2\n 45: invokespecial #34 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 48: checkcast #36 // class java/io/Reader\n 51: astore 6\n 53: aload 6\n 55: instanceof #38 // class java/io/BufferedReader\n 58: ifeq 69\n 61: aload 6\n 63: checkcast #38 // class java/io/BufferedReader\n 66: goto 80\n 69: new #38 // class java/io/BufferedReader\n 72: dup\n 73: aload 6\n 75: iload 5\n 77: invokespecial #41 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 80: checkcast #43 // class java/io/Closeable\n 83: astore 4\n 85: aconst_null\n 86: astore 5\n 88: nop\n 89: aload 4\n 91: checkcast #38 // class java/io/BufferedReader\n 94: astore 6\n 96: iconst_0\n 97: istore 7\n 99: aload 6\n 101: invokestatic #49 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;\n 104: astore 8\n 106: iconst_0\n 107: istore 9\n 109: aload 8\n 111: bipush 9\n 113: invokestatic #53 // Method tailPositions:(Lkotlin/sequences/Sequence;I)I\n 116: istore 6\n 118: aload 4\n 120: aload 5\n 122: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 125: iload 6\n 127: goto 151\n 130: astore 7\n 132: aload 7\n 134: astore 5\n 136: aload 7\n 138: athrow\n 139: astore 7\n 141: aload 4\n 143: aload 5\n 145: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 148: aload 7\n 150: athrow\n 151: nop\n 152: istore_0\n 153: getstatic #65 // Field java/lang/System.out:Ljava/io/PrintStream;\n 156: iload_0\n 157: invokevirtual #71 // Method java/io/PrintStream.println:(I)V\n 160: return\n Exception table:\n from to target type\n 88 118 130 Class java/lang/Throwable\n 88 118 139 any\n 130 139 139 any\n 139 141 139 any\n\n public static final int tailPositions(kotlin.sequences.Sequence<java.lang.String>, int);\n Code:\n 0: aload_0\n 1: ldc #91 // String lines\n 3: invokestatic #97 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_2\n 8: aconst_null\n 9: new #99 // class kotlin/ranges/IntRange\n 12: dup\n 13: iconst_0\n 14: iload_1\n 15: invokespecial #102 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 18: checkcast #104 // class java/lang/Iterable\n 21: astore_3\n 22: astore 12\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #106 // class java/util/ArrayList\n 33: dup\n 34: aload_3\n 35: bipush 10\n 37: invokestatic #112 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 40: invokespecial #114 // Method java/util/ArrayList.\"<init>\":(I)V\n 43: checkcast #116 // class java/util/Collection\n 46: astore 6\n 48: iconst_0\n 49: istore 7\n 51: aload 5\n 53: invokeinterface #120, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 58: astore 8\n 60: aload 8\n 62: invokeinterface #126, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 67: ifeq 112\n 70: aload 8\n 72: checkcast #128 // class kotlin/collections/IntIterator\n 75: invokevirtual #132 // Method kotlin/collections/IntIterator.nextInt:()I\n 78: istore 9\n 80: aload 6\n 82: iload 9\n 84: istore 10\n 86: astore 13\n 88: iconst_0\n 89: istore 11\n 91: new #134 // class Point\n 94: dup\n 95: iconst_0\n 96: iconst_0\n 97: invokespecial #135 // Method Point.\"<init>\":(II)V\n 100: aload 13\n 102: swap\n 103: invokeinterface #139, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 108: pop\n 109: goto 60\n 112: aload 6\n 114: checkcast #141 // class java/util/List\n 117: nop\n 118: aload 12\n 120: swap\n 121: iconst_1\n 122: aconst_null\n 123: astore 14\n 125: istore 15\n 127: astore 16\n 129: astore 17\n 131: new #143 // class Position\n 134: dup\n 135: aload 17\n 137: aload 16\n 139: iload 15\n 141: aload 14\n 143: invokespecial #146 // Method Position.\"<init>\":(LPoint;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 146: invokestatic #150 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 149: astore_3\n 150: iconst_0\n 151: istore 4\n 153: aload_3\n 154: astore 5\n 156: aload_2\n 157: invokeinterface #151, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 162: astore 6\n 164: aload 6\n 166: invokeinterface #126, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 171: ifeq 233\n 174: aload 6\n 176: invokeinterface #155, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 181: astore 7\n 183: aload 5\n 185: aload 7\n 187: checkcast #157 // class java/lang/String\n 190: astore 8\n 192: astore 9\n 194: iconst_0\n 195: istore 10\n 197: aload 9\n 199: checkcast #116 // class java/util/Collection\n 202: getstatic #163 // Field Move.Companion:LMove$Companion;\n 205: aload 8\n 207: invokevirtual #169 // Method Move$Companion.parse:(Ljava/lang/String;)LMove;\n 210: aload 9\n 212: invokestatic #173 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 215: checkcast #143 // class Position\n 218: iload_1\n 219: invokestatic #177 // Method moves:(LMove;LPosition;I)Ljava/util/List;\n 222: checkcast #104 // class java/lang/Iterable\n 225: invokestatic #181 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 228: astore 5\n 230: goto 164\n 233: aload 5\n 235: checkcast #104 // class java/lang/Iterable\n 238: astore_2\n 239: nop\n 240: iconst_0\n 241: istore_3\n 242: new #183 // class java/util/HashSet\n 245: dup\n 246: invokespecial #185 // Method java/util/HashSet.\"<init>\":()V\n 249: astore 4\n 251: new #106 // class java/util/ArrayList\n 254: dup\n 255: invokespecial #186 // Method java/util/ArrayList.\"<init>\":()V\n 258: astore 5\n 260: aload_2\n 261: invokeinterface #120, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 266: astore 6\n 268: aload 6\n 270: invokeinterface #126, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 275: ifeq 336\n 278: aload 6\n 280: invokeinterface #155, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 285: astore 7\n 287: aload 7\n 289: checkcast #143 // class Position\n 292: astore 8\n 294: iconst_0\n 295: istore 9\n 297: aload 8\n 299: invokevirtual #190 // Method Position.getT:()Ljava/util/List;\n 302: iload_1\n 303: iconst_1\n 304: isub\n 305: invokeinterface #194, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 310: checkcast #134 // class Point\n 313: astore 8\n 315: aload 4\n 317: aload 8\n 319: invokevirtual #195 // Method java/util/HashSet.add:(Ljava/lang/Object;)Z\n 322: ifeq 268\n 325: aload 5\n 327: aload 7\n 329: invokevirtual #196 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 332: pop\n 333: goto 268\n 336: aload 5\n 338: checkcast #141 // class java/util/List\n 341: checkcast #116 // class java/util/Collection\n 344: invokeinterface #199, 1 // InterfaceMethod java/util/Collection.size:()I\n 349: istore_2\n 350: iconst_1\n 351: istore_3\n 352: iload_2\n 353: iload_3\n 354: invokestatic #205 // Method java/lang/Math.max:(II)I\n 357: ireturn\n\n public static int tailPositions$default(kotlin.sequences.Sequence, int, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_2\n 2: iand\n 3: ifeq 8\n 6: iconst_1\n 7: istore_1\n 8: aload_0\n 9: iload_1\n 10: invokestatic #53 // Method tailPositions:(Lkotlin/sequences/Sequence;I)I\n 13: ireturn\n\n public static final java.util.List<Position> moves(Move, Position, int);\n Code:\n 0: aload_0\n 1: ldc #241 // String move\n 3: invokestatic #97 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #243 // String current\n 9: invokestatic #97 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #99 // class kotlin/ranges/IntRange\n 15: dup\n 16: iconst_1\n 17: aload_0\n 18: invokevirtual #246 // Method Move.getSteps:()I\n 21: invokespecial #102 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 24: checkcast #104 // class java/lang/Iterable\n 27: astore_3\n 28: aload_1\n 29: invokestatic #150 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 32: astore 4\n 34: iconst_0\n 35: istore 5\n 37: aload 4\n 39: astore 6\n 41: aload_3\n 42: invokeinterface #120, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 47: astore 7\n 49: aload 7\n 51: invokeinterface #126, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 56: ifeq 290\n 59: aload 7\n 61: checkcast #128 // class kotlin/collections/IntIterator\n 64: invokevirtual #132 // Method kotlin/collections/IntIterator.nextInt:()I\n 67: istore 8\n 69: aload 6\n 71: astore 9\n 73: iconst_0\n 74: istore 10\n 76: aload 9\n 78: invokestatic #173 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 81: checkcast #143 // class Position\n 84: astore 11\n 86: aload 11\n 88: invokevirtual #250 // Method Position.getH:()LPoint;\n 91: aload_0\n 92: invokevirtual #254 // Method Move.getDirection:()LDirection;\n 95: invokestatic #257 // Method next:(LDirection;)LPoint;\n 98: invokevirtual #260 // Method Point.plus:(LPoint;)LPoint;\n 101: astore 12\n 103: iconst_0\n 104: iload_2\n 105: invokestatic #266 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 108: checkcast #104 // class java/lang/Iterable\n 111: astore 13\n 113: aload 11\n 115: invokevirtual #190 // Method Position.getT:()Ljava/util/List;\n 118: iconst_0\n 119: invokeinterface #194, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 124: checkcast #134 // class Point\n 127: aload 11\n 129: invokevirtual #190 // Method Position.getT:()Ljava/util/List;\n 132: iconst_0\n 133: invokeinterface #194, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 138: checkcast #134 // class Point\n 141: aload 12\n 143: invokevirtual #269 // Method Point.diff:(LPoint;)LPoint;\n 146: invokevirtual #272 // Method Point.follow:(LPoint;)LPoint;\n 149: invokestatic #150 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 152: astore 14\n 154: iconst_0\n 155: istore 15\n 157: aload 14\n 159: astore 16\n 161: aload 13\n 163: invokeinterface #120, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 168: astore 17\n 170: aload 17\n 172: invokeinterface #126, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 177: ifeq 262\n 180: aload 17\n 182: checkcast #128 // class kotlin/collections/IntIterator\n 185: invokevirtual #132 // Method kotlin/collections/IntIterator.nextInt:()I\n 188: istore 18\n 190: aload 16\n 192: iload 18\n 194: istore 19\n 196: astore 20\n 198: iconst_0\n 199: istore 21\n 201: aload 20\n 203: checkcast #116 // class java/util/Collection\n 206: aload 11\n 208: invokevirtual #190 // Method Position.getT:()Ljava/util/List;\n 211: iload 19\n 213: iconst_1\n 214: iadd\n 215: invokeinterface #194, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 220: checkcast #134 // class Point\n 223: aload 11\n 225: invokevirtual #190 // Method Position.getT:()Ljava/util/List;\n 228: iload 19\n 230: iconst_1\n 231: iadd\n 232: invokeinterface #194, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 237: checkcast #134 // class Point\n 240: aload 20\n 242: invokestatic #173 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 245: checkcast #134 // class Point\n 248: invokevirtual #269 // Method Point.diff:(LPoint;)LPoint;\n 251: invokevirtual #272 // Method Point.follow:(LPoint;)LPoint;\n 254: invokestatic #275 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;\n 257: astore 16\n 259: goto 170\n 262: aload 16\n 264: astore 22\n 266: aload 9\n 268: checkcast #116 // class java/util/Collection\n 271: new #143 // class Position\n 274: dup\n 275: aload 12\n 277: aload 22\n 279: invokespecial #278 // Method Position.\"<init>\":(LPoint;Ljava/util/List;)V\n 282: invokestatic #275 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;\n 285: astore 6\n 287: goto 49\n 290: aload 6\n 292: areturn\n\n public static final Point next(Direction);\n Code:\n 0: aload_0\n 1: ldc_w #289 // String direction\n 4: invokestatic #97 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: getstatic #295 // Field Day9Kt$WhenMappings.$EnumSwitchMapping$0:[I\n 11: swap\n 12: invokevirtual #300 // Method Direction.ordinal:()I\n 15: iaload\n 16: tableswitch { // 1 to 4\n 1: 48\n 2: 60\n 3: 72\n 4: 84\n default: 96\n }\n 48: new #134 // class Point\n 51: dup\n 52: iconst_0\n 53: iconst_1\n 54: invokespecial #135 // Method Point.\"<init>\":(II)V\n 57: goto 104\n 60: new #134 // class Point\n 63: dup\n 64: iconst_m1\n 65: iconst_0\n 66: invokespecial #135 // Method Point.\"<init>\":(II)V\n 69: goto 104\n 72: new #134 // class Point\n 75: dup\n 76: iconst_0\n 77: iconst_m1\n 78: invokespecial #135 // Method Point.\"<init>\":(II)V\n 81: goto 104\n 84: new #134 // class Point\n 87: dup\n 88: iconst_1\n 89: iconst_0\n 90: invokespecial #135 // Method Point.\"<init>\":(II)V\n 93: goto 104\n 96: new #302 // class kotlin/NoWhenBranchMatchedException\n 99: dup\n 100: invokespecial #303 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 103: athrow\n 104: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #307 // Method main:()V\n 3: return\n}\n", "javap_err": "" }, { "class_path": "amitdev__advent_2022__b2cb4ec/Day9Kt$WhenMappings.class", "javap": "Compiled from \"Day9.kt\"\npublic final class Day9Kt$WhenMappings {\n public static final int[] $EnumSwitchMapping$0;\n\n static {};\n Code:\n 0: invokestatic #14 // Method Direction.values:()[LDirection;\n 3: arraylength\n 4: newarray int\n 6: astore_0\n 7: nop\n 8: aload_0\n 9: getstatic #18 // Field Direction.R:LDirection;\n 12: invokevirtual #22 // Method Direction.ordinal:()I\n 15: iconst_1\n 16: iastore\n 17: goto 21\n 20: astore_1\n 21: nop\n 22: aload_0\n 23: getstatic #25 // Field Direction.U:LDirection;\n 26: invokevirtual #22 // Method Direction.ordinal:()I\n 29: iconst_2\n 30: iastore\n 31: goto 35\n 34: astore_1\n 35: nop\n 36: aload_0\n 37: getstatic #28 // Field Direction.L:LDirection;\n 40: invokevirtual #22 // Method Direction.ordinal:()I\n 43: iconst_3\n 44: iastore\n 45: goto 49\n 48: astore_1\n 49: nop\n 50: aload_0\n 51: getstatic #31 // Field Direction.D:LDirection;\n 54: invokevirtual #22 // Method Direction.ordinal:()I\n 57: iconst_4\n 58: iastore\n 59: goto 63\n 62: astore_1\n 63: aload_0\n 64: putstatic #35 // Field $EnumSwitchMapping$0:[I\n 67: return\n Exception table:\n from to target type\n 7 17 20 Class java/lang/NoSuchFieldError\n 21 31 34 Class java/lang/NoSuchFieldError\n 35 45 48 Class java/lang/NoSuchFieldError\n 49 59 62 Class java/lang/NoSuchFieldError\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day8.kt
import java.io.File import java.lang.Integer.max fun main() { val result = File("inputs/day_8.txt").useLines { findScenicScore(it) } println(result) } fun findVisible(lines: Sequence<String>) = Grid(lines.map { line -> line.map { it.digitToInt()} }.toList()) .toVisbile() fun findScenicScore(lines: Sequence<String>) = Grid(lines.map { line -> line.map { it.digitToInt()} }.toList()) .score() data class Grid(val data: List<List<Int>>) { fun toVisbile() = data.indices.flatMap { x -> (0 until data[0].size).filter { y -> left(x, y) || right(x, y) || top(x, y) || down(x, y) } }.count() fun score() = data.indices.flatMap { x -> (0 until data[0].size).map { y -> leftScore(x, y) * rightScore(x, y) * topScore(x, y) * downScore(x, y) } }.max() private fun leftScore(x: Int, y: Int) = y - max(data[x].subList(0, y).indexOfLast { it >= data[x][y] }, 0) private fun rightScore(x: Int, y: Int) = data[x].subList(y+1, data[x].size) .indexOfFirst { it >= data[x][y] } .let { if (it == -1) data[x].size-1-y else it + 1 } private fun topScore(x: Int, y: Int) = x - max((0 until x).indexOfLast { data[x][y] <= data[it][y] }, 0) private fun downScore(x: Int, y: Int) = (x+1 until data.size) .indexOfFirst { data[x][y] <= data[it][y] } .let { if (it == -1) data.size-1-x else it + 1 } private fun left(x: Int, y: Int) = data[x].subList(0, y).maxOrZero() < data[x][y] private fun right(x: Int, y: Int) = data[x].subList(y+1, data[x].size).maxOrZero() < data[x][y] private fun top(x: Int, y: Int) = (0 until x).map { data[it][y] }.maxOrZero() < data[x][y] private fun down(x: Int, y: Int) = (x+1 until data.size).map { data[it][y] }.maxOrZero() < data[x][y] fun List<Int>.maxOrZero() = if (this.isEmpty()) -1 else this.max() }
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day8Kt.class", "javap": "Compiled from \"Day8.kt\"\npublic final class Day8Kt {\n public static final void main();\n Code:\n 0: new #10 // class java/io/File\n 3: dup\n 4: ldc #12 // String inputs/day_8.txt\n 6: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: astore_1\n 10: getstatic #22 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_1\n 17: astore 4\n 19: sipush 8192\n 22: istore 5\n 24: aload 4\n 26: astore 6\n 28: new #24 // class java/io/InputStreamReader\n 31: dup\n 32: new #26 // class java/io/FileInputStream\n 35: dup\n 36: aload 6\n 38: invokespecial #29 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 41: checkcast #31 // class java/io/InputStream\n 44: aload_2\n 45: invokespecial #34 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 48: checkcast #36 // class java/io/Reader\n 51: astore 6\n 53: aload 6\n 55: instanceof #38 // class java/io/BufferedReader\n 58: ifeq 69\n 61: aload 6\n 63: checkcast #38 // class java/io/BufferedReader\n 66: goto 80\n 69: new #38 // class java/io/BufferedReader\n 72: dup\n 73: aload 6\n 75: iload 5\n 77: invokespecial #41 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 80: checkcast #43 // class java/io/Closeable\n 83: astore 4\n 85: aconst_null\n 86: astore 5\n 88: nop\n 89: aload 4\n 91: checkcast #38 // class java/io/BufferedReader\n 94: astore 6\n 96: iconst_0\n 97: istore 7\n 99: aload 6\n 101: invokestatic #49 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;\n 104: astore 8\n 106: iconst_0\n 107: istore 9\n 109: aload 8\n 111: invokestatic #53 // Method findScenicScore:(Lkotlin/sequences/Sequence;)I\n 114: istore 6\n 116: aload 4\n 118: aload 5\n 120: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 123: iload 6\n 125: goto 149\n 128: astore 7\n 130: aload 7\n 132: astore 5\n 134: aload 7\n 136: athrow\n 137: astore 7\n 139: aload 4\n 141: aload 5\n 143: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 146: aload 7\n 148: athrow\n 149: nop\n 150: istore_0\n 151: getstatic #65 // Field java/lang/System.out:Ljava/io/PrintStream;\n 154: iload_0\n 155: invokevirtual #71 // Method java/io/PrintStream.println:(I)V\n 158: return\n Exception table:\n from to target type\n 88 116 128 Class java/lang/Throwable\n 88 116 137 any\n 128 137 137 any\n 137 139 137 any\n\n public static final int findVisible(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #92 // String lines\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #100 // class Grid\n 9: dup\n 10: aload_0\n 11: invokedynamic #119, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 16: invokestatic #125 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 19: invokestatic #129 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;\n 22: invokespecial #132 // Method Grid.\"<init>\":(Ljava/util/List;)V\n 25: invokevirtual #136 // Method Grid.toVisbile:()I\n 28: ireturn\n\n public static final int findScenicScore(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #92 // String lines\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #100 // class Grid\n 9: dup\n 10: aload_0\n 11: invokedynamic #141, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 16: invokestatic #125 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 19: invokestatic #129 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;\n 22: invokespecial #132 // Method Grid.\"<init>\":(Ljava/util/List;)V\n 25: invokevirtual #144 // Method Grid.score:()I\n 28: ireturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #147 // Method main:()V\n 3: return\n\n private static final java.util.List findVisible$lambda$2(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #151 // String line\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #153 // class java/lang/CharSequence\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: astore_3\n 15: new #155 // class java/util/ArrayList\n 18: dup\n 19: aload_1\n 20: invokeinterface #158, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 25: invokespecial #160 // Method java/util/ArrayList.\"<init>\":(I)V\n 28: checkcast #162 // class java/util/Collection\n 31: astore 4\n 33: iconst_0\n 34: istore 5\n 36: iconst_0\n 37: istore 6\n 39: iload 6\n 41: aload_3\n 42: invokeinterface #158, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 47: if_icmpge 94\n 50: aload_3\n 51: iload 6\n 53: invokeinterface #166, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 58: istore 7\n 60: aload 4\n 62: iload 7\n 64: istore 8\n 66: astore 10\n 68: iconst_0\n 69: istore 9\n 71: iload 8\n 73: invokestatic #172 // Method kotlin/text/CharsKt.digitToInt:(C)I\n 76: invokestatic #178 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 79: aload 10\n 81: swap\n 82: invokeinterface #182, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 87: pop\n 88: iinc 6, 1\n 91: goto 39\n 94: aload 4\n 96: checkcast #184 // class java/util/List\n 99: nop\n 100: areturn\n\n private static final java.util.List findScenicScore$lambda$4(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #151 // String line\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #153 // class java/lang/CharSequence\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: astore_3\n 15: new #155 // class java/util/ArrayList\n 18: dup\n 19: aload_1\n 20: invokeinterface #158, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 25: invokespecial #160 // Method java/util/ArrayList.\"<init>\":(I)V\n 28: checkcast #162 // class java/util/Collection\n 31: astore 4\n 33: iconst_0\n 34: istore 5\n 36: iconst_0\n 37: istore 6\n 39: iload 6\n 41: aload_3\n 42: invokeinterface #158, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 47: if_icmpge 94\n 50: aload_3\n 51: iload 6\n 53: invokeinterface #166, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 58: istore 7\n 60: aload 4\n 62: iload 7\n 64: istore 8\n 66: astore 10\n 68: iconst_0\n 69: istore 9\n 71: iload 8\n 73: invokestatic #172 // Method kotlin/text/CharsKt.digitToInt:(C)I\n 76: invokestatic #178 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 79: aload 10\n 81: swap\n 82: invokeinterface #182, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 87: pop\n 88: iinc 6, 1\n 91: goto 39\n 94: aload 4\n 96: checkcast #184 // class java/util/List\n 99: nop\n 100: areturn\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day2.kt
import RPS.PAPER import RPS.ROCK import RPS.SCISSORS import java.io.File import kotlin.IllegalArgumentException fun main() { val result = File("inputs/day_2.txt").useLines { computeScorePart2(it) } println(result) } // Part 1 fun computeScorePart1(lines: Sequence<String>) = lines.map { it.split(" ") } .map { scorePart1(it.first().toRPS(), it.last().toRPS()) } .sum() fun scorePart1(opponent: RPS, mine: RPS): Int { return mine.points + when { opponent == mine -> 3 opponent.wins() == mine -> 6 else -> 0 } } // Part 2 fun computeScorePart2(lines: Sequence<String>) = lines.map { it.split(" ") } .map { scorePart2(it.first().toRPS(), it.last()) } .sum() fun scorePart2(opponent: RPS, result: String) = when (result) { "X" -> opponent.lose().points "Y" -> 3 + opponent.points else -> 6 + opponent.wins().points } enum class RPS(val points: Int) { ROCK(1), PAPER(2), SCISSORS(3); fun wins() = order.first { (first, _) -> first == this }.second fun lose() = order.first { (_, second) -> second == this }.first companion object { val order = listOf(ROCK to PAPER, PAPER to SCISSORS, SCISSORS to ROCK) } } fun String.toRPS() = when (this) { "A", "X" -> ROCK "B", "Y" -> PAPER "C", "Z" -> SCISSORS else -> throw IllegalArgumentException() }
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day2Kt.class", "javap": "Compiled from \"Day2.kt\"\npublic final class Day2Kt {\n public static final void main();\n Code:\n 0: new #10 // class java/io/File\n 3: dup\n 4: ldc #12 // String inputs/day_2.txt\n 6: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: astore_1\n 10: getstatic #22 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_1\n 17: astore 4\n 19: sipush 8192\n 22: istore 5\n 24: aload 4\n 26: astore 6\n 28: new #24 // class java/io/InputStreamReader\n 31: dup\n 32: new #26 // class java/io/FileInputStream\n 35: dup\n 36: aload 6\n 38: invokespecial #29 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 41: checkcast #31 // class java/io/InputStream\n 44: aload_2\n 45: invokespecial #34 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 48: checkcast #36 // class java/io/Reader\n 51: astore 6\n 53: aload 6\n 55: instanceof #38 // class java/io/BufferedReader\n 58: ifeq 69\n 61: aload 6\n 63: checkcast #38 // class java/io/BufferedReader\n 66: goto 80\n 69: new #38 // class java/io/BufferedReader\n 72: dup\n 73: aload 6\n 75: iload 5\n 77: invokespecial #41 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 80: checkcast #43 // class java/io/Closeable\n 83: astore 4\n 85: aconst_null\n 86: astore 5\n 88: nop\n 89: aload 4\n 91: checkcast #38 // class java/io/BufferedReader\n 94: astore 6\n 96: iconst_0\n 97: istore 7\n 99: aload 6\n 101: invokestatic #49 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;\n 104: astore 8\n 106: iconst_0\n 107: istore 9\n 109: aload 8\n 111: invokestatic #53 // Method computeScorePart2:(Lkotlin/sequences/Sequence;)I\n 114: istore 6\n 116: aload 4\n 118: aload 5\n 120: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 123: iload 6\n 125: goto 149\n 128: astore 7\n 130: aload 7\n 132: astore 5\n 134: aload 7\n 136: athrow\n 137: astore 7\n 139: aload 4\n 141: aload 5\n 143: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 146: aload 7\n 148: athrow\n 149: nop\n 150: istore_0\n 151: getstatic #65 // Field java/lang/System.out:Ljava/io/PrintStream;\n 154: iload_0\n 155: invokevirtual #71 // Method java/io/PrintStream.println:(I)V\n 158: return\n Exception table:\n from to target type\n 88 116 128 Class java/lang/Throwable\n 88 116 137 any\n 128 137 137 any\n 137 139 137 any\n\n public static final int computeScorePart1(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #92 // String lines\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokedynamic #117, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 12: invokestatic #123 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 15: invokedynamic #131, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 20: invokestatic #123 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 23: invokestatic #134 // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I\n 26: ireturn\n\n public static final int scorePart1(RPS, RPS);\n Code:\n 0: aload_0\n 1: ldc #138 // String opponent\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #140 // String mine\n 9: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_1\n 13: invokevirtual #146 // Method RPS.getPoints:()I\n 16: aload_0\n 17: aload_1\n 18: if_acmpne 25\n 21: iconst_3\n 22: goto 39\n 25: aload_0\n 26: invokevirtual #150 // Method RPS.wins:()LRPS;\n 29: aload_1\n 30: if_acmpne 38\n 33: bipush 6\n 35: goto 39\n 38: iconst_0\n 39: iadd\n 40: ireturn\n\n public static final int computeScorePart2(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #92 // String lines\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokedynamic #156, 0 // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;\n 12: invokestatic #123 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 15: invokedynamic #161, 0 // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function1;\n 20: invokestatic #123 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 23: invokestatic #134 // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I\n 26: ireturn\n\n public static final int scorePart2(RPS, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #138 // String opponent\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #164 // String result\n 9: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_1\n 13: astore_2\n 14: aload_2\n 15: ldc #166 // String X\n 17: invokestatic #170 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 20: ifeq 33\n 23: aload_0\n 24: invokevirtual #173 // Method RPS.lose:()LRPS;\n 27: invokevirtual #146 // Method RPS.getPoints:()I\n 30: goto 61\n 33: aload_2\n 34: ldc #175 // String Y\n 36: invokestatic #170 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 39: ifeq 51\n 42: iconst_3\n 43: aload_0\n 44: invokevirtual #146 // Method RPS.getPoints:()I\n 47: iadd\n 48: goto 61\n 51: bipush 6\n 53: aload_0\n 54: invokevirtual #150 // Method RPS.wins:()LRPS;\n 57: invokevirtual #146 // Method RPS.getPoints:()I\n 60: iadd\n 61: ireturn\n\n public static final RPS toRPS(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #182 // String <this>\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_1\n 8: aload_1\n 9: invokevirtual #185 // Method java/lang/String.hashCode:()I\n 12: lookupswitch { // 6\n 65: 72\n 66: 84\n 67: 96\n 88: 108\n 89: 120\n 90: 132\n default: 162\n }\n 72: aload_1\n 73: ldc #187 // String A\n 75: invokevirtual #191 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 78: ifne 144\n 81: goto 162\n 84: aload_1\n 85: ldc #193 // String B\n 87: invokevirtual #191 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 90: ifne 150\n 93: goto 162\n 96: aload_1\n 97: ldc #195 // String C\n 99: invokevirtual #191 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 102: ifne 156\n 105: goto 162\n 108: aload_1\n 109: ldc #166 // String X\n 111: invokevirtual #191 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 114: ifne 144\n 117: goto 162\n 120: aload_1\n 121: ldc #175 // String Y\n 123: invokevirtual #191 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 126: ifne 150\n 129: goto 162\n 132: aload_1\n 133: ldc #197 // String Z\n 135: invokevirtual #191 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 138: ifne 156\n 141: goto 162\n 144: getstatic #200 // Field RPS.ROCK:LRPS;\n 147: goto 170\n 150: getstatic #203 // Field RPS.PAPER:LRPS;\n 153: goto 170\n 156: getstatic #206 // Field RPS.SCISSORS:LRPS;\n 159: goto 170\n 162: new #208 // class java/lang/IllegalArgumentException\n 165: dup\n 166: invokespecial #210 // Method java/lang/IllegalArgumentException.\"<init>\":()V\n 169: athrow\n 170: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #214 // Method main:()V\n 3: return\n\n private static final java.util.List computeScorePart1$lambda$1(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #217 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #219 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #178 // class java/lang/String\n 14: astore_1\n 15: aload_1\n 16: iconst_0\n 17: ldc #221 // String\n 19: aastore\n 20: aload_1\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #227 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: areturn\n\n private static final int computeScorePart1$lambda$2(java.util.List);\n Code:\n 0: aload_0\n 1: ldc #217 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #233 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #178 // class java/lang/String\n 13: invokestatic #235 // Method toRPS:(Ljava/lang/String;)LRPS;\n 16: aload_0\n 17: invokestatic #238 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 20: checkcast #178 // class java/lang/String\n 23: invokestatic #235 // Method toRPS:(Ljava/lang/String;)LRPS;\n 26: invokestatic #240 // Method scorePart1:(LRPS;LRPS;)I\n 29: ireturn\n\n private static final java.util.List computeScorePart2$lambda$3(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #217 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #219 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #178 // class java/lang/String\n 14: astore_1\n 15: aload_1\n 16: iconst_0\n 17: ldc #221 // String\n 19: aastore\n 20: aload_1\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #227 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: areturn\n\n private static final int computeScorePart2$lambda$4(java.util.List);\n Code:\n 0: aload_0\n 1: ldc #217 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #233 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #178 // class java/lang/String\n 13: invokestatic #235 // Method toRPS:(Ljava/lang/String;)LRPS;\n 16: aload_0\n 17: invokestatic #238 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 20: checkcast #178 // class java/lang/String\n 23: invokestatic #243 // Method scorePart2:(LRPS;Ljava/lang/String;)I\n 26: ireturn\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day7.kt
import java.nio.file.Path fun fileSizeToDelete(lines: Sequence<String>) = directorySizes(lines).smallestFileToDelete() fun fileSize(lines: Sequence<String>) = directorySizes(lines).directorySizes.values .filter { it <=100000 } .sum() private fun directorySizes(lines: Sequence<String>) = lines.fold(DirectoryStructure()) { acc, line -> when { line.startsWith("$ cd ") -> acc.cd(line.split(" ")[2]) line[0].isDigit() -> acc.addSizes(line.split(" ")[0].toInt()) else -> acc } } data class DirectoryStructure( val directorySizes: Map<Path, Int> = mapOf(), val current: Path = ROOT_PATH ) { fun cd(dirName: String) = when (dirName) { ROOT -> copy(current = ROOT_PATH) PARENT -> copy(current = current.parent) else -> copy(current = current.resolve(dirName)) } fun addSizes(size: Int) = copy(directorySizes = directorySizes + findSizes(current, size)) fun totalSize() = directorySizes[ROOT_PATH]!! private fun findSizes(current: Path, size: Int): List<Pair<Path, Int>> = listOf(current to directorySizes.getOrDefault(current, 0) + size) + parentSize(current, size) private fun parentSize(current: Path, size: Int) = if (current.parent == null) listOf() else findSizes(current.parent, size) fun smallestFileToDelete() = directorySizes.values .sorted().first { totalSize() - it <= 40000000 } companion object { val ROOT = "/" val PARENT = ".." val ROOT_PATH = Path.of(ROOT) } }
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day7Kt.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7Kt {\n public static final int fileSizeToDelete(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #10 // String lines\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #20 // Method directorySizes:(Lkotlin/sequences/Sequence;)LDirectoryStructure;\n 10: invokevirtual #26 // Method DirectoryStructure.smallestFileToDelete:()I\n 13: ireturn\n\n public static final int fileSize(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #10 // String lines\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #20 // Method directorySizes:(Lkotlin/sequences/Sequence;)LDirectoryStructure;\n 10: invokevirtual #32 // Method DirectoryStructure.getDirectorySizes:()Ljava/util/Map;\n 13: invokeinterface #38, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 18: checkcast #40 // class java/lang/Iterable\n 21: astore_1\n 22: nop\n 23: iconst_0\n 24: istore_2\n 25: aload_1\n 26: astore_3\n 27: new #42 // class java/util/ArrayList\n 30: dup\n 31: invokespecial #46 // Method java/util/ArrayList.\"<init>\":()V\n 34: checkcast #48 // class java/util/Collection\n 37: astore 4\n 39: iconst_0\n 40: istore 5\n 42: aload_3\n 43: invokeinterface #52, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 6\n 50: aload 6\n 52: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 110\n 60: aload 6\n 62: invokeinterface #62, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 7\n 69: aload 7\n 71: checkcast #64 // class java/lang/Number\n 74: invokevirtual #67 // Method java/lang/Number.intValue:()I\n 77: istore 8\n 79: iconst_0\n 80: istore 9\n 82: iload 8\n 84: ldc #68 // int 100000\n 86: if_icmpgt 93\n 89: iconst_1\n 90: goto 94\n 93: iconst_0\n 94: ifeq 50\n 97: aload 4\n 99: aload 7\n 101: invokeinterface #72, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 106: pop\n 107: goto 50\n 110: aload 4\n 112: checkcast #74 // class java/util/List\n 115: nop\n 116: checkcast #40 // class java/lang/Iterable\n 119: invokestatic #80 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 122: ireturn\n\n private static final DirectoryStructure directorySizes(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: astore_1\n 2: new #22 // class DirectoryStructure\n 5: dup\n 6: aconst_null\n 7: aconst_null\n 8: iconst_3\n 9: aconst_null\n 10: invokespecial #98 // Method DirectoryStructure.\"<init>\":(Ljava/util/Map;Ljava/nio/file/Path;ILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: astore 4\n 19: aload_1\n 20: invokeinterface #99, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 25: astore 5\n 27: aload 5\n 29: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 34: ifeq 185\n 37: aload 5\n 39: invokeinterface #62, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 44: astore 6\n 46: aload 4\n 48: aload 6\n 50: checkcast #101 // class java/lang/String\n 53: astore 7\n 55: astore 8\n 57: iconst_0\n 58: istore 9\n 60: nop\n 61: aload 7\n 63: ldc #103 // String $ cd\n 65: iconst_0\n 66: iconst_2\n 67: aconst_null\n 68: invokestatic #109 // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z\n 71: ifeq 118\n 74: aload 8\n 76: aload 7\n 78: checkcast #111 // class java/lang/CharSequence\n 81: iconst_1\n 82: anewarray #101 // class java/lang/String\n 85: astore 10\n 87: aload 10\n 89: iconst_0\n 90: ldc #113 // String\n 92: aastore\n 93: aload 10\n 95: iconst_0\n 96: iconst_0\n 97: bipush 6\n 99: aconst_null\n 100: invokestatic #117 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 103: iconst_2\n 104: invokeinterface #121, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 109: checkcast #101 // class java/lang/String\n 112: invokevirtual #125 // Method DirectoryStructure.cd:(Ljava/lang/String;)LDirectoryStructure;\n 115: goto 179\n 118: aload 7\n 120: iconst_0\n 121: invokevirtual #129 // Method java/lang/String.charAt:(I)C\n 124: invokestatic #135 // Method java/lang/Character.isDigit:(C)Z\n 127: ifeq 177\n 130: aload 8\n 132: aload 7\n 134: checkcast #111 // class java/lang/CharSequence\n 137: iconst_1\n 138: anewarray #101 // class java/lang/String\n 141: astore 10\n 143: aload 10\n 145: iconst_0\n 146: ldc #113 // String\n 148: aastore\n 149: aload 10\n 151: iconst_0\n 152: iconst_0\n 153: bipush 6\n 155: aconst_null\n 156: invokestatic #117 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 159: iconst_0\n 160: invokeinterface #121, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 165: checkcast #101 // class java/lang/String\n 168: invokestatic #141 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 171: invokevirtual #145 // Method DirectoryStructure.addSizes:(I)LDirectoryStructure;\n 174: goto 179\n 177: aload 8\n 179: nop\n 180: astore 4\n 182: goto 27\n 185: aload 4\n 187: areturn\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day11.kt
import java.io.File fun main() { val result = File("inputs/day_11_1.txt").useLines { totalBusiness(monkeys(it), 10000, 1) } println(result) } fun totalBusiness(startState: Map<Int, Monkey>, times: Int = 20, divideBy: Int = 3) = (1..times) .fold(startState) { acc, _ -> simulateThrows(acc, divideBy, startState.values.totalDivides()) } .values.map { it.count } .sortedDescending() .take(2) .reduce(Long::times) private fun Collection<Monkey>.totalDivides() = map { it.divisibleBy }.reduce(Int::times) fun simulateThrows(monkeys: Map<Int, Monkey>, divideBy: Int, totalDivides: Int) = monkeys.keys.fold(monkeys) { acc, i -> rearrange(acc, acc[i]!!.throwStuff(divideBy, totalDivides)) } fun rearrange(acc: Map<Int, Monkey>, newPositions: Map<Int, List<Long>>) = newPositions.entries.fold(acc) { a, (n, items) -> a + (n to a[n]!!.updateItems(items)) } fun monkeys(lines: Sequence<String>) = lines.filter { it.isNotBlank() } .chunked(6) .map { parseMonkey(it) } .associateBy { it.n } fun parseMonkey(lines: List<String>) = Monkey( n = lines[0].split(" ")[1].split(":")[0].toInt(), items = lines[1].split(": ")[1].split(", ").map { it.toLong() }, operation = parseOp(lines[2].split("= ")[1].split(" ")), next = parseDivisible(lastInt(lines[3]), lastInt(lines[4]), lastInt(lines[5])), divisibleBy = lastInt(lines[3]) ) fun parseDivisible(divisibleBy: Int, option1: Int, option2: Int) = { n: Long -> if (n % divisibleBy == 0L) option1 else option2 } private fun lastInt(line: String) = line.split(" ").last().toInt() fun parseOp(s: List<String>) = when (s[1]) { "*" -> operation(s[0], s[2], Long::times) "+" -> operation(s[0], s[2], Long::plus) "-" -> operation(s[0], s[2], Long::minus) "/" -> operation(s[0], s[2], Long::div) else -> throw IllegalArgumentException() } fun operation(op1: String, op2: String, param: (Long, Long) -> Long) = op1.toLongOrNull() ?.let {operand1 -> op2.toLongOrNull()?.let { { _: Long -> param(operand1, it) } } ?: { n: Long -> param(n, operand1) } } ?: op2.toLongOrNull()?.let { { n: Long -> param(n, it) } } ?: { n: Long -> param(n, n) } data class Monkey( val n: Int, val items: List<Long>, val operation: Function1<Long, Long>, val next: (Long) -> Int, val divisibleBy: Int, val count: Long = 0) { fun throwStuff(divideBy: Int, totalDivides: Int) = items.map { (operation(it % totalDivides) / divideBy) }.groupBy { next(it) } + (n to listOf()) fun updateItems(newItems: List<Long>) = if (newItems.isEmpty()) copy(items = listOf(), count = count + items.size) else copy(items = items + newItems) override fun toString(): String { return "Monkey(n=$n, items=$items, count=$count)" } }
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day11Kt$parseOp$1.class", "javap": "Compiled from \"Day11.kt\"\nfinal class Day11Kt$parseOp$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.Long, java.lang.Long, java.lang.Long> {\n public static final Day11Kt$parseOp$1 INSTANCE;\n\n Day11Kt$parseOp$1();\n Code:\n 0: aload_0\n 1: iconst_2\n 2: getstatic #15 // Field java/lang/Long.TYPE:Ljava/lang/Class;\n 5: ldc #17 // String times\n 7: ldc #19 // String times(J)J\n 9: iconst_0\n 10: invokespecial #22 // Method kotlin/jvm/internal/FunctionReferenceImpl.\"<init>\":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V\n 13: return\n\n public final java.lang.Long invoke(long, long);\n Code:\n 0: lload_1\n 1: lload_3\n 2: lmul\n 3: invokestatic #30 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 6: areturn\n\n public java.lang.Object invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #36 // class java/lang/Number\n 5: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 8: aload_2\n 9: checkcast #36 // class java/lang/Number\n 12: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 15: invokevirtual #42 // Method invoke:(JJ)Ljava/lang/Long;\n 18: areturn\n\n static {};\n Code:\n 0: new #2 // class Day11Kt$parseOp$1\n 3: dup\n 4: invokespecial #47 // Method \"<init>\":()V\n 7: putstatic #50 // Field INSTANCE:LDay11Kt$parseOp$1;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "amitdev__advent_2022__b2cb4ec/Day11Kt$parseOp$3.class", "javap": "Compiled from \"Day11.kt\"\nfinal class Day11Kt$parseOp$3 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.Long, java.lang.Long, java.lang.Long> {\n public static final Day11Kt$parseOp$3 INSTANCE;\n\n Day11Kt$parseOp$3();\n Code:\n 0: aload_0\n 1: iconst_2\n 2: getstatic #15 // Field java/lang/Long.TYPE:Ljava/lang/Class;\n 5: ldc #17 // String minus\n 7: ldc #19 // String minus(J)J\n 9: iconst_0\n 10: invokespecial #22 // Method kotlin/jvm/internal/FunctionReferenceImpl.\"<init>\":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V\n 13: return\n\n public final java.lang.Long invoke(long, long);\n Code:\n 0: lload_1\n 1: lload_3\n 2: lsub\n 3: invokestatic #30 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 6: areturn\n\n public java.lang.Object invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #36 // class java/lang/Number\n 5: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 8: aload_2\n 9: checkcast #36 // class java/lang/Number\n 12: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 15: invokevirtual #42 // Method invoke:(JJ)Ljava/lang/Long;\n 18: areturn\n\n static {};\n Code:\n 0: new #2 // class Day11Kt$parseOp$3\n 3: dup\n 4: invokespecial #47 // Method \"<init>\":()V\n 7: putstatic #50 // Field INSTANCE:LDay11Kt$parseOp$3;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "amitdev__advent_2022__b2cb4ec/Day11Kt$parseOp$4.class", "javap": "Compiled from \"Day11.kt\"\nfinal class Day11Kt$parseOp$4 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.Long, java.lang.Long, java.lang.Long> {\n public static final Day11Kt$parseOp$4 INSTANCE;\n\n Day11Kt$parseOp$4();\n Code:\n 0: aload_0\n 1: iconst_2\n 2: getstatic #15 // Field java/lang/Long.TYPE:Ljava/lang/Class;\n 5: ldc #17 // String div\n 7: ldc #19 // String div(J)J\n 9: iconst_0\n 10: invokespecial #22 // Method kotlin/jvm/internal/FunctionReferenceImpl.\"<init>\":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V\n 13: return\n\n public final java.lang.Long invoke(long, long);\n Code:\n 0: lload_1\n 1: lload_3\n 2: ldiv\n 3: invokestatic #30 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 6: areturn\n\n public java.lang.Object invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #36 // class java/lang/Number\n 5: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 8: aload_2\n 9: checkcast #36 // class java/lang/Number\n 12: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 15: invokevirtual #42 // Method invoke:(JJ)Ljava/lang/Long;\n 18: areturn\n\n static {};\n Code:\n 0: new #2 // class Day11Kt$parseOp$4\n 3: dup\n 4: invokespecial #47 // Method \"<init>\":()V\n 7: putstatic #50 // Field INSTANCE:LDay11Kt$parseOp$4;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "amitdev__advent_2022__b2cb4ec/Day11Kt$parseOp$2.class", "javap": "Compiled from \"Day11.kt\"\nfinal class Day11Kt$parseOp$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.Long, java.lang.Long, java.lang.Long> {\n public static final Day11Kt$parseOp$2 INSTANCE;\n\n Day11Kt$parseOp$2();\n Code:\n 0: aload_0\n 1: iconst_2\n 2: getstatic #15 // Field java/lang/Long.TYPE:Ljava/lang/Class;\n 5: ldc #17 // String plus\n 7: ldc #19 // String plus(J)J\n 9: iconst_0\n 10: invokespecial #22 // Method kotlin/jvm/internal/FunctionReferenceImpl.\"<init>\":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V\n 13: return\n\n public final java.lang.Long invoke(long, long);\n Code:\n 0: lload_1\n 1: lload_3\n 2: ladd\n 3: invokestatic #30 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 6: areturn\n\n public java.lang.Object invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #36 // class java/lang/Number\n 5: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 8: aload_2\n 9: checkcast #36 // class java/lang/Number\n 12: invokevirtual #40 // Method java/lang/Number.longValue:()J\n 15: invokevirtual #42 // Method invoke:(JJ)Ljava/lang/Long;\n 18: areturn\n\n static {};\n Code:\n 0: new #2 // class Day11Kt$parseOp$2\n 3: dup\n 4: invokespecial #47 // Method \"<init>\":()V\n 7: putstatic #50 // Field INSTANCE:LDay11Kt$parseOp$2;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "amitdev__advent_2022__b2cb4ec/Day11Kt.class", "javap": "Compiled from \"Day11.kt\"\npublic final class Day11Kt {\n public static final void main();\n Code:\n 0: new #10 // class java/io/File\n 3: dup\n 4: ldc #12 // String inputs/day_11_1.txt\n 6: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: astore_2\n 10: getstatic #22 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 13: astore_3\n 14: iconst_0\n 15: istore 4\n 17: aload_2\n 18: astore 5\n 20: sipush 8192\n 23: istore 6\n 25: aload 5\n 27: astore 7\n 29: new #24 // class java/io/InputStreamReader\n 32: dup\n 33: new #26 // class java/io/FileInputStream\n 36: dup\n 37: aload 7\n 39: invokespecial #29 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 42: checkcast #31 // class java/io/InputStream\n 45: aload_3\n 46: invokespecial #34 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 49: checkcast #36 // class java/io/Reader\n 52: astore 7\n 54: aload 7\n 56: instanceof #38 // class java/io/BufferedReader\n 59: ifeq 70\n 62: aload 7\n 64: checkcast #38 // class java/io/BufferedReader\n 67: goto 81\n 70: new #38 // class java/io/BufferedReader\n 73: dup\n 74: aload 7\n 76: iload 6\n 78: invokespecial #41 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 81: checkcast #43 // class java/io/Closeable\n 84: astore 5\n 86: aconst_null\n 87: astore 6\n 89: nop\n 90: aload 5\n 92: checkcast #38 // class java/io/BufferedReader\n 95: astore 7\n 97: iconst_0\n 98: istore 9\n 100: aload 7\n 102: invokestatic #49 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;\n 105: astore 10\n 107: iconst_0\n 108: istore 11\n 110: aload 10\n 112: invokestatic #53 // Method monkeys:(Lkotlin/sequences/Sequence;)Ljava/util/Map;\n 115: sipush 10000\n 118: iconst_1\n 119: invokestatic #57 // Method totalBusiness:(Ljava/util/Map;II)J\n 122: lstore 7\n 124: aload 5\n 126: aload 6\n 128: invokestatic #63 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 131: lload 7\n 133: goto 157\n 136: astore 9\n 138: aload 9\n 140: astore 6\n 142: aload 9\n 144: athrow\n 145: astore 9\n 147: aload 5\n 149: aload 6\n 151: invokestatic #63 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 154: aload 9\n 156: athrow\n 157: nop\n 158: lstore_0\n 159: getstatic #69 // Field java/lang/System.out:Ljava/io/PrintStream;\n 162: lload_0\n 163: invokevirtual #75 // Method java/io/PrintStream.println:(J)V\n 166: return\n Exception table:\n from to target type\n 89 124 136 Class java/lang/Throwable\n 89 124 145 any\n 136 145 145 any\n 145 147 145 any\n\n public static final long totalBusiness(java.util.Map<java.lang.Integer, Monkey>, int, int);\n Code:\n 0: aload_0\n 1: ldc #96 // String startState\n 3: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #104 // class kotlin/ranges/IntRange\n 9: dup\n 10: iconst_1\n 11: iload_1\n 12: invokespecial #107 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 15: checkcast #109 // class java/lang/Iterable\n 18: astore_3\n 19: nop\n 20: iconst_0\n 21: istore 4\n 23: aload_0\n 24: astore 5\n 26: aload_3\n 27: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 32: astore 6\n 34: aload 6\n 36: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 41: ifeq 81\n 44: aload 6\n 46: checkcast #121 // class kotlin/collections/IntIterator\n 49: invokevirtual #125 // Method kotlin/collections/IntIterator.nextInt:()I\n 52: istore 7\n 54: aload 5\n 56: astore 9\n 58: iconst_0\n 59: istore 10\n 61: aload 9\n 63: iload_2\n 64: aload_0\n 65: invokeinterface #131, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 70: invokestatic #135 // Method totalDivides:(Ljava/util/Collection;)I\n 73: invokestatic #139 // Method simulateThrows:(Ljava/util/Map;II)Ljava/util/Map;\n 76: astore 5\n 78: goto 34\n 81: aload 5\n 83: invokeinterface #131, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 88: checkcast #109 // class java/lang/Iterable\n 91: astore_3\n 92: iconst_0\n 93: istore 4\n 95: aload_3\n 96: astore 5\n 98: new #141 // class java/util/ArrayList\n 101: dup\n 102: aload_3\n 103: bipush 10\n 105: invokestatic #147 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 108: invokespecial #150 // Method java/util/ArrayList.\"<init>\":(I)V\n 111: checkcast #152 // class java/util/Collection\n 114: astore 6\n 116: iconst_0\n 117: istore 7\n 119: aload 5\n 121: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 126: astore 8\n 128: aload 8\n 130: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 135: ifeq 181\n 138: aload 8\n 140: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 145: astore 9\n 147: aload 6\n 149: aload 9\n 151: checkcast #158 // class Monkey\n 154: astore 10\n 156: astore 12\n 158: iconst_0\n 159: istore 11\n 161: aload 10\n 163: invokevirtual #162 // Method Monkey.getCount:()J\n 166: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 169: aload 12\n 171: swap\n 172: invokeinterface #172, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 177: pop\n 178: goto 128\n 181: aload 6\n 183: checkcast #174 // class java/util/List\n 186: nop\n 187: checkcast #109 // class java/lang/Iterable\n 190: invokestatic #178 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 193: checkcast #109 // class java/lang/Iterable\n 196: iconst_2\n 197: invokestatic #182 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 200: checkcast #109 // class java/lang/Iterable\n 203: astore_3\n 204: nop\n 205: iconst_0\n 206: istore 4\n 208: aload_3\n 209: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 214: astore 5\n 216: aload 5\n 218: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 223: ifne 236\n 226: new #184 // class java/lang/UnsupportedOperationException\n 229: dup\n 230: ldc #186 // String Empty collection can\\'t be reduced.\n 232: invokespecial #187 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 235: athrow\n 236: aload 5\n 238: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 243: astore 6\n 245: aload 5\n 247: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 252: ifeq 296\n 255: aload 6\n 257: aload 5\n 259: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 264: checkcast #189 // class java/lang/Number\n 267: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 270: lstore 7\n 272: checkcast #189 // class java/lang/Number\n 275: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 278: lstore 9\n 280: iconst_0\n 281: istore 11\n 283: lload 9\n 285: lload 7\n 287: lmul\n 288: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 291: astore 6\n 293: goto 245\n 296: aload 6\n 298: checkcast #189 // class java/lang/Number\n 301: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 304: lreturn\n\n public static long totalBusiness$default(java.util.Map, int, int, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_2\n 2: iand\n 3: ifeq 9\n 6: bipush 20\n 8: istore_1\n 9: iload_3\n 10: iconst_4\n 11: iand\n 12: ifeq 17\n 15: iconst_3\n 16: istore_2\n 17: aload_0\n 18: iload_1\n 19: iload_2\n 20: invokestatic #57 // Method totalBusiness:(Ljava/util/Map;II)J\n 23: lreturn\n\n private static final int totalDivides(java.util.Collection<Monkey>);\n Code:\n 0: aload_0\n 1: checkcast #109 // class java/lang/Iterable\n 4: astore_1\n 5: iconst_0\n 6: istore_2\n 7: aload_1\n 8: astore_3\n 9: new #141 // class java/util/ArrayList\n 12: dup\n 13: aload_1\n 14: bipush 10\n 16: invokestatic #147 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 19: invokespecial #150 // Method java/util/ArrayList.\"<init>\":(I)V\n 22: checkcast #152 // class java/util/Collection\n 25: astore 4\n 27: iconst_0\n 28: istore 5\n 30: aload_3\n 31: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 36: astore 6\n 38: aload 6\n 40: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 45: ifeq 91\n 48: aload 6\n 50: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 55: astore 7\n 57: aload 4\n 59: aload 7\n 61: checkcast #158 // class Monkey\n 64: astore 8\n 66: astore 10\n 68: iconst_0\n 69: istore 9\n 71: aload 8\n 73: invokevirtual #225 // Method Monkey.getDivisibleBy:()I\n 76: invokestatic #230 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 79: aload 10\n 81: swap\n 82: invokeinterface #172, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 87: pop\n 88: goto 38\n 91: aload 4\n 93: checkcast #174 // class java/util/List\n 96: nop\n 97: checkcast #109 // class java/lang/Iterable\n 100: astore_1\n 101: nop\n 102: iconst_0\n 103: istore_2\n 104: aload_1\n 105: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 110: astore_3\n 111: aload_3\n 112: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 117: ifne 130\n 120: new #184 // class java/lang/UnsupportedOperationException\n 123: dup\n 124: ldc #186 // String Empty collection can\\'t be reduced.\n 126: invokespecial #187 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 129: athrow\n 130: aload_3\n 131: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 136: astore 4\n 138: aload_3\n 139: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 144: ifeq 187\n 147: aload 4\n 149: aload_3\n 150: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 155: checkcast #189 // class java/lang/Number\n 158: invokevirtual #233 // Method java/lang/Number.intValue:()I\n 161: istore 5\n 163: checkcast #189 // class java/lang/Number\n 166: invokevirtual #233 // Method java/lang/Number.intValue:()I\n 169: istore 6\n 171: iconst_0\n 172: istore 7\n 174: iload 6\n 176: iload 5\n 178: imul\n 179: invokestatic #230 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 182: astore 4\n 184: goto 138\n 187: aload 4\n 189: checkcast #189 // class java/lang/Number\n 192: invokevirtual #233 // Method java/lang/Number.intValue:()I\n 195: ireturn\n\n public static final java.util.Map<java.lang.Integer, Monkey> simulateThrows(java.util.Map<java.lang.Integer, Monkey>, int, int);\n Code:\n 0: aload_0\n 1: ldc #238 // String monkeys\n 3: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #242, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 12: checkcast #109 // class java/lang/Iterable\n 15: astore_3\n 16: iconst_0\n 17: istore 4\n 19: aload_0\n 20: astore 5\n 22: aload_3\n 23: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 28: astore 6\n 30: aload 6\n 32: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 37: ifeq 100\n 40: aload 6\n 42: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 47: astore 7\n 49: aload 5\n 51: aload 7\n 53: checkcast #189 // class java/lang/Number\n 56: invokevirtual #233 // Method java/lang/Number.intValue:()I\n 59: istore 8\n 61: astore 9\n 63: iconst_0\n 64: istore 10\n 66: aload 9\n 68: aload 9\n 70: iload 8\n 72: invokestatic #230 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 75: invokeinterface #246, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 80: dup\n 81: invokestatic #250 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 84: checkcast #158 // class Monkey\n 87: iload_1\n 88: iload_2\n 89: invokevirtual #254 // Method Monkey.throwStuff:(II)Ljava/util/Map;\n 92: invokestatic #258 // Method rearrange:(Ljava/util/Map;Ljava/util/Map;)Ljava/util/Map;\n 95: astore 5\n 97: goto 30\n 100: aload 5\n 102: areturn\n\n public static final java.util.Map<java.lang.Integer, Monkey> rearrange(java.util.Map<java.lang.Integer, Monkey>, java.util.Map<java.lang.Integer, ? extends java.util.List<java.lang.Long>>);\n Code:\n 0: aload_0\n 1: ldc_w #262 // String acc\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #264 // String newPositions\n 11: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_1\n 15: invokeinterface #267, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 20: checkcast #109 // class java/lang/Iterable\n 23: astore_2\n 24: iconst_0\n 25: istore_3\n 26: aload_0\n 27: astore 4\n 29: aload_2\n 30: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 35: astore 5\n 37: aload 5\n 39: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 44: ifeq 139\n 47: aload 5\n 49: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 54: astore 6\n 56: aload 4\n 58: aload 6\n 60: checkcast #269 // class java/util/Map$Entry\n 63: astore 7\n 65: astore 8\n 67: iconst_0\n 68: istore 9\n 70: aload 7\n 72: invokeinterface #272, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 77: checkcast #189 // class java/lang/Number\n 80: invokevirtual #233 // Method java/lang/Number.intValue:()I\n 83: istore 10\n 85: aload 7\n 87: invokeinterface #275, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 92: checkcast #174 // class java/util/List\n 95: astore 11\n 97: aload 8\n 99: iload 10\n 101: invokestatic #230 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 104: aload 8\n 106: iload 10\n 108: invokestatic #230 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 111: invokeinterface #246, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 116: dup\n 117: invokestatic #250 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 120: checkcast #158 // class Monkey\n 123: aload 11\n 125: invokevirtual #279 // Method Monkey.updateItems:(Ljava/util/List;)LMonkey;\n 128: invokestatic #285 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 131: invokestatic #291 // Method kotlin/collections/MapsKt.plus:(Ljava/util/Map;Lkotlin/Pair;)Ljava/util/Map;\n 134: astore 4\n 136: goto 37\n 139: aload 4\n 141: areturn\n\n public static final java.util.Map<java.lang.Integer, Monkey> monkeys(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc_w #299 // String lines\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokedynamic #318, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 13: invokestatic #324 // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 16: bipush 6\n 18: invokestatic #328 // Method kotlin/sequences/SequencesKt.chunked:(Lkotlin/sequences/Sequence;I)Lkotlin/sequences/Sequence;\n 21: invokedynamic #334, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 26: invokestatic #337 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 29: astore_1\n 30: nop\n 31: iconst_0\n 32: istore_2\n 33: aload_1\n 34: astore_3\n 35: new #339 // class java/util/LinkedHashMap\n 38: dup\n 39: invokespecial #341 // Method java/util/LinkedHashMap.\"<init>\":()V\n 42: checkcast #127 // class java/util/Map\n 45: astore 4\n 47: iconst_0\n 48: istore 5\n 50: aload_3\n 51: invokeinterface #342, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 56: astore 6\n 58: aload 6\n 60: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 65: ifeq 113\n 68: aload 6\n 70: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 75: astore 7\n 77: aload 4\n 79: aload 7\n 81: checkcast #158 // class Monkey\n 84: astore 8\n 86: astore 10\n 88: iconst_0\n 89: istore 9\n 91: aload 8\n 93: invokevirtual #345 // Method Monkey.getN:()I\n 96: invokestatic #230 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 99: aload 10\n 101: swap\n 102: aload 7\n 104: invokeinterface #349, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 109: pop\n 110: goto 58\n 113: aload 4\n 115: nop\n 116: areturn\n\n public static final Monkey parseMonkey(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc_w #299 // String lines\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: iconst_0\n 9: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 14: checkcast #362 // class java/lang/CharSequence\n 17: iconst_1\n 18: anewarray #364 // class java/lang/String\n 21: astore_1\n 22: aload_1\n 23: iconst_0\n 24: ldc_w #366 // String\n 27: aastore\n 28: aload_1\n 29: iconst_0\n 30: iconst_0\n 31: bipush 6\n 33: aconst_null\n 34: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 37: iconst_1\n 38: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 43: checkcast #362 // class java/lang/CharSequence\n 46: iconst_1\n 47: anewarray #364 // class java/lang/String\n 50: astore_1\n 51: aload_1\n 52: iconst_0\n 53: ldc_w #374 // String :\n 56: aastore\n 57: aload_1\n 58: iconst_0\n 59: iconst_0\n 60: bipush 6\n 62: aconst_null\n 63: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 66: iconst_0\n 67: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 72: checkcast #364 // class java/lang/String\n 75: invokestatic #378 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 78: aload_0\n 79: iconst_1\n 80: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 85: checkcast #362 // class java/lang/CharSequence\n 88: iconst_1\n 89: anewarray #364 // class java/lang/String\n 92: astore_1\n 93: aload_1\n 94: iconst_0\n 95: ldc_w #380 // String :\n 98: aastore\n 99: aload_1\n 100: iconst_0\n 101: iconst_0\n 102: bipush 6\n 104: aconst_null\n 105: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 108: iconst_1\n 109: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 114: checkcast #362 // class java/lang/CharSequence\n 117: iconst_1\n 118: anewarray #364 // class java/lang/String\n 121: astore_1\n 122: aload_1\n 123: iconst_0\n 124: ldc_w #382 // String ,\n 127: aastore\n 128: aload_1\n 129: iconst_0\n 130: iconst_0\n 131: bipush 6\n 133: aconst_null\n 134: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 137: checkcast #109 // class java/lang/Iterable\n 140: astore_1\n 141: istore 10\n 143: iconst_0\n 144: istore_2\n 145: aload_1\n 146: astore_3\n 147: new #141 // class java/util/ArrayList\n 150: dup\n 151: aload_1\n 152: bipush 10\n 154: invokestatic #147 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 157: invokespecial #150 // Method java/util/ArrayList.\"<init>\":(I)V\n 160: checkcast #152 // class java/util/Collection\n 163: astore 4\n 165: iconst_0\n 166: istore 5\n 168: aload_3\n 169: invokeinterface #113, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 174: astore 6\n 176: aload 6\n 178: invokeinterface #119, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 183: ifeq 230\n 186: aload 6\n 188: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 193: astore 7\n 195: aload 4\n 197: aload 7\n 199: checkcast #364 // class java/lang/String\n 202: astore 8\n 204: astore 11\n 206: iconst_0\n 207: istore 9\n 209: aload 8\n 211: invokestatic #386 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 214: nop\n 215: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 218: aload 11\n 220: swap\n 221: invokeinterface #172, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 226: pop\n 227: goto 176\n 230: aload 4\n 232: checkcast #174 // class java/util/List\n 235: nop\n 236: astore 11\n 238: iload 10\n 240: aload 11\n 242: aload_0\n 243: iconst_2\n 244: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 249: checkcast #362 // class java/lang/CharSequence\n 252: iconst_1\n 253: anewarray #364 // class java/lang/String\n 256: astore_1\n 257: aload_1\n 258: iconst_0\n 259: ldc_w #388 // String =\n 262: aastore\n 263: aload_1\n 264: iconst_0\n 265: iconst_0\n 266: bipush 6\n 268: aconst_null\n 269: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 272: iconst_1\n 273: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 278: checkcast #362 // class java/lang/CharSequence\n 281: iconst_1\n 282: anewarray #364 // class java/lang/String\n 285: astore_1\n 286: aload_1\n 287: iconst_0\n 288: ldc_w #366 // String\n 291: aastore\n 292: aload_1\n 293: iconst_0\n 294: iconst_0\n 295: bipush 6\n 297: aconst_null\n 298: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 301: invokestatic #392 // Method parseOp:(Ljava/util/List;)Lkotlin/jvm/functions/Function1;\n 304: aload_0\n 305: iconst_3\n 306: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 311: checkcast #364 // class java/lang/String\n 314: invokestatic #395 // Method lastInt:(Ljava/lang/String;)I\n 317: aload_0\n 318: iconst_4\n 319: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 324: checkcast #364 // class java/lang/String\n 327: invokestatic #395 // Method lastInt:(Ljava/lang/String;)I\n 330: aload_0\n 331: iconst_5\n 332: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 337: checkcast #364 // class java/lang/String\n 340: invokestatic #395 // Method lastInt:(Ljava/lang/String;)I\n 343: invokestatic #399 // Method parseDivisible:(III)Lkotlin/jvm/functions/Function1;\n 346: aload_0\n 347: iconst_3\n 348: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 353: checkcast #364 // class java/lang/String\n 356: invokestatic #395 // Method lastInt:(Ljava/lang/String;)I\n 359: lconst_0\n 360: bipush 32\n 362: aconst_null\n 363: astore 12\n 365: istore 13\n 367: lstore 14\n 369: istore 16\n 371: astore 17\n 373: astore 18\n 375: astore 19\n 377: istore 20\n 379: new #158 // class Monkey\n 382: dup\n 383: iload 20\n 385: aload 19\n 387: aload 18\n 389: aload 17\n 391: iload 16\n 393: lload 14\n 395: iload 13\n 397: aload 12\n 399: invokespecial #402 // Method Monkey.\"<init>\":(ILjava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;IJILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 402: areturn\n\n public static final kotlin.jvm.functions.Function1<java.lang.Long, java.lang.Integer> parseDivisible(int, int, int);\n Code:\n 0: iload_0\n 1: iload_1\n 2: iload_2\n 3: invokedynamic #414, 0 // InvokeDynamic #2:invoke:(III)Lkotlin/jvm/functions/Function1;\n 8: areturn\n\n private static final int lastInt(java.lang.String);\n Code:\n 0: aload_0\n 1: checkcast #362 // class java/lang/CharSequence\n 4: iconst_1\n 5: anewarray #364 // class java/lang/String\n 8: astore_1\n 9: aload_1\n 10: iconst_0\n 11: ldc_w #366 // String\n 14: aastore\n 15: aload_1\n 16: iconst_0\n 17: iconst_0\n 18: bipush 6\n 20: aconst_null\n 21: invokestatic #372 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 24: invokestatic #421 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 27: checkcast #364 // class java/lang/String\n 30: invokestatic #378 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 33: ireturn\n\n public static final kotlin.jvm.functions.Function1<java.lang.Long, java.lang.Long> parseOp(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc_w #425 // String s\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: iconst_1\n 9: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 14: checkcast #364 // class java/lang/String\n 17: astore_1\n 18: aload_1\n 19: invokevirtual #428 // Method java/lang/String.hashCode:()I\n 22: tableswitch { // 42 to 47\n 42: 60\n 43: 73\n 44: 240\n 45: 86\n 46: 240\n 47: 99\n default: 240\n }\n 60: aload_1\n 61: ldc_w #430 // String *\n 64: invokevirtual #433 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 67: ifne 112\n 70: goto 240\n 73: aload_1\n 74: ldc_w #435 // String +\n 77: invokevirtual #433 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 80: ifne 144\n 83: goto 240\n 86: aload_1\n 87: ldc_w #437 // String -\n 90: invokevirtual #433 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 93: ifne 176\n 96: goto 240\n 99: aload_1\n 100: ldc_w #439 // String /\n 103: invokevirtual #433 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 106: ifne 208\n 109: goto 240\n 112: aload_0\n 113: iconst_0\n 114: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 119: checkcast #364 // class java/lang/String\n 122: aload_0\n 123: iconst_2\n 124: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 129: checkcast #364 // class java/lang/String\n 132: getstatic #445 // Field Day11Kt$parseOp$1.INSTANCE:LDay11Kt$parseOp$1;\n 135: checkcast #447 // class kotlin/jvm/functions/Function2\n 138: invokestatic #451 // Method operation:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function1;\n 141: goto 248\n 144: aload_0\n 145: iconst_0\n 146: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 151: checkcast #364 // class java/lang/String\n 154: aload_0\n 155: iconst_2\n 156: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 161: checkcast #364 // class java/lang/String\n 164: getstatic #456 // Field Day11Kt$parseOp$2.INSTANCE:LDay11Kt$parseOp$2;\n 167: checkcast #447 // class kotlin/jvm/functions/Function2\n 170: invokestatic #451 // Method operation:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function1;\n 173: goto 248\n 176: aload_0\n 177: iconst_0\n 178: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 183: checkcast #364 // class java/lang/String\n 186: aload_0\n 187: iconst_2\n 188: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 193: checkcast #364 // class java/lang/String\n 196: getstatic #461 // Field Day11Kt$parseOp$3.INSTANCE:LDay11Kt$parseOp$3;\n 199: checkcast #447 // class kotlin/jvm/functions/Function2\n 202: invokestatic #451 // Method operation:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function1;\n 205: goto 248\n 208: aload_0\n 209: iconst_0\n 210: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 215: checkcast #364 // class java/lang/String\n 218: aload_0\n 219: iconst_2\n 220: invokeinterface #360, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 225: checkcast #364 // class java/lang/String\n 228: getstatic #466 // Field Day11Kt$parseOp$4.INSTANCE:LDay11Kt$parseOp$4;\n 231: checkcast #447 // class kotlin/jvm/functions/Function2\n 234: invokestatic #451 // Method operation:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function1;\n 237: goto 248\n 240: new #468 // class java/lang/IllegalArgumentException\n 243: dup\n 244: invokespecial #469 // Method java/lang/IllegalArgumentException.\"<init>\":()V\n 247: athrow\n 248: areturn\n\n public static final kotlin.jvm.functions.Function1<java.lang.Long, java.lang.Long> operation(java.lang.String, java.lang.String, kotlin.jvm.functions.Function2<? super java.lang.Long, ? super java.lang.Long, java.lang.Long>);\n Code:\n 0: aload_0\n 1: ldc_w #474 // String op1\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #476 // String op2\n 11: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_2\n 15: ldc_w #478 // String param\n 18: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 21: aload_0\n 22: invokestatic #482 // Method kotlin/text/StringsKt.toLongOrNull:(Ljava/lang/String;)Ljava/lang/Long;\n 25: astore_3\n 26: aload_3\n 27: ifnull 98\n 30: aload_3\n 31: checkcast #189 // class java/lang/Number\n 34: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 37: lstore 5\n 39: iconst_0\n 40: istore 7\n 42: aload_1\n 43: invokestatic #482 // Method kotlin/text/StringsKt.toLongOrNull:(Ljava/lang/String;)Ljava/lang/Long;\n 46: dup\n 47: ifnull 76\n 50: checkcast #189 // class java/lang/Number\n 53: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 56: lstore 8\n 58: iconst_0\n 59: istore 10\n 61: aload_2\n 62: lload 5\n 64: lload 8\n 66: invokedynamic #492, 0 // InvokeDynamic #3:invoke:(Lkotlin/jvm/functions/Function2;JJ)Lkotlin/jvm/functions/Function1;\n 71: nop\n 72: dup\n 73: ifnonnull 85\n 76: pop\n 77: aload_2\n 78: lload 5\n 80: invokedynamic #500, 0 // InvokeDynamic #4:invoke:(Lkotlin/jvm/functions/Function2;J)Lkotlin/jvm/functions/Function1;\n 85: nop\n 86: astore 4\n 88: aload 4\n 90: ifnull 98\n 93: aload 4\n 95: goto 136\n 98: aload_1\n 99: invokestatic #482 // Method kotlin/text/StringsKt.toLongOrNull:(Ljava/lang/String;)Ljava/lang/Long;\n 102: dup\n 103: ifnull 128\n 106: checkcast #189 // class java/lang/Number\n 109: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 112: lstore 6\n 114: iconst_0\n 115: istore 8\n 117: aload_2\n 118: lload 6\n 120: invokedynamic #505, 0 // InvokeDynamic #5:invoke:(Lkotlin/jvm/functions/Function2;J)Lkotlin/jvm/functions/Function1;\n 125: goto 136\n 128: pop\n 129: nop\n 130: aload_2\n 131: invokedynamic #513, 0 // InvokeDynamic #6:invoke:(Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function1;\n 136: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #521 // Method main:()V\n 3: return\n\n private static final boolean monkeys$lambda$7(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc_w #524 // String it\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: checkcast #362 // class java/lang/CharSequence\n 11: invokestatic #528 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z\n 14: ifne 21\n 17: iconst_1\n 18: goto 22\n 21: iconst_0\n 22: ireturn\n\n private static final Monkey monkeys$lambda$8(java.util.List);\n Code:\n 0: aload_0\n 1: ldc_w #524 // String it\n 4: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokestatic #530 // Method parseMonkey:(Ljava/util/List;)LMonkey;\n 11: areturn\n\n private static final int parseDivisible$lambda$11(int, int, int, long);\n Code:\n 0: lload_3\n 1: iload_0\n 2: i2l\n 3: lrem\n 4: lconst_0\n 5: lcmp\n 6: ifne 13\n 9: iload_1\n 10: goto 14\n 13: iload_2\n 14: ireturn\n\n private static final long operation$lambda$15$lambda$13$lambda$12(kotlin.jvm.functions.Function2, long, long, long);\n Code:\n 0: aload_0\n 1: lload_1\n 2: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 5: lload_3\n 6: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 9: invokeinterface #535, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 14: checkcast #189 // class java/lang/Number\n 17: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 20: lreturn\n\n private static final long operation$lambda$15$lambda$14(kotlin.jvm.functions.Function2, long, long);\n Code:\n 0: aload_0\n 1: lload_3\n 2: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 5: lload_1\n 6: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 9: invokeinterface #535, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 14: checkcast #189 // class java/lang/Number\n 17: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 20: lreturn\n\n private static final long operation$lambda$17$lambda$16(kotlin.jvm.functions.Function2, long, long);\n Code:\n 0: aload_0\n 1: lload_3\n 2: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 5: lload_1\n 6: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 9: invokeinterface #535, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 14: checkcast #189 // class java/lang/Number\n 17: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 20: lreturn\n\n private static final long operation$lambda$18(kotlin.jvm.functions.Function2, long);\n Code:\n 0: aload_0\n 1: lload_1\n 2: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 5: lload_1\n 6: invokestatic #168 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 9: invokeinterface #535, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 14: checkcast #189 // class java/lang/Number\n 17: invokevirtual #192 // Method java/lang/Number.longValue:()J\n 20: lreturn\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day4.kt
import java.io.File fun main() { val result = File("inputs/day_4.txt").useLines { computeOverlaps(it) } println(result) } fun computeFullOverlaps(lines: Sequence<String>) = lines.map { toPairs(it) } .count { it.first.contains(it.second) || it.second.contains(it.first)} fun computeOverlaps(lines: Sequence<String>) = lines.map { toPairs(it) } .count { it.first.overlaps(it.second) || it.second.overlaps(it.first)} fun toPairs(it: String) = it.split(",") .map { it.split("-").map { it.toInt() } } .map { it.toPair() } .toPair() fun <T> List<T>.toPair() = Pair(this[0], this[1]) fun Pair<Int, Int>.contains(that: Pair<Int, Int>) = this.first <= that.first && this.second >= that.second fun Pair<Int, Int>.overlaps(that: Pair<Int, Int>) = this.first <= that.first && this.second >= that.first || this.first >= that.first && this.first <= that.second
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day4Kt.class", "javap": "Compiled from \"Day4.kt\"\npublic final class Day4Kt {\n public static final void main();\n Code:\n 0: new #10 // class java/io/File\n 3: dup\n 4: ldc #12 // String inputs/day_4.txt\n 6: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: astore_1\n 10: getstatic #22 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_1\n 17: astore 4\n 19: sipush 8192\n 22: istore 5\n 24: aload 4\n 26: astore 6\n 28: new #24 // class java/io/InputStreamReader\n 31: dup\n 32: new #26 // class java/io/FileInputStream\n 35: dup\n 36: aload 6\n 38: invokespecial #29 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 41: checkcast #31 // class java/io/InputStream\n 44: aload_2\n 45: invokespecial #34 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 48: checkcast #36 // class java/io/Reader\n 51: astore 6\n 53: aload 6\n 55: instanceof #38 // class java/io/BufferedReader\n 58: ifeq 69\n 61: aload 6\n 63: checkcast #38 // class java/io/BufferedReader\n 66: goto 80\n 69: new #38 // class java/io/BufferedReader\n 72: dup\n 73: aload 6\n 75: iload 5\n 77: invokespecial #41 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 80: checkcast #43 // class java/io/Closeable\n 83: astore 4\n 85: aconst_null\n 86: astore 5\n 88: nop\n 89: aload 4\n 91: checkcast #38 // class java/io/BufferedReader\n 94: astore 6\n 96: iconst_0\n 97: istore 7\n 99: aload 6\n 101: invokestatic #49 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;\n 104: astore 8\n 106: iconst_0\n 107: istore 9\n 109: aload 8\n 111: invokestatic #53 // Method computeOverlaps:(Lkotlin/sequences/Sequence;)I\n 114: istore 6\n 116: aload 4\n 118: aload 5\n 120: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 123: iload 6\n 125: goto 149\n 128: astore 7\n 130: aload 7\n 132: astore 5\n 134: aload 7\n 136: athrow\n 137: astore 7\n 139: aload 4\n 141: aload 5\n 143: invokestatic #59 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 146: aload 7\n 148: athrow\n 149: nop\n 150: istore_0\n 151: getstatic #65 // Field java/lang/System.out:Ljava/io/PrintStream;\n 154: iload_0\n 155: invokevirtual #71 // Method java/io/PrintStream.println:(I)V\n 158: return\n Exception table:\n from to target type\n 88 116 128 Class java/lang/Throwable\n 88 116 137 any\n 128 137 137 any\n 137 139 137 any\n\n public static final int computeFullOverlaps(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #92 // String lines\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokedynamic #117, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 12: invokestatic #123 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 15: astore_1\n 16: nop\n 17: iconst_0\n 18: istore_2\n 19: iconst_0\n 20: istore_3\n 21: aload_1\n 22: invokeinterface #127, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 27: astore 4\n 29: aload 4\n 31: invokeinterface #133, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 36: ifeq 123\n 39: aload 4\n 41: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 46: astore 5\n 48: aload 5\n 50: checkcast #139 // class kotlin/Pair\n 53: astore 6\n 55: iconst_0\n 56: istore 7\n 58: aload 6\n 60: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 63: checkcast #139 // class kotlin/Pair\n 66: aload 6\n 68: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 71: checkcast #139 // class kotlin/Pair\n 74: invokestatic #149 // Method contains:(Lkotlin/Pair;Lkotlin/Pair;)Z\n 77: ifne 102\n 80: aload 6\n 82: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 85: checkcast #139 // class kotlin/Pair\n 88: aload 6\n 90: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 93: checkcast #139 // class kotlin/Pair\n 96: invokestatic #149 // Method contains:(Lkotlin/Pair;Lkotlin/Pair;)Z\n 99: ifeq 106\n 102: iconst_1\n 103: goto 107\n 106: iconst_0\n 107: ifeq 29\n 110: iinc 3, 1\n 113: iload_3\n 114: ifge 29\n 117: invokestatic #154 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 120: goto 29\n 123: iload_3\n 124: ireturn\n\n public static final int computeOverlaps(kotlin.sequences.Sequence<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #92 // String lines\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokedynamic #166, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 12: invokestatic #123 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 15: astore_1\n 16: nop\n 17: iconst_0\n 18: istore_2\n 19: iconst_0\n 20: istore_3\n 21: aload_1\n 22: invokeinterface #127, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 27: astore 4\n 29: aload 4\n 31: invokeinterface #133, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 36: ifeq 123\n 39: aload 4\n 41: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 46: astore 5\n 48: aload 5\n 50: checkcast #139 // class kotlin/Pair\n 53: astore 6\n 55: iconst_0\n 56: istore 7\n 58: aload 6\n 60: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 63: checkcast #139 // class kotlin/Pair\n 66: aload 6\n 68: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 71: checkcast #139 // class kotlin/Pair\n 74: invokestatic #169 // Method overlaps:(Lkotlin/Pair;Lkotlin/Pair;)Z\n 77: ifne 102\n 80: aload 6\n 82: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 85: checkcast #139 // class kotlin/Pair\n 88: aload 6\n 90: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 93: checkcast #139 // class kotlin/Pair\n 96: invokestatic #169 // Method overlaps:(Lkotlin/Pair;Lkotlin/Pair;)Z\n 99: ifeq 106\n 102: iconst_1\n 103: goto 107\n 106: iconst_0\n 107: ifeq 29\n 110: iinc 3, 1\n 113: iload_3\n 114: ifge 29\n 117: invokestatic #154 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 120: goto 29\n 123: iload_3\n 124: ireturn\n\n public static final kotlin.Pair<kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>> toPairs(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #173 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #175 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #177 // class java/lang/String\n 14: astore_1\n 15: aload_1\n 16: iconst_0\n 17: ldc #179 // String ,\n 19: aastore\n 20: aload_1\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #185 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: checkcast #187 // class java/lang/Iterable\n 32: astore_1\n 33: nop\n 34: iconst_0\n 35: istore_2\n 36: aload_1\n 37: astore_3\n 38: new #189 // class java/util/ArrayList\n 41: dup\n 42: aload_1\n 43: bipush 10\n 45: invokestatic #193 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 48: invokespecial #195 // Method java/util/ArrayList.\"<init>\":(I)V\n 51: checkcast #197 // class java/util/Collection\n 54: astore 4\n 56: iconst_0\n 57: istore 5\n 59: aload_3\n 60: invokeinterface #198, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 65: astore 6\n 67: aload 6\n 69: invokeinterface #133, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 74: ifeq 243\n 77: aload 6\n 79: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 7\n 86: aload 4\n 88: aload 7\n 90: checkcast #177 // class java/lang/String\n 93: astore 8\n 95: astore 20\n 97: iconst_0\n 98: istore 9\n 100: aload 8\n 102: checkcast #175 // class java/lang/CharSequence\n 105: iconst_1\n 106: anewarray #177 // class java/lang/String\n 109: astore 10\n 111: aload 10\n 113: iconst_0\n 114: ldc #200 // String -\n 116: aastore\n 117: aload 10\n 119: iconst_0\n 120: iconst_0\n 121: bipush 6\n 123: aconst_null\n 124: invokestatic #185 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 127: checkcast #187 // class java/lang/Iterable\n 130: astore 10\n 132: iconst_0\n 133: istore 11\n 135: aload 10\n 137: astore 12\n 139: new #189 // class java/util/ArrayList\n 142: dup\n 143: aload 10\n 145: bipush 10\n 147: invokestatic #193 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 150: invokespecial #195 // Method java/util/ArrayList.\"<init>\":(I)V\n 153: checkcast #197 // class java/util/Collection\n 156: astore 13\n 158: iconst_0\n 159: istore 14\n 161: aload 12\n 163: invokeinterface #198, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 168: astore 15\n 170: aload 15\n 172: invokeinterface #133, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 177: ifeq 224\n 180: aload 15\n 182: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 187: astore 16\n 189: aload 13\n 191: aload 16\n 193: checkcast #177 // class java/lang/String\n 196: astore 17\n 198: astore 18\n 200: iconst_0\n 201: istore 19\n 203: aload 17\n 205: invokestatic #206 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 208: nop\n 209: invokestatic #210 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 212: aload 18\n 214: swap\n 215: invokeinterface #214, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 220: pop\n 221: goto 170\n 224: aload 13\n 226: checkcast #216 // class java/util/List\n 229: nop\n 230: nop\n 231: aload 20\n 233: swap\n 234: invokeinterface #214, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 239: pop\n 240: goto 67\n 243: aload 4\n 245: checkcast #216 // class java/util/List\n 248: nop\n 249: checkcast #187 // class java/lang/Iterable\n 252: astore_1\n 253: nop\n 254: iconst_0\n 255: istore_2\n 256: aload_1\n 257: astore_3\n 258: new #189 // class java/util/ArrayList\n 261: dup\n 262: aload_1\n 263: bipush 10\n 265: invokestatic #193 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 268: invokespecial #195 // Method java/util/ArrayList.\"<init>\":(I)V\n 271: checkcast #197 // class java/util/Collection\n 274: astore 4\n 276: iconst_0\n 277: istore 5\n 279: aload_3\n 280: invokeinterface #198, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 285: astore 6\n 287: aload 6\n 289: invokeinterface #133, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 294: ifeq 337\n 297: aload 6\n 299: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 304: astore 7\n 306: aload 4\n 308: aload 7\n 310: checkcast #216 // class java/util/List\n 313: astore 8\n 315: astore 20\n 317: iconst_0\n 318: istore 9\n 320: aload 8\n 322: invokestatic #220 // Method toPair:(Ljava/util/List;)Lkotlin/Pair;\n 325: aload 20\n 327: swap\n 328: invokeinterface #214, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 333: pop\n 334: goto 287\n 337: aload 4\n 339: checkcast #216 // class java/util/List\n 342: nop\n 343: invokestatic #220 // Method toPair:(Ljava/util/List;)Lkotlin/Pair;\n 346: areturn\n\n public static final <T> kotlin.Pair<T, T> toPair(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #236 // String <this>\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #139 // class kotlin/Pair\n 9: dup\n 10: aload_0\n 11: iconst_0\n 12: invokeinterface #240, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 17: aload_0\n 18: iconst_1\n 19: invokeinterface #240, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 24: invokespecial #243 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 27: areturn\n\n public static final boolean contains(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #236 // String <this>\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #247 // String that\n 9: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 16: checkcast #249 // class java/lang/Number\n 19: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 22: aload_1\n 23: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 26: checkcast #249 // class java/lang/Number\n 29: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 32: if_icmpgt 62\n 35: aload_0\n 36: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 39: checkcast #249 // class java/lang/Number\n 42: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 45: aload_1\n 46: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 49: checkcast #249 // class java/lang/Number\n 52: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 55: if_icmplt 62\n 58: iconst_1\n 59: goto 63\n 62: iconst_0\n 63: ireturn\n\n public static final boolean overlaps(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #236 // String <this>\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #247 // String that\n 9: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 16: checkcast #249 // class java/lang/Number\n 19: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 22: aload_1\n 23: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 26: checkcast #249 // class java/lang/Number\n 29: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 32: if_icmpgt 58\n 35: aload_0\n 36: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 39: checkcast #249 // class java/lang/Number\n 42: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 45: aload_1\n 46: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 49: checkcast #249 // class java/lang/Number\n 52: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 55: if_icmpge 104\n 58: aload_0\n 59: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 62: checkcast #249 // class java/lang/Number\n 65: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 68: aload_1\n 69: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 72: checkcast #249 // class java/lang/Number\n 75: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 78: if_icmplt 108\n 81: aload_0\n 82: invokevirtual #142 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 85: checkcast #249 // class java/lang/Number\n 88: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 91: aload_1\n 92: invokevirtual #145 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 95: checkcast #249 // class java/lang/Number\n 98: invokevirtual #253 // Method java/lang/Number.intValue:()I\n 101: if_icmpgt 108\n 104: iconst_1\n 105: goto 109\n 108: iconst_0\n 109: ireturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #258 // Method main:()V\n 3: return\n\n private static final kotlin.Pair computeFullOverlaps$lambda$1(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #173 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #262 // Method toPairs:(Ljava/lang/String;)Lkotlin/Pair;\n 10: areturn\n\n private static final kotlin.Pair computeOverlaps$lambda$3(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #173 // String it\n 3: invokestatic #98 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #262 // Method toPairs:(Ljava/lang/String;)Lkotlin/Pair;\n 10: areturn\n}\n", "javap_err": "" } ]
amitdev__advent_2022__b2cb4ec/src/main/kotlin/Day5.kt
fun solve(lines: Sequence<String>, part1: Boolean) = lines.fold(Input()) { acc, line -> acc.merge(acc.parse(line)) } .arrangeCrates() .rearrange(part1) .top() data class Input( val crates: Map<Int, List<String>> = mapOf(), val instructions: List<Instruction> = listOf(), private val parsedCrates: Boolean = false) { fun merge(that: Input) = when { parsedCrates -> copy(instructions = instructions + that.instructions) that.parsedCrates -> copy(parsedCrates = true) else -> Input( (this.crates.keys + that.crates.keys).associateWith { this.crates.getOrDefault(it, listOf()) + that.crates.getValue(it) }) } fun arrangeCrates() = copy( crates = crates.mapValues { it.value.filter { it.startsWith("[") } .map { it.substring(1,2) } } ) fun parse(line: String) = when { line.isBlank() -> Input(parsedCrates = true) parsedCrates -> Input(instructions = parseInstruction(line)) else -> Input(parseCrate(line)) } private fun parseInstruction(line: String) = listOf(line.split(" ").toInstruction()) fun parseCrate(line: String) = line.chunked(4).withIndex().associate { v -> (v.index + 1) to listOf(v.value.trim()) } fun rearrange(inOrder: Boolean) = instructions.fold(crates) { acc, next -> acc.mapValues { when (it.key) { next.from -> it.value.subList(next.count, it.value.size) next.to -> acc.getValue(next.from).subList(0, next.count).let { if (inOrder) it.reversed() else it } + it.value else -> it.value }}} } fun Map<Int, List<String>>.top() = values.mapNotNull { it.firstOrNull() }.joinToString("") private fun List<String>.toInstruction() = Instruction(this[1].toInt(), this[3].toInt(), this[5].toInt()) data class Instruction(val count: Int, val from: Int, val to: Int)
[ { "class_path": "amitdev__advent_2022__b2cb4ec/Day5Kt.class", "javap": "Compiled from \"Day5.kt\"\npublic final class Day5Kt {\n public static final java.lang.String solve(kotlin.sequences.Sequence<java.lang.String>, boolean);\n Code:\n 0: aload_0\n 1: ldc #10 // String lines\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_2\n 8: new #18 // class Input\n 11: dup\n 12: aconst_null\n 13: aconst_null\n 14: iconst_0\n 15: bipush 7\n 17: aconst_null\n 18: invokespecial #22 // Method Input.\"<init>\":(Ljava/util/Map;Ljava/util/List;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 21: astore_3\n 22: iconst_0\n 23: istore 4\n 25: aload_3\n 26: astore 5\n 28: aload_2\n 29: invokeinterface #28, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 34: astore 6\n 36: aload 6\n 38: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 43: ifeq 86\n 46: aload 6\n 48: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 53: astore 7\n 55: aload 5\n 57: aload 7\n 59: checkcast #40 // class java/lang/String\n 62: astore 8\n 64: astore 9\n 66: iconst_0\n 67: istore 10\n 69: aload 9\n 71: aload 9\n 73: aload 8\n 75: invokevirtual #44 // Method Input.parse:(Ljava/lang/String;)LInput;\n 78: invokevirtual #48 // Method Input.merge:(LInput;)LInput;\n 81: astore 5\n 83: goto 36\n 86: aload 5\n 88: invokevirtual #52 // Method Input.arrangeCrates:()LInput;\n 91: iload_1\n 92: invokevirtual #56 // Method Input.rearrange:(Z)Ljava/util/Map;\n 95: invokestatic #60 // Method top:(Ljava/util/Map;)Ljava/lang/String;\n 98: areturn\n\n public static final java.lang.String top(java.util.Map<java.lang.Integer, ? extends java.util.List<java.lang.String>>);\n Code:\n 0: aload_0\n 1: ldc #78 // String <this>\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #84, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 12: checkcast #86 // class java/lang/Iterable\n 15: astore_1\n 16: iconst_0\n 17: istore_2\n 18: aload_1\n 19: astore_3\n 20: new #88 // class java/util/ArrayList\n 23: dup\n 24: invokespecial #91 // Method java/util/ArrayList.\"<init>\":()V\n 27: checkcast #93 // class java/util/Collection\n 30: astore 4\n 32: iconst_0\n 33: istore 5\n 35: aload_3\n 36: astore 6\n 38: iconst_0\n 39: istore 7\n 41: aload 6\n 43: invokeinterface #94, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 8\n 50: aload 8\n 52: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 121\n 60: aload 8\n 62: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 9\n 69: aload 9\n 71: astore 10\n 73: iconst_0\n 74: istore 11\n 76: aload 10\n 78: checkcast #96 // class java/util/List\n 81: astore 12\n 83: iconst_0\n 84: istore 13\n 86: aload 12\n 88: invokestatic #102 // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 91: checkcast #40 // class java/lang/String\n 94: dup\n 95: ifnull 116\n 98: astore 14\n 100: iconst_0\n 101: istore 15\n 103: aload 4\n 105: aload 14\n 107: invokeinterface #106, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 112: pop\n 113: goto 117\n 116: pop\n 117: nop\n 118: goto 50\n 121: nop\n 122: aload 4\n 124: checkcast #96 // class java/util/List\n 127: nop\n 128: checkcast #86 // class java/lang/Iterable\n 131: ldc #108 // String\n 133: checkcast #110 // class java/lang/CharSequence\n 136: aconst_null\n 137: aconst_null\n 138: iconst_0\n 139: aconst_null\n 140: aconst_null\n 141: bipush 62\n 143: aconst_null\n 144: invokestatic #114 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 147: areturn\n\n private static final Instruction toInstruction(java.util.List<java.lang.String>);\n Code:\n 0: new #138 // class Instruction\n 3: dup\n 4: aload_0\n 5: iconst_1\n 6: invokeinterface #142, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 11: checkcast #40 // class java/lang/String\n 14: invokestatic #148 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 17: aload_0\n 18: iconst_3\n 19: invokeinterface #142, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 24: checkcast #40 // class java/lang/String\n 27: invokestatic #148 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 30: aload_0\n 31: iconst_5\n 32: invokeinterface #142, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 37: checkcast #40 // class java/lang/String\n 40: invokestatic #148 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 43: invokespecial #151 // Method Instruction.\"<init>\":(III)V\n 46: areturn\n\n public static final Instruction access$toInstruction(java.util.List);\n Code:\n 0: aload_0\n 1: invokestatic #155 // Method toInstruction:(Ljava/util/List;)LInstruction;\n 4: areturn\n}\n", "javap_err": "" } ]
jorgensta__AdventOfCode2021__5e296aa/day3/src/main/kotlin/main.kt
import java.io.File fun parseFileAndGetInput(): List<String> { val filepath = "/Users/jorgenstamnes/Documents/own/AdventOfCode2021/day3/src/main/kotlin/input.txt" return File(filepath).readLines(Charsets.UTF_8).toList() } fun first() { val inputs = parseFileAndGetInput() val one = '1' val zero = '0' var gammaRateBits: String = "" var epsilonRateBits: String = "" val lengthOfBits = "110111100101".length for (i in 0 until lengthOfBits) { var numberOf0s = 0 var numberOf1s = 0 inputs.forEach { bits -> val bit: Char = bits[i] if (bit == '1') { numberOf1s += 1 } if (bit == '0') { numberOf0s += 1 } } if (numberOf1s > numberOf0s) { gammaRateBits += one epsilonRateBits += zero } if (numberOf0s > numberOf1s) { gammaRateBits += zero epsilonRateBits += one } println("1s: $numberOf1s, gammaRate: $gammaRateBits") println("0s: $numberOf0s") } val powerConsumption = Integer.parseInt(epsilonRateBits, 2) * Integer.parseInt(gammaRateBits, 2) println("Power consumption: $powerConsumption") } fun getBitCountAtPosition(inputs: List<String>, position: Int): Pair<Int, Int> { var numberOf0s = 0 var numberOf1s = 0 inputs.forEach { bits -> val bit: Char = bits[position] if (bit == '1') { numberOf1s += 1 } if (bit == '0') { numberOf0s += 1 } } return Pair(numberOf1s, numberOf0s) } fun getRecursiveAnswer(inputs: List<String>, position: Int, searchForFewest: Boolean = false): List<String> { if (inputs.size == 1) return inputs val (oneCount, zeroCount) = getBitCountAtPosition(inputs, position) if (oneCount == zeroCount) { return getRecursiveAnswer( inputs.filter { when (searchForFewest) { false -> it[position] != '1' else -> it[position] != '0' } }, position + 1, searchForFewest ) } if (oneCount > zeroCount) { return getRecursiveAnswer( inputs.filter { when (searchForFewest) { false -> it[position] != '1' else -> it[position] != '0' } }, position + 1, searchForFewest ) } return getRecursiveAnswer( inputs.filter { when (searchForFewest) { false -> it[position] != '0' true -> it[position] != '1' } }, position + 1, searchForFewest ) } fun second() { val inputs = parseFileAndGetInput() var oxygenList = mutableListOf<String>() var co2List = mutableListOf<String>() oxygenList.addAll(inputs) co2List.addAll(inputs) val oxygen = getRecursiveAnswer(oxygenList, 0) val co2 = getRecursiveAnswer(co2List, 0, true) println("OxygenList: $oxygen") println("co2List: $co2") println("Answer: ${Integer.parseInt(oxygen[0], 2) * Integer.parseInt(co2[0], 2)}") } fun main() { // first() second() }
[ { "class_path": "jorgensta__AdventOfCode2021__5e296aa/MainKt.class", "javap": "Compiled from \"main.kt\"\npublic final class MainKt {\n public static final java.util.List<java.lang.String> parseFileAndGetInput();\n Code:\n 0: ldc #10 // String /Users/jorgenstamnes/Documents/own/AdventOfCode2021/day3/src/main/kotlin/input.txt\n 2: astore_0\n 3: new #12 // class java/io/File\n 6: dup\n 7: aload_0\n 8: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 11: getstatic #22 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 14: invokestatic #28 // Method kotlin/io/FilesKt.readLines:(Ljava/io/File;Ljava/nio/charset/Charset;)Ljava/util/List;\n 17: checkcast #30 // class java/lang/Iterable\n 20: invokestatic #36 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 23: areturn\n\n public static final void first();\n Code:\n 0: invokestatic #42 // Method parseFileAndGetInput:()Ljava/util/List;\n 3: astore_0\n 4: bipush 49\n 6: istore_1\n 7: bipush 48\n 9: istore_2\n 10: ldc #44 // String\n 12: astore_3\n 13: ldc #44 // String\n 15: astore 4\n 17: bipush 12\n 19: istore 5\n 21: iconst_0\n 22: istore 6\n 24: iload 6\n 26: iload 5\n 28: if_icmpge 288\n 31: iconst_0\n 32: istore 7\n 34: iconst_0\n 35: istore 8\n 37: aload_0\n 38: checkcast #30 // class java/lang/Iterable\n 41: astore 9\n 43: iconst_0\n 44: istore 10\n 46: aload 9\n 48: invokeinterface #48, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 53: astore 11\n 55: aload 11\n 57: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 62: ifeq 124\n 65: aload 11\n 67: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 72: astore 12\n 74: aload 12\n 76: checkcast #60 // class java/lang/String\n 79: astore 13\n 81: iconst_0\n 82: istore 14\n 84: aload 13\n 86: iload 6\n 88: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 91: istore 15\n 93: iload 15\n 95: bipush 49\n 97: if_icmpne 106\n 100: iload 8\n 102: iconst_1\n 103: iadd\n 104: istore 8\n 106: iload 15\n 108: bipush 48\n 110: if_icmpne 119\n 113: iload 7\n 115: iconst_1\n 116: iadd\n 117: istore 7\n 119: nop\n 120: nop\n 121: goto 55\n 124: nop\n 125: iload 8\n 127: iload 7\n 129: if_icmple 172\n 132: new #66 // class java/lang/StringBuilder\n 135: dup\n 136: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 139: aload_3\n 140: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 143: iload_1\n 144: invokevirtual #75 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 147: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 150: astore_3\n 151: new #66 // class java/lang/StringBuilder\n 154: dup\n 155: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 158: aload 4\n 160: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 163: iload_2\n 164: invokevirtual #75 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 167: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 170: astore 4\n 172: iload 7\n 174: iload 8\n 176: if_icmple 219\n 179: new #66 // class java/lang/StringBuilder\n 182: dup\n 183: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 186: aload_3\n 187: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 190: iload_2\n 191: invokevirtual #75 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 194: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 197: astore_3\n 198: new #66 // class java/lang/StringBuilder\n 201: dup\n 202: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 205: aload 4\n 207: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 210: iload_1\n 211: invokevirtual #75 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 214: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 217: astore 4\n 219: new #66 // class java/lang/StringBuilder\n 222: dup\n 223: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 226: ldc #81 // String 1s:\n 228: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 231: iload 8\n 233: invokevirtual #84 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 236: ldc #86 // String , gammaRate:\n 238: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 241: aload_3\n 242: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 245: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 248: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 251: swap\n 252: invokevirtual #98 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 255: new #66 // class java/lang/StringBuilder\n 258: dup\n 259: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 262: ldc #100 // String 0s:\n 264: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 267: iload 7\n 269: invokevirtual #84 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 272: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 275: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 278: swap\n 279: invokevirtual #98 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 282: iinc 6, 1\n 285: goto 24\n 288: aload 4\n 290: iconst_2\n 291: invokestatic #106 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 294: aload_3\n 295: iconst_2\n 296: invokestatic #106 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 299: imul\n 300: istore 6\n 302: new #66 // class java/lang/StringBuilder\n 305: dup\n 306: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 309: ldc #108 // String Power consumption:\n 311: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 314: iload 6\n 316: invokevirtual #84 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 319: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 322: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 325: swap\n 326: invokevirtual #98 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 329: return\n\n public static final kotlin.Pair<java.lang.Integer, java.lang.Integer> getBitCountAtPosition(java.util.List<java.lang.String>, int);\n Code:\n 0: aload_0\n 1: ldc #135 // String inputs\n 3: invokestatic #141 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_0\n 7: istore_2\n 8: iconst_0\n 9: istore_3\n 10: aload_0\n 11: checkcast #30 // class java/lang/Iterable\n 14: astore 4\n 16: iconst_0\n 17: istore 5\n 19: aload 4\n 21: invokeinterface #48, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 26: astore 6\n 28: aload 6\n 30: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 35: ifeq 92\n 38: aload 6\n 40: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 45: astore 7\n 47: aload 7\n 49: checkcast #60 // class java/lang/String\n 52: astore 8\n 54: iconst_0\n 55: istore 9\n 57: aload 8\n 59: iload_1\n 60: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 63: istore 10\n 65: iload 10\n 67: bipush 49\n 69: if_icmpne 76\n 72: iload_3\n 73: iconst_1\n 74: iadd\n 75: istore_3\n 76: iload 10\n 78: bipush 48\n 80: if_icmpne 87\n 83: iload_2\n 84: iconst_1\n 85: iadd\n 86: istore_2\n 87: nop\n 88: nop\n 89: goto 28\n 92: nop\n 93: new #143 // class kotlin/Pair\n 96: dup\n 97: iload_3\n 98: invokestatic #147 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 101: iload_2\n 102: invokestatic #147 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 105: invokespecial #150 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 108: areturn\n\n public static final java.util.List<java.lang.String> getRecursiveAnswer(java.util.List<java.lang.String>, int, boolean);\n Code:\n 0: aload_0\n 1: ldc #135 // String inputs\n 3: invokestatic #141 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #159, 1 // InterfaceMethod java/util/List.size:()I\n 12: iconst_1\n 13: if_icmpne 18\n 16: aload_0\n 17: areturn\n 18: aload_0\n 19: iload_1\n 20: invokestatic #161 // Method getBitCountAtPosition:(Ljava/util/List;I)Lkotlin/Pair;\n 23: astore_3\n 24: aload_3\n 25: invokevirtual #164 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 28: checkcast #166 // class java/lang/Number\n 31: invokevirtual #169 // Method java/lang/Number.intValue:()I\n 34: istore 4\n 36: aload_3\n 37: invokevirtual #172 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 40: checkcast #166 // class java/lang/Number\n 43: invokevirtual #169 // Method java/lang/Number.intValue:()I\n 46: istore 5\n 48: iload 4\n 50: iload 5\n 52: if_icmpne 191\n 55: aload_0\n 56: checkcast #30 // class java/lang/Iterable\n 59: astore 6\n 61: iconst_0\n 62: istore 7\n 64: aload 6\n 66: astore 8\n 68: new #174 // class java/util/ArrayList\n 71: dup\n 72: invokespecial #175 // Method java/util/ArrayList.\"<init>\":()V\n 75: checkcast #177 // class java/util/Collection\n 78: astore 9\n 80: iconst_0\n 81: istore 10\n 83: aload 8\n 85: invokeinterface #48, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 90: astore 11\n 92: aload 11\n 94: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 99: ifeq 177\n 102: aload 11\n 104: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 109: astore 12\n 111: aload 12\n 113: checkcast #60 // class java/lang/String\n 116: astore 13\n 118: iconst_0\n 119: istore 14\n 121: iload_2\n 122: ifne 144\n 125: aload 13\n 127: iload_1\n 128: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 131: bipush 49\n 133: if_icmpeq 140\n 136: iconst_1\n 137: goto 160\n 140: iconst_0\n 141: goto 160\n 144: aload 13\n 146: iload_1\n 147: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 150: bipush 48\n 152: if_icmpeq 159\n 155: iconst_1\n 156: goto 160\n 159: iconst_0\n 160: nop\n 161: ifeq 92\n 164: aload 9\n 166: aload 12\n 168: invokeinterface #181, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 173: pop\n 174: goto 92\n 177: aload 9\n 179: checkcast #131 // class java/util/List\n 182: nop\n 183: iload_1\n 184: iconst_1\n 185: iadd\n 186: iload_2\n 187: invokestatic #183 // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;\n 190: areturn\n 191: iload 4\n 193: iload 5\n 195: if_icmple 334\n 198: aload_0\n 199: checkcast #30 // class java/lang/Iterable\n 202: astore 6\n 204: iconst_0\n 205: istore 7\n 207: aload 6\n 209: astore 8\n 211: new #174 // class java/util/ArrayList\n 214: dup\n 215: invokespecial #175 // Method java/util/ArrayList.\"<init>\":()V\n 218: checkcast #177 // class java/util/Collection\n 221: astore 9\n 223: iconst_0\n 224: istore 10\n 226: aload 8\n 228: invokeinterface #48, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 233: astore 11\n 235: aload 11\n 237: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 242: ifeq 320\n 245: aload 11\n 247: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 252: astore 12\n 254: aload 12\n 256: checkcast #60 // class java/lang/String\n 259: astore 13\n 261: iconst_0\n 262: istore 14\n 264: iload_2\n 265: ifne 287\n 268: aload 13\n 270: iload_1\n 271: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 274: bipush 49\n 276: if_icmpeq 283\n 279: iconst_1\n 280: goto 303\n 283: iconst_0\n 284: goto 303\n 287: aload 13\n 289: iload_1\n 290: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 293: bipush 48\n 295: if_icmpeq 302\n 298: iconst_1\n 299: goto 303\n 302: iconst_0\n 303: nop\n 304: ifeq 235\n 307: aload 9\n 309: aload 12\n 311: invokeinterface #181, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 316: pop\n 317: goto 235\n 320: aload 9\n 322: checkcast #131 // class java/util/List\n 325: nop\n 326: iload_1\n 327: iconst_1\n 328: iadd\n 329: iload_2\n 330: invokestatic #183 // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;\n 333: areturn\n 334: aload_0\n 335: checkcast #30 // class java/lang/Iterable\n 338: astore 6\n 340: iconst_0\n 341: istore 7\n 343: aload 6\n 345: astore 8\n 347: new #174 // class java/util/ArrayList\n 350: dup\n 351: invokespecial #175 // Method java/util/ArrayList.\"<init>\":()V\n 354: checkcast #177 // class java/util/Collection\n 357: astore 9\n 359: iconst_0\n 360: istore 10\n 362: aload 8\n 364: invokeinterface #48, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 369: astore 11\n 371: aload 11\n 373: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 378: ifeq 477\n 381: aload 11\n 383: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 388: astore 12\n 390: aload 12\n 392: checkcast #60 // class java/lang/String\n 395: astore 13\n 397: iconst_0\n 398: istore 14\n 400: iload_2\n 401: istore 15\n 403: iload 15\n 405: ifne 427\n 408: aload 13\n 410: iload_1\n 411: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 414: bipush 48\n 416: if_icmpeq 423\n 419: iconst_1\n 420: goto 460\n 423: iconst_0\n 424: goto 460\n 427: iload 15\n 429: iconst_1\n 430: if_icmpne 452\n 433: aload 13\n 435: iload_1\n 436: invokevirtual #64 // Method java/lang/String.charAt:(I)C\n 439: bipush 49\n 441: if_icmpeq 448\n 444: iconst_1\n 445: goto 460\n 448: iconst_0\n 449: goto 460\n 452: new #185 // class kotlin/NoWhenBranchMatchedException\n 455: dup\n 456: invokespecial #186 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 459: athrow\n 460: nop\n 461: ifeq 371\n 464: aload 9\n 466: aload 12\n 468: invokeinterface #181, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 473: pop\n 474: goto 371\n 477: aload 9\n 479: checkcast #131 // class java/util/List\n 482: nop\n 483: iload_1\n 484: iconst_1\n 485: iadd\n 486: iload_2\n 487: invokestatic #183 // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;\n 490: areturn\n\n public static java.util.List getRecursiveAnswer$default(java.util.List, int, boolean, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_4\n 2: iand\n 3: ifeq 8\n 6: iconst_0\n 7: istore_2\n 8: aload_0\n 9: iload_1\n 10: iload_2\n 11: invokestatic #183 // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;\n 14: areturn\n\n public static final void second();\n Code:\n 0: invokestatic #42 // Method parseFileAndGetInput:()Ljava/util/List;\n 3: astore_0\n 4: new #174 // class java/util/ArrayList\n 7: dup\n 8: invokespecial #175 // Method java/util/ArrayList.\"<init>\":()V\n 11: checkcast #131 // class java/util/List\n 14: astore_1\n 15: new #174 // class java/util/ArrayList\n 18: dup\n 19: invokespecial #175 // Method java/util/ArrayList.\"<init>\":()V\n 22: checkcast #131 // class java/util/List\n 25: astore_2\n 26: aload_1\n 27: aload_0\n 28: checkcast #177 // class java/util/Collection\n 31: invokeinterface #208, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 36: pop\n 37: aload_2\n 38: aload_0\n 39: checkcast #177 // class java/util/Collection\n 42: invokeinterface #208, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 47: pop\n 48: aload_1\n 49: iconst_0\n 50: iconst_0\n 51: iconst_4\n 52: aconst_null\n 53: invokestatic #210 // Method getRecursiveAnswer$default:(Ljava/util/List;IZILjava/lang/Object;)Ljava/util/List;\n 56: astore_3\n 57: aload_2\n 58: iconst_0\n 59: iconst_1\n 60: invokestatic #183 // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;\n 63: astore 4\n 65: new #66 // class java/lang/StringBuilder\n 68: dup\n 69: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 72: ldc #212 // String OxygenList:\n 74: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 77: aload_3\n 78: invokevirtual #215 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 81: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 84: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 87: swap\n 88: invokevirtual #98 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 91: new #66 // class java/lang/StringBuilder\n 94: dup\n 95: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 98: ldc #217 // String co2List:\n 100: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 103: aload 4\n 105: invokevirtual #215 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 108: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 111: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 114: swap\n 115: invokevirtual #98 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 118: new #66 // class java/lang/StringBuilder\n 121: dup\n 122: invokespecial #68 // Method java/lang/StringBuilder.\"<init>\":()V\n 125: ldc #219 // String Answer:\n 127: invokevirtual #72 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 130: aload_3\n 131: iconst_0\n 132: invokeinterface #223, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 137: checkcast #60 // class java/lang/String\n 140: iconst_2\n 141: invokestatic #106 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 144: aload 4\n 146: iconst_0\n 147: invokeinterface #223, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 152: checkcast #60 // class java/lang/String\n 155: iconst_2\n 156: invokestatic #106 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 159: imul\n 160: invokevirtual #84 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 163: invokevirtual #79 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 166: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 169: swap\n 170: invokevirtual #98 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 173: return\n\n public static final void main();\n Code:\n 0: invokestatic #230 // Method second:()V\n 3: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #233 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
mattfrsn__kotlinAdvent2022__f179410/src/Day04.kt
import java.io.File fun main() { fun part1(input: List<String>): Int { val ranges = input.map { elfAssignments -> elfAssignments.asRanges() } return ranges.count { it.first.fullyOverlaps(it.second) || it.second.fullyOverlaps(it.first) } } fun part2(input: List<String>): Int { val ranges = input.map { elfAssignments -> elfAssignments.asRanges() } return ranges.count { it.first.overlaps(it.second) || it.second.overlaps(it.first) } } val input = File("src/input.txt").readLines() println(part1(input)) println(part2(input)) } private infix fun IntRange.fullyOverlaps(otherRange: IntRange): Boolean = first <= otherRange.first && last >= otherRange.last private infix fun IntRange.overlaps(otherRange: IntRange): Boolean = first <= otherRange.last && otherRange.first <= last private fun String.asIntRange(): IntRange = substringBefore("-").toInt()..substringAfter("-").toInt() private fun String.asRanges(): Pair<IntRange, IntRange> = substringBefore(",").asIntRange() to substringAfter(",").asIntRange()
[ { "class_path": "mattfrsn__kotlinAdvent2022__f179410/Day04Kt.class", "javap": "Compiled from \"Day04.kt\"\npublic final class Day04Kt {\n public static final void main();\n Code:\n 0: new #8 // class java/io/File\n 3: dup\n 4: ldc #10 // String src/input.txt\n 6: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: aconst_null\n 10: iconst_1\n 11: aconst_null\n 12: invokestatic #20 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 15: astore_0\n 16: aload_0\n 17: invokestatic #24 // Method main$part1:(Ljava/util/List;)I\n 20: istore_1\n 21: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 24: iload_1\n 25: invokevirtual #36 // Method java/io/PrintStream.println:(I)V\n 28: aload_0\n 29: invokestatic #39 // Method main$part2:(Ljava/util/List;)I\n 32: istore_1\n 33: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 36: iload_1\n 37: invokevirtual #36 // Method java/io/PrintStream.println:(I)V\n 40: return\n\n private static final boolean fullyOverlaps(kotlin.ranges.IntRange, kotlin.ranges.IntRange);\n Code:\n 0: aload_0\n 1: invokevirtual #49 // Method kotlin/ranges/IntRange.getFirst:()I\n 4: aload_1\n 5: invokevirtual #49 // Method kotlin/ranges/IntRange.getFirst:()I\n 8: if_icmpgt 26\n 11: aload_0\n 12: invokevirtual #52 // Method kotlin/ranges/IntRange.getLast:()I\n 15: aload_1\n 16: invokevirtual #52 // Method kotlin/ranges/IntRange.getLast:()I\n 19: if_icmplt 26\n 22: iconst_1\n 23: goto 27\n 26: iconst_0\n 27: ireturn\n\n private static final boolean overlaps(kotlin.ranges.IntRange, kotlin.ranges.IntRange);\n Code:\n 0: aload_0\n 1: invokevirtual #49 // Method kotlin/ranges/IntRange.getFirst:()I\n 4: aload_1\n 5: invokevirtual #52 // Method kotlin/ranges/IntRange.getLast:()I\n 8: if_icmpgt 26\n 11: aload_1\n 12: invokevirtual #49 // Method kotlin/ranges/IntRange.getFirst:()I\n 15: aload_0\n 16: invokevirtual #52 // Method kotlin/ranges/IntRange.getLast:()I\n 19: if_icmpgt 26\n 22: iconst_1\n 23: goto 27\n 26: iconst_0\n 27: ireturn\n\n private static final kotlin.ranges.IntRange asIntRange(java.lang.String);\n Code:\n 0: new #45 // class kotlin/ranges/IntRange\n 3: dup\n 4: aload_0\n 5: ldc #61 // String -\n 7: aconst_null\n 8: iconst_2\n 9: aconst_null\n 10: invokestatic #67 // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;\n 13: invokestatic #73 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 16: aload_0\n 17: ldc #61 // String -\n 19: aconst_null\n 20: iconst_2\n 21: aconst_null\n 22: invokestatic #76 // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;\n 25: invokestatic #73 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 28: invokespecial #79 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 31: areturn\n\n private static final kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange> asRanges(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #86 // String ,\n 3: aconst_null\n 4: iconst_2\n 5: aconst_null\n 6: invokestatic #67 // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;\n 9: invokestatic #88 // Method asIntRange:(Ljava/lang/String;)Lkotlin/ranges/IntRange;\n 12: aload_0\n 13: ldc #86 // String ,\n 15: aconst_null\n 16: iconst_2\n 17: aconst_null\n 18: invokestatic #76 // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;\n 21: invokestatic #88 // Method asIntRange:(Ljava/lang/String;)Lkotlin/ranges/IntRange;\n 24: invokestatic #94 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 27: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #98 // Method main:()V\n 3: return\n\n private static final int main$part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: checkcast #103 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: astore 4\n 10: new #105 // class java/util/ArrayList\n 13: dup\n 14: aload_2\n 15: bipush 10\n 17: invokestatic #111 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 20: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 23: checkcast #115 // class java/util/Collection\n 26: astore 5\n 28: iconst_0\n 29: istore 6\n 31: aload 4\n 33: invokeinterface #119, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 38: astore 7\n 40: aload 7\n 42: invokeinterface #125, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 47: ifeq 90\n 50: aload 7\n 52: invokeinterface #129, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 57: astore 8\n 59: aload 5\n 61: aload 8\n 63: checkcast #131 // class java/lang/String\n 66: astore 9\n 68: astore 11\n 70: iconst_0\n 71: istore 10\n 73: aload 9\n 75: invokestatic #133 // Method asRanges:(Ljava/lang/String;)Lkotlin/Pair;\n 78: aload 11\n 80: swap\n 81: invokeinterface #137, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 86: pop\n 87: goto 40\n 90: aload 5\n 92: checkcast #139 // class java/util/List\n 95: nop\n 96: astore_1\n 97: aload_1\n 98: checkcast #103 // class java/lang/Iterable\n 101: astore_2\n 102: iconst_0\n 103: istore_3\n 104: aload_2\n 105: instanceof #115 // class java/util/Collection\n 108: ifeq 127\n 111: aload_2\n 112: checkcast #115 // class java/util/Collection\n 115: invokeinterface #142, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 120: ifeq 127\n 123: iconst_0\n 124: goto 235\n 127: iconst_0\n 128: istore 4\n 130: aload_2\n 131: invokeinterface #119, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 136: astore 5\n 138: aload 5\n 140: invokeinterface #125, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 145: ifeq 233\n 148: aload 5\n 150: invokeinterface #129, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 155: astore 6\n 157: aload 6\n 159: checkcast #144 // class kotlin/Pair\n 162: astore 7\n 164: iconst_0\n 165: istore 8\n 167: aload 7\n 169: invokevirtual #146 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 172: checkcast #45 // class kotlin/ranges/IntRange\n 175: aload 7\n 177: invokevirtual #149 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 180: checkcast #45 // class kotlin/ranges/IntRange\n 183: invokestatic #151 // Method fullyOverlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z\n 186: ifne 211\n 189: aload 7\n 191: invokevirtual #149 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 194: checkcast #45 // class kotlin/ranges/IntRange\n 197: aload 7\n 199: invokevirtual #146 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 202: checkcast #45 // class kotlin/ranges/IntRange\n 205: invokestatic #151 // Method fullyOverlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z\n 208: ifeq 215\n 211: iconst_1\n 212: goto 216\n 215: iconst_0\n 216: ifeq 138\n 219: iinc 4, 1\n 222: iload 4\n 224: ifge 138\n 227: invokestatic #154 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 230: goto 138\n 233: iload 4\n 235: ireturn\n\n private static final int main$part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: checkcast #103 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: astore 4\n 10: new #105 // class java/util/ArrayList\n 13: dup\n 14: aload_2\n 15: bipush 10\n 17: invokestatic #111 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 20: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 23: checkcast #115 // class java/util/Collection\n 26: astore 5\n 28: iconst_0\n 29: istore 6\n 31: aload 4\n 33: invokeinterface #119, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 38: astore 7\n 40: aload 7\n 42: invokeinterface #125, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 47: ifeq 90\n 50: aload 7\n 52: invokeinterface #129, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 57: astore 8\n 59: aload 5\n 61: aload 8\n 63: checkcast #131 // class java/lang/String\n 66: astore 9\n 68: astore 11\n 70: iconst_0\n 71: istore 10\n 73: aload 9\n 75: invokestatic #133 // Method asRanges:(Ljava/lang/String;)Lkotlin/Pair;\n 78: aload 11\n 80: swap\n 81: invokeinterface #137, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 86: pop\n 87: goto 40\n 90: aload 5\n 92: checkcast #139 // class java/util/List\n 95: nop\n 96: astore_1\n 97: aload_1\n 98: checkcast #103 // class java/lang/Iterable\n 101: astore_2\n 102: iconst_0\n 103: istore_3\n 104: aload_2\n 105: instanceof #115 // class java/util/Collection\n 108: ifeq 127\n 111: aload_2\n 112: checkcast #115 // class java/util/Collection\n 115: invokeinterface #142, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 120: ifeq 127\n 123: iconst_0\n 124: goto 235\n 127: iconst_0\n 128: istore 4\n 130: aload_2\n 131: invokeinterface #119, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 136: astore 5\n 138: aload 5\n 140: invokeinterface #125, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 145: ifeq 233\n 148: aload 5\n 150: invokeinterface #129, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 155: astore 6\n 157: aload 6\n 159: checkcast #144 // class kotlin/Pair\n 162: astore 7\n 164: iconst_0\n 165: istore 8\n 167: aload 7\n 169: invokevirtual #146 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 172: checkcast #45 // class kotlin/ranges/IntRange\n 175: aload 7\n 177: invokevirtual #149 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 180: checkcast #45 // class kotlin/ranges/IntRange\n 183: invokestatic #176 // Method overlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z\n 186: ifne 211\n 189: aload 7\n 191: invokevirtual #149 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 194: checkcast #45 // class kotlin/ranges/IntRange\n 197: aload 7\n 199: invokevirtual #146 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 202: checkcast #45 // class kotlin/ranges/IntRange\n 205: invokestatic #176 // Method overlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z\n 208: ifeq 215\n 211: iconst_1\n 212: goto 216\n 215: iconst_0\n 216: ifeq 138\n 219: iinc 4, 1\n 222: iload 4\n 224: ifge 138\n 227: invokestatic #154 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 230: goto 138\n 233: iload 4\n 235: ireturn\n}\n", "javap_err": "" } ]
mattfrsn__kotlinAdvent2022__f179410/src/Day02.kt
import java.io.File fun main() { val values = mapOf<String, Int>( "X" to 1, // pt1 Rock / 2 lose "Y" to 2, // pt1 Paper / 2 draw "Z" to 3 // pt1 Sissors / 2 win ) fun determineGameResult(theirs: String, mine: String): Int { return when(theirs.single() to mine.single()) { 'B' to 'X', 'C' to 'Y', 'A' to 'Z' -> 0 'B' to 'Y', 'C' to 'Z', 'A' to 'X' -> 3 'B' to 'Z', 'C' to 'X', 'A' to 'Y' -> 6 else -> error("Before you wreck yourself") } } fun determineGuess(game: List<String>): Char { val theirGuess = game[0].single() return when(game[1].single()) { 'X' -> // lose when(theirGuess){ 'B' -> 'X' 'C' -> 'Y' 'A' -> 'Z' else -> error("Check input") } 'Y' -> // draw when(theirGuess){ 'B' -> 'Y' 'C' -> 'Z' 'A' -> 'X' else -> error("Check input") } 'Z' -> // win when(theirGuess){ 'B' -> 'Z' 'C' -> 'X' 'A' -> 'Y' else -> error("Check input") } else -> error("Check your input") } } fun rockPaperSissors(input: List<String>, part: Int) { var score = 0 require(part in 1..2) { "part must be 1 or 2" } input.map { currentGame -> currentGame.split(" ").let { val myGuess = if(part == 1) it[1] else determineGuess(it).toString() val myScore = values[myGuess] ?: error("Check yourself") val gameScore = determineGameResult(it[0], myGuess) score += myScore + gameScore!! } } println(score) } val input = File("src/input.txt").readLines() rockPaperSissors(input, 1) rockPaperSissors(input, 2) }
[ { "class_path": "mattfrsn__kotlinAdvent2022__f179410/Day02Kt.class", "javap": "Compiled from \"Day02.kt\"\npublic final class Day02Kt {\n public static final void main();\n Code:\n 0: iconst_3\n 1: anewarray #8 // class kotlin/Pair\n 4: astore_1\n 5: aload_1\n 6: iconst_0\n 7: ldc #10 // String X\n 9: iconst_1\n 10: invokestatic #16 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 13: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 16: aastore\n 17: aload_1\n 18: iconst_1\n 19: ldc #24 // String Y\n 21: iconst_2\n 22: invokestatic #16 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 25: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 28: aastore\n 29: aload_1\n 30: iconst_2\n 31: ldc #26 // String Z\n 33: iconst_3\n 34: invokestatic #16 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 37: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 40: aastore\n 41: aload_1\n 42: invokestatic #32 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 45: astore_0\n 46: new #34 // class java/io/File\n 49: dup\n 50: ldc #36 // String src/input.txt\n 52: invokespecial #40 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 55: aconst_null\n 56: iconst_1\n 57: aconst_null\n 58: invokestatic #46 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 61: astore_1\n 62: aload_0\n 63: aload_1\n 64: iconst_1\n 65: invokestatic #50 // Method main$rockPaperSissors:(Ljava/util/Map;Ljava/util/List;I)V\n 68: aload_0\n 69: aload_1\n 70: iconst_2\n 71: invokestatic #50 // Method main$rockPaperSissors:(Ljava/util/Map;Ljava/util/List;I)V\n 74: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #57 // Method main:()V\n 3: return\n\n private static final int main$determineGameResult(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: checkcast #63 // class java/lang/CharSequence\n 4: invokestatic #69 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C\n 7: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 10: aload_1\n 11: checkcast #63 // class java/lang/CharSequence\n 14: invokestatic #69 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C\n 17: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 20: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 23: astore_2\n 24: aload_2\n 25: bipush 66\n 27: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 30: bipush 88\n 32: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 35: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 38: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 41: ifne 84\n 44: aload_2\n 45: bipush 67\n 47: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 50: bipush 89\n 52: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 55: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 58: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 61: ifne 84\n 64: aload_2\n 65: bipush 65\n 67: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 70: bipush 90\n 72: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 75: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 78: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 81: ifeq 88\n 84: iconst_0\n 85: goto 230\n 88: aload_2\n 89: bipush 66\n 91: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 94: bipush 89\n 96: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 99: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 102: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 105: ifne 148\n 108: aload_2\n 109: bipush 67\n 111: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 114: bipush 90\n 116: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 119: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 122: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 125: ifne 148\n 128: aload_2\n 129: bipush 65\n 131: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 134: bipush 88\n 136: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 139: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 142: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 145: ifeq 152\n 148: iconst_3\n 149: goto 230\n 152: aload_2\n 153: bipush 66\n 155: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 158: bipush 90\n 160: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 163: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 166: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 169: ifne 212\n 172: aload_2\n 173: bipush 67\n 175: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 178: bipush 88\n 180: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 183: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 186: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 189: ifne 212\n 192: aload_2\n 193: bipush 65\n 195: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 198: bipush 89\n 200: invokestatic #74 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 203: invokestatic #22 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 206: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 209: ifeq 217\n 212: bipush 6\n 214: goto 230\n 217: new #82 // class java/lang/IllegalStateException\n 220: dup\n 221: ldc #84 // String Before you wreck yourself\n 223: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 226: invokespecial #89 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 229: athrow\n 230: ireturn\n\n private static final char main$determineGuess(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: iconst_0\n 2: invokeinterface #101, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 7: checkcast #63 // class java/lang/CharSequence\n 10: invokestatic #69 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C\n 13: istore_1\n 14: aload_0\n 15: iconst_1\n 16: invokeinterface #101, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 21: checkcast #63 // class java/lang/CharSequence\n 24: invokestatic #69 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C\n 27: tableswitch { // 88 to 90\n 88: 52\n 89: 108\n 90: 164\n default: 220\n }\n 52: iload_1\n 53: tableswitch { // 65 to 67\n 65: 90\n 66: 80\n 67: 85\n default: 95\n }\n 80: bipush 88\n 82: goto 233\n 85: bipush 89\n 87: goto 233\n 90: bipush 90\n 92: goto 233\n 95: new #82 // class java/lang/IllegalStateException\n 98: dup\n 99: ldc #103 // String Check input\n 101: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 104: invokespecial #89 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 107: athrow\n 108: iload_1\n 109: tableswitch { // 65 to 67\n 65: 146\n 66: 136\n 67: 141\n default: 151\n }\n 136: bipush 89\n 138: goto 233\n 141: bipush 90\n 143: goto 233\n 146: bipush 88\n 148: goto 233\n 151: new #82 // class java/lang/IllegalStateException\n 154: dup\n 155: ldc #103 // String Check input\n 157: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 160: invokespecial #89 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 163: athrow\n 164: iload_1\n 165: tableswitch { // 65 to 67\n 65: 202\n 66: 192\n 67: 197\n default: 207\n }\n 192: bipush 90\n 194: goto 233\n 197: bipush 88\n 199: goto 233\n 202: bipush 89\n 204: goto 233\n 207: new #82 // class java/lang/IllegalStateException\n 210: dup\n 211: ldc #103 // String Check input\n 213: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 216: invokespecial #89 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 219: athrow\n 220: new #82 // class java/lang/IllegalStateException\n 223: dup\n 224: ldc #105 // String Check your input\n 226: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 229: invokespecial #89 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 232: athrow\n 233: ireturn\n\n private static final void main$rockPaperSissors(java.util.Map<java.lang.String, java.lang.Integer>, java.util.List<java.lang.String>, int);\n Code:\n 0: iconst_0\n 1: istore_3\n 2: iconst_1\n 3: iload_2\n 4: if_icmpgt 20\n 7: iload_2\n 8: iconst_3\n 9: if_icmpge 16\n 12: iconst_1\n 13: goto 21\n 16: iconst_0\n 17: goto 21\n 20: iconst_0\n 21: ifne 44\n 24: iconst_0\n 25: istore 5\n 27: ldc #111 // String part must be 1 or 2\n 29: astore 5\n 31: new #113 // class java/lang/IllegalArgumentException\n 34: dup\n 35: aload 5\n 37: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 40: invokespecial #114 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 43: athrow\n 44: aload_1\n 45: checkcast #116 // class java/lang/Iterable\n 48: astore 4\n 50: iconst_0\n 51: istore 5\n 53: aload 4\n 55: astore 6\n 57: new #118 // class java/util/ArrayList\n 60: dup\n 61: aload 4\n 63: bipush 10\n 65: invokestatic #124 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 68: invokespecial #127 // Method java/util/ArrayList.\"<init>\":(I)V\n 71: checkcast #129 // class java/util/Collection\n 74: astore 7\n 76: iconst_0\n 77: istore 8\n 79: aload 6\n 81: invokeinterface #133, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 86: astore 9\n 88: aload 9\n 90: invokeinterface #139, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 95: ifeq 262\n 98: aload 9\n 100: invokeinterface #143, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 105: astore 10\n 107: aload 7\n 109: aload 10\n 111: checkcast #145 // class java/lang/String\n 114: astore 11\n 116: astore 19\n 118: iconst_0\n 119: istore 12\n 121: aload 11\n 123: checkcast #63 // class java/lang/CharSequence\n 126: iconst_1\n 127: anewarray #145 // class java/lang/String\n 130: astore 13\n 132: aload 13\n 134: iconst_0\n 135: ldc #147 // String\n 137: aastore\n 138: aload 13\n 140: iconst_0\n 141: iconst_0\n 142: bipush 6\n 144: aconst_null\n 145: invokestatic #151 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 148: astore 14\n 150: iconst_0\n 151: istore 15\n 153: iload_2\n 154: iconst_1\n 155: if_icmpne 172\n 158: aload 14\n 160: iconst_1\n 161: invokeinterface #101, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 166: checkcast #145 // class java/lang/String\n 169: goto 180\n 172: aload 14\n 174: invokestatic #153 // Method main$determineGuess:(Ljava/util/List;)C\n 177: invokestatic #156 // Method java/lang/String.valueOf:(C)Ljava/lang/String;\n 180: astore 16\n 182: aload_0\n 183: aload 16\n 185: invokeinterface #161, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 190: checkcast #12 // class java/lang/Integer\n 193: dup\n 194: ifnull 203\n 197: invokevirtual #165 // Method java/lang/Integer.intValue:()I\n 200: goto 217\n 203: pop\n 204: new #82 // class java/lang/IllegalStateException\n 207: dup\n 208: ldc #167 // String Check yourself\n 210: invokevirtual #88 // Method java/lang/Object.toString:()Ljava/lang/String;\n 213: invokespecial #89 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 216: athrow\n 217: istore 17\n 219: aload 14\n 221: iconst_0\n 222: invokeinterface #101, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 227: checkcast #145 // class java/lang/String\n 230: aload 16\n 232: invokestatic #169 // Method main$determineGameResult:(Ljava/lang/String;Ljava/lang/String;)I\n 235: istore 18\n 237: iload_3\n 238: iload 17\n 240: iload 18\n 242: iadd\n 243: iadd\n 244: istore_3\n 245: nop\n 246: nop\n 247: nop\n 248: aload 19\n 250: getstatic #175 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 253: invokeinterface #179, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 258: pop\n 259: goto 88\n 262: aload 7\n 264: checkcast #97 // class java/util/List\n 267: nop\n 268: pop\n 269: iload_3\n 270: istore 4\n 272: getstatic #185 // Field java/lang/System.out:Ljava/io/PrintStream;\n 275: iload 4\n 277: invokevirtual #190 // Method java/io/PrintStream.println:(I)V\n 280: return\n}\n", "javap_err": "" } ]
mustajab-ikram__Kotlin_Tutorial__f3293e9/src/main/kotlin/CollectionFunctions.kt
fun main() { // #Remove Duplicate Strings // There are many ways to remove duplicate strings from an array: // Maintain the original order of items val devs = arrayOf("Amit", "Ali", "Amit", "Sumit", "Sumit", "Himanshu") println(devs.distinct()) // [Amit, Ali, Sumit, Himanshu] // Maintain the original order of items val devs2 = arrayOf("Amit", "Ali", "Amit", "Sumit", "Sumit", "Himanshu") println(devs2.toSet()) // [Amit, Ali, Sumit, Himanshu] // Maintain the original order of items val devs3 = arrayOf("Amit", "Ali", "Amit", "Sumit", "Sumit", "Himanshu") println(devs3.toMutableSet()) // [Amit, Ali, Sumit, Himanshu] // DO NOT Maintain the original order of items val devs4 = arrayOf("Amit", "Ali", "Amit", "Sumit", "Sumit", "Himanshu") println(devs4.toHashSet()) // [Amit, Ali, Sumit, Himanshu] // # Convert an array or list to a string // You can convert an array or list into a string by using joinToString.For example, if you are having a list of cities(Delhi, Mumbai, Bangalore), then you can convert that list into a string such as "India is one the best countries for tourism. You can visit Delhi, Mumbai, Bangalore, etc, and enjoy your holidays". Here, Delhi, Mumbai, Bangalore are the list items which you were having. val someKotlinCollectionFunctions = listOf( "distinct", "map", "isEmpty", "contains", "filter", "first", "last", "reduce", "single", "joinToString" ) val message = someKotlinCollectionFunctions.joinToString( separator = ", ", prefix = "Kotlin has many collection functions like: ", postfix = "and they are awesome.", limit = 3, truncated = "etc " ) println(message) // Kotlin has many collection functions like: distinct, map, isEmpty, etc and they are awesome. // # Transform a collection into a single result // If you want to transform a given collection into a single result, then you can use reduce function. For example, you can find the sum of all the elements present in a list: val numList2 = listOf(1, 2, 3, 4, 5) val result = numList2.reduce { result, item -> result + item } println(result) // 15 // NOTE: If the list is empty, then it will throw a RuntimeException // Find if all elements are satisfying a particular condition // If you have an array or list of data elements and you want to find whether or not all the elements are satisfying a particular condition, then you can use “all” in Kotlin. data class Users(val id: Int, val name: String, val isCricketLover: Boolean, val isFootballLover: Boolean) val user1 = Users(id = 1, name = "Amit", isCricketLover = true, isFootballLover = true) val user2 = Users(id = 2, name = "Ali", isCricketLover = true, isFootballLover = true) val user3 = Users(id = 3, name = "Sumit", isCricketLover = true, isFootballLover = false) val user4 = Users(id = 4, name = "Himanshu", isCricketLover = true, isFootballLover = false) val users2 = arrayOf(user1, user2, user3, user4) val allLoveCricket = users2.all { it.isCricketLover } println(allLoveCricket) // true val allLoveFootball = users2.all { it.isFootballLover } println(allLoveFootball) // false // Find a particular element based on a certain condition // You can find a particular element from a list of elements that is satisfying a particular condition by using find and single in Kotlin . For example, out of a list of students, you can find the student having roll number 5. // The find returns the first element matching the given condition or null if no such element was found.While single returns the single element matching the given condition or it will throw an exception if there are more than one matching element or no matching element in the list . data class User3(val id: Int, val name: String) val users3 = arrayOf( User3(1, "Amit"), User3(2, "Ali"), User3(3, "Sumit"), User3(4, "Himanshu") ) val userWithId3 = users3.single { it.id == 3 } println(userWithId3) // User(id=3, name=Sumit) val userWithId1 = users3.find { it.id == 1 } println(userWithId1) // User(id=1, name=Amit) // Break your list into multiple sublists of smaller size // There are many cases when you have a bigger list and you want to divide it into smaller parts and then perform some operation on those sublists.So, this can be easily achieved using the chunked function. val numList = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) val chunkedLists = numList.chunked(3) println(chunkedLists) // [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]] // Making copies of the array // You can make copies of your existing array by using various functions such as : // copyInto: This will replace the elements of one array into another array or it will throw an exception if the destination array can't hold the elements of the original array due to size constraints or the indexes are out of bounds. val arrayOne = arrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) val arrayTwo = arrayOf(11, 12, 13, 14, 15, 16, 17, 18, 19, 20) arrayOne.copyInto(destination = arrayTwo, destinationOffset = 2, startIndex = 0, endIndex = 4) arrayTwo.forEach { print("$it ") } // 11 12 1 2 3 4 17 18 19 20 // Similarly, there are other functions that can be used to copy the elements of an array. For example: // copyOfRange(fromIndex, toIndex): Returns a new array which is a copy of the specified range of the original array. // copyOf() or copyOf(newSize): Returns a new array which is a copy of the original array, resized to the given newSize, or if the newSize is not passed then the whole array will be copied. // Changing type of collection to other // Depending on the situation, you can change the type of collection. Here, either you can change the type of one collection to another type by making a new collection or by referring to the older one. For example: // toIntArray, toBooleanArray, toLongArray, toShortArray, toByteArray, toDoubleArray, toList, toMap, toSet, toPair, etc can be used to change the type of one collection to another type. var uIntArr = UIntArray(5) { 1U } var intArr = uIntArr.toIntArray() intArr[0] = 0 println(uIntArr.toList()) // [1, 1, 1, 1, 1] println(intArr.toList()) // [0, 1, 1, 1, 1] // Here, we are making a new collection and changes in the new collection will not be reflected in the older one. But, at the same time, you can change the type of collection by keeping the reference to the older one i.e. changes in one collection will automatically be reflected in the other. For this instead of to, we need to use as . For example: // asIntArray, asLongArray, asShortArray, asByteArray, asList, etc. var uIntArray = UIntArray(5) { 1U } var intArray = uIntArray.asIntArray() intArray[0] = 0 print(uIntArray.toList()) // [0, 1, 1, 1, 1] print(intArray.toList()) // [0, 1, 1, 1, 1] // Associating the data using some key // If you are having a list of data and you want to associate the data with the help of some key present in your data element, then you can use associateBy. data class Contact(val name: String, val phoneNumber: String) val contactList = listOf( Contact("Amit", "+9199XXXX1111"), Contact("Ali", "+9199XXXX2222"), Contact("Himanshu", "+9199XXXX3333"), Contact("Sumit", "+9199XXXX4444") ) //// val phoneNumberToContactMap = contactList.associateBy { it.phoneNumber } // println(phoneNumberToContactMap) //// Map with key: phoneNumber and value: Contact //// { //// +9199XXXX1111=Contact(name=Amit, phoneNumber=+9199XXXX1111), //// +9199XXXX2222=Contact(name=Ali, phoneNumber=+9199XXXX2222), //// +9199XXXX3333=Contact(name=Himanshu, phoneNumber=+9199XXXX3333), //// +9199XXXX4444=Contact(name=Sumit, phoneNumber=+9199XXXX4444) //// } /* In the above example, the key is phoneNumber and the value is Contact. If you don't want to have the whole Contact as the value, then you can simply pass the desired value like this: val phoneNumberToContactMap = contactList.associateBy({ it.phoneNumber }, { it.name }) print(phoneNumberToContactMap) */ // Map with key: phoneNumber and value: name // { // +9199XXXX1111=Amit, // +9199XXXX2222=Ali, // +9199XXXX3333=Himanshu, // +9199XXXX4444=Sumit} // } // Finding distinct elements in a collection // We can use the distinct function to get the list of unique elements of a collection . val list2 = listOf(1, 2, 2, 3, 3, 3, 4, 4, 4, 4) println(list2.distinct()) // [1, 2, 3, 4] // Union of collections // You can use the union function to get the unique elements of two collections . The order of the elements of both the collections will be preserved but the elements of the second collection will be added after the elements of the first collection . val listx = listOf(1, 2, 3, 3, 4, 5, 6) val listy = listOf(2, 2, 4, 5, 6, 7, 8) println(listx.union(listy)) // [1, 2, 3, 4, 5, 6, 7, 8] // Intersection of collections // To get the elements that are common in two collections, you can use the intersect function which returns a set containing the common element of both collections. val listxx = listOf(1, 2, 3, 3, 4, 5, 6) val listyy = listOf(2, 2, 4, 5, 6, 7, 8) println(listxx.intersect(listyy)) // [2, 4, 5, 6] // Keep the specified elements only // If in a collection, you want to keep the specified elements only then you can use retainAll function. Since this function will modify your list, so make sure that your list or array is mutable. // retainAll will return true if any element is removed from the collection otherwise it will return false. val listxxx = mutableListOf(1, 2, 3, 3, 4, 5, 6) val listyyy = listOf(1, 2, 3, 3, 4, 5, 6) val listzzz = listOf(1, 2, 3, 3, 4, 5, 7) println(listxxx.retainAll(listyyy)) // false println(listxxx.retainAll(listzzz)) // true println(listxxx) // [1, 2, 3, 3, 4, 5] // Similarly, you can use removeAll to remove all the elements of one collection that are present in another collection. // Filter a collection based on some condition // You can filter a collection based on certain conditions by using the filter.This returns a list containing elements that satisfy the given condition. val list4 = listOf(1, 2, 3, 4, 5, 6, 7, 8) val filteredLst = list4.filter { it % 2 == 0 } println(filteredLst) // [2, 4, 6, 8] // Similarly, you can filter the collection based on the index of elements by using filterIndexed. // If you want to store the filtered elements in some collection, then you can use the filterIndexedTo: val list5 = listOf(1, 2, 3, 4, 5, 6, 7, 8) val filteredList = mutableListOf<Int>() list4.filterIndexedTo(filteredList) { index, i -> list5[index] % 2 == 0 } println(filteredList) // [2, 4, 6, 8] // You can also find the elements that are instances of a specified type in a collection by using filterIsInstance. val mixedList = listOf(1, 2, 3, "one", "two", 4, "three", "four", 5, 6, "five", 7) val strList = mixedList.filterIsInstance<String>() println(strList) // [one, two, three, four, five] // Zip collections // zip returns a list of pairs . The first element of the pair will be taken from the first collection and the second element of the pair will be taken from the second collection . The size of the returned list will be equal to the size of the shortest collection. val listOne = listOf(1, 2, 3, 4, 5) val listTwo = listOf("a", "b", "c", "d", "e", "f") println(listOne zip listTwo) // [(1, a), (2, b), (3, c), (4, d), (5, e)] // Zip with next in a collection // zipWithNext return a list of pairs . The elements of the pair will be the adjacent elements of the collection . val list5_1 = listOf(1, 2, 3, 4, 5) println(list5_1.zipWithNext()) // [(1, 2), (2, 3), (3, 4), (4, 5)] // Unzip a collection // unzip returns a pair of lists . The first list is made from the first elements of each pair and the second list is made from the second element of each pair. val list6 = listOf("Amit" to 8, "Ali" to 10, "Sumit" to 4, "Himanshu" to 2) val (players, footballSkills) = list6.unzip() println(players) // [Amit, Ali, Sumit, Himanshu] println(footballSkills) // [8, 10, 4, 2] // Split array into two parts based on some condition // If you want to split your data into two parts based on some conditions like isFootballFan, then you can use partition. data class User(val id: Int, val name: String, val isFootballLover: Boolean) val users = listOf( User(1, "Amit", true), User(2, "Ali", true), User(3, "Sumit", false), User(4, "Himanshu", false) ) val (footballLovers, nonFootballLovers) = users.partition { it.isFootballLover } println(footballLovers) // [User(id=1, name=Amit, isFootballLover=true), User(id=2, name=Ali, isFootballLover=true)] println(nonFootballLovers) // [User(id=3, name=Sumit, isFootballLover=false), User(id=4, name=Himanshu, isFootballLover=false)] // Reverse a list // You can reverse a list in Kotlin by using the reversed and asReversed function . val list7 = listOf(1, 2, 3, 4, 5) print(list7.reversed()) // [5, 4, 3, 2, 1] print(list7.asReversed()) // [5, 4, 3, 2, 1] /* Both are giving the same output but these functions are different.The reversed () function can be applied on Array, List, and MutableList. It generates a new list that is the reverse of the original list. But the asReversed() function can be applied on List and MutableList.It doesn 't generate a new list because, after reversal, the new elements are still referring to the old one. So any change in one of them will result in a change in the other one. Similarly, there are other functions that can be used to reverse the elements such as reversedArray(), reverse(). */ // Group elements of a collection based on some condition // You can use groupBy () to group the elements of a collection based on certain conditions . For example, the below code will group the elements of the list based on the remainder when divided by 4 i.e. 4 groups will be there(when remainder = 0, 1, 2, and 3) val list8 = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) print(list8.groupBy { it % 4 }) // { // 1=[1, 5, 9], // 2=[2, 6, 10], // 3=[3, 7], // 0=[4, 8] // } // Sort element of a collection // You can sort the elements of a collection by using the sorted () function . This will return a sorted list. val list = listOf(10, 4, 1, 3, 7, 2, 6) println(list.sorted()) // [1, 2, 3, 4, 6, 7, 10] // Similarly, there are other functions that can be used to sort the collection based on certain conditions. Some of these functions are sortedArray, sortedArrayWith, sortedBy, sortedByDescending, sortedArraydescending, sortedWith, etc. }
[ { "class_path": "mustajab-ikram__Kotlin_Tutorial__f3293e9/CollectionFunctionsKt$main$User.class", "javap": "Compiled from \"CollectionFunctions.kt\"\npublic final class CollectionFunctionsKt$main$User {\n private final int id;\n\n private final java.lang.String name;\n\n private final boolean isFootballLover;\n\n public CollectionFunctionsKt$main$User(int, java.lang.String, boolean);\n Code:\n 0: aload_2\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #17 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: iload_1\n 12: putfield #21 // Field id:I\n 15: aload_0\n 16: aload_2\n 17: putfield #24 // Field name:Ljava/lang/String;\n 20: aload_0\n 21: iload_3\n 22: putfield #28 // Field isFootballLover:Z\n 25: return\n\n public final int getId();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: ireturn\n\n public final java.lang.String getName();\n Code:\n 0: aload_0\n 1: getfield #24 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final boolean isFootballLover();\n Code:\n 0: aload_0\n 1: getfield #28 // Field isFootballLover:Z\n 4: ireturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: ireturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #24 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final boolean component3();\n Code:\n 0: aload_0\n 1: getfield #28 // Field isFootballLover:Z\n 4: ireturn\n\n public final CollectionFunctionsKt$main$User copy(int, java.lang.String, boolean);\n Code:\n 0: aload_2\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class CollectionFunctionsKt$main$User\n 9: dup\n 10: iload_1\n 11: aload_2\n 12: iload_3\n 13: invokespecial #42 // Method \"<init>\":(ILjava/lang/String;Z)V\n 16: areturn\n\n public static CollectionFunctionsKt$main$User copy$default(CollectionFunctionsKt$main$User, int, java.lang.String, boolean, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #21 // Field id:I\n 11: istore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #24 // Field name:Ljava/lang/String;\n 23: astore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #28 // Field isFootballLover:Z\n 35: istore_3\n 36: aload_0\n 37: iload_1\n 38: aload_2\n 39: iload_3\n 40: invokevirtual #46 // Method copy:(ILjava/lang/String;Z)LCollectionFunctionsKt$main$User;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #49 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #50 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #52 // String User(id=\n 9: invokevirtual #56 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #21 // Field id:I\n 16: invokevirtual #59 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #61 // String , name=\n 21: invokevirtual #56 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #24 // Field name:Ljava/lang/String;\n 28: invokevirtual #56 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: ldc #63 // String , isFootballLover=\n 33: invokevirtual #56 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #28 // Field isFootballLover:Z\n 40: invokevirtual #66 // Method java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #69 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #71 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: invokestatic #77 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #24 // Field name:Ljava/lang/String;\n 16: invokevirtual #81 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #28 // Field isFootballLover:Z\n 29: invokestatic #86 // Method java/lang/Boolean.hashCode:(Z)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class CollectionFunctionsKt$main$User\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class CollectionFunctionsKt$main$User\n 20: astore_2\n 21: aload_0\n 22: getfield #21 // Field id:I\n 25: aload_2\n 26: getfield #21 // Field id:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #24 // Field name:Ljava/lang/String;\n 38: aload_2\n 39: getfield #24 // Field name:Ljava/lang/String;\n 42: invokestatic #93 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: aload_0\n 51: getfield #28 // Field isFootballLover:Z\n 54: aload_2\n 55: getfield #28 // Field isFootballLover:Z\n 58: if_icmpeq 63\n 61: iconst_0\n 62: ireturn\n 63: iconst_1\n 64: ireturn\n}\n", "javap_err": "" }, { "class_path": "mustajab-ikram__Kotlin_Tutorial__f3293e9/CollectionFunctionsKt$main$User3.class", "javap": "Compiled from \"CollectionFunctions.kt\"\npublic final class CollectionFunctionsKt$main$User3 {\n private final int id;\n\n private final java.lang.String name;\n\n public CollectionFunctionsKt$main$User3(int, java.lang.String);\n Code:\n 0: aload_2\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #17 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: iload_1\n 12: putfield #21 // Field id:I\n 15: aload_0\n 16: aload_2\n 17: putfield #24 // Field name:Ljava/lang/String;\n 20: return\n\n public final int getId();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: ireturn\n\n public final java.lang.String getName();\n Code:\n 0: aload_0\n 1: getfield #24 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: ireturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #24 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final CollectionFunctionsKt$main$User3 copy(int, java.lang.String);\n Code:\n 0: aload_2\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class CollectionFunctionsKt$main$User3\n 9: dup\n 10: iload_1\n 11: aload_2\n 12: invokespecial #36 // Method \"<init>\":(ILjava/lang/String;)V\n 15: areturn\n\n public static CollectionFunctionsKt$main$User3 copy$default(CollectionFunctionsKt$main$User3, int, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #21 // Field id:I\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #24 // Field name:Ljava/lang/String;\n 21: astore_2\n 22: aload_0\n 23: iload_1\n 24: aload_2\n 25: invokevirtual #40 // Method copy:(ILjava/lang/String;)LCollectionFunctionsKt$main$User3;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #43 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #44 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #46 // String User3(id=\n 9: invokevirtual #50 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #21 // Field id:I\n 16: invokevirtual #53 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #55 // String , name=\n 21: invokevirtual #50 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #24 // Field name:Ljava/lang/String;\n 28: invokevirtual #50 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #58 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #60 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: invokestatic #66 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #24 // Field name:Ljava/lang/String;\n 16: invokevirtual #70 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class CollectionFunctionsKt$main$User3\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class CollectionFunctionsKt$main$User3\n 20: astore_2\n 21: aload_0\n 22: getfield #21 // Field id:I\n 25: aload_2\n 26: getfield #21 // Field id:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #24 // Field name:Ljava/lang/String;\n 38: aload_2\n 39: getfield #24 // Field name:Ljava/lang/String;\n 42: invokestatic #77 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: iconst_1\n 51: ireturn\n}\n", "javap_err": "" }, { "class_path": "mustajab-ikram__Kotlin_Tutorial__f3293e9/CollectionFunctionsKt$main$Contact.class", "javap": "Compiled from \"CollectionFunctions.kt\"\npublic final class CollectionFunctionsKt$main$Contact {\n private final java.lang.String name;\n\n private final java.lang.String phoneNumber;\n\n public CollectionFunctionsKt$main$Contact(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #16 // String phoneNumber\n 9: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #22 // Field name:Ljava/lang/String;\n 21: aload_0\n 22: aload_2\n 23: putfield #24 // Field phoneNumber:Ljava/lang/String;\n 26: return\n\n public final java.lang.String getName();\n Code:\n 0: aload_0\n 1: getfield #22 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String getPhoneNumber();\n Code:\n 0: aload_0\n 1: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 4: areturn\n\n public final CollectionFunctionsKt$main$Contact copy(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #16 // String phoneNumber\n 9: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class CollectionFunctionsKt$main$Contact\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: invokespecial #35 // Method \"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 21: areturn\n\n public static CollectionFunctionsKt$main$Contact copy$default(CollectionFunctionsKt$main$Contact, java.lang.String, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field name:Ljava/lang/String;\n 10: astore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 21: astore_2\n 22: aload_0\n 23: aload_1\n 24: aload_2\n 25: invokevirtual #39 // Method copy:(Ljava/lang/String;Ljava/lang/String;)LCollectionFunctionsKt$main$Contact;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #42 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #43 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #45 // String Contact(name=\n 9: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field name:Ljava/lang/String;\n 16: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #51 // String , phoneNumber=\n 21: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 28: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #54 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #56 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field name:Ljava/lang/String;\n 4: invokevirtual #62 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 16: invokevirtual #62 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class CollectionFunctionsKt$main$Contact\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class CollectionFunctionsKt$main$Contact\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field name:Ljava/lang/String;\n 25: aload_2\n 26: getfield #22 // Field name:Ljava/lang/String;\n 29: invokestatic #70 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 41: aload_2\n 42: getfield #24 // Field phoneNumber:Ljava/lang/String;\n 45: invokestatic #70 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: iconst_1\n 54: ireturn\n}\n", "javap_err": "" }, { "class_path": "mustajab-ikram__Kotlin_Tutorial__f3293e9/CollectionFunctionsKt$main$Users.class", "javap": "Compiled from \"CollectionFunctions.kt\"\npublic final class CollectionFunctionsKt$main$Users {\n private final int id;\n\n private final java.lang.String name;\n\n private final boolean isCricketLover;\n\n private final boolean isFootballLover;\n\n public CollectionFunctionsKt$main$Users(int, java.lang.String, boolean, boolean);\n Code:\n 0: aload_2\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #17 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: iload_1\n 12: putfield #21 // Field id:I\n 15: aload_0\n 16: aload_2\n 17: putfield #24 // Field name:Ljava/lang/String;\n 20: aload_0\n 21: iload_3\n 22: putfield #28 // Field isCricketLover:Z\n 25: aload_0\n 26: iload 4\n 28: putfield #31 // Field isFootballLover:Z\n 31: return\n\n public final int getId();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: ireturn\n\n public final java.lang.String getName();\n Code:\n 0: aload_0\n 1: getfield #24 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final boolean isCricketLover();\n Code:\n 0: aload_0\n 1: getfield #28 // Field isCricketLover:Z\n 4: ireturn\n\n public final boolean isFootballLover();\n Code:\n 0: aload_0\n 1: getfield #31 // Field isFootballLover:Z\n 4: ireturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: ireturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #24 // Field name:Ljava/lang/String;\n 4: areturn\n\n public final boolean component3();\n Code:\n 0: aload_0\n 1: getfield #28 // Field isCricketLover:Z\n 4: ireturn\n\n public final boolean component4();\n Code:\n 0: aload_0\n 1: getfield #31 // Field isFootballLover:Z\n 4: ireturn\n\n public final CollectionFunctionsKt$main$Users copy(int, java.lang.String, boolean, boolean);\n Code:\n 0: aload_2\n 1: ldc #8 // String name\n 3: invokestatic #14 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class CollectionFunctionsKt$main$Users\n 9: dup\n 10: iload_1\n 11: aload_2\n 12: iload_3\n 13: iload 4\n 15: invokespecial #46 // Method \"<init>\":(ILjava/lang/String;ZZ)V\n 18: areturn\n\n public static CollectionFunctionsKt$main$Users copy$default(CollectionFunctionsKt$main$Users, int, java.lang.String, boolean, boolean, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #21 // Field id:I\n 11: istore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #24 // Field name:Ljava/lang/String;\n 23: astore_2\n 24: iload 5\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #28 // Field isCricketLover:Z\n 35: istore_3\n 36: iload 5\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #31 // Field isFootballLover:Z\n 48: istore 4\n 50: aload_0\n 51: iload_1\n 52: aload_2\n 53: iload_3\n 54: iload 4\n 56: invokevirtual #50 // Method copy:(ILjava/lang/String;ZZ)LCollectionFunctionsKt$main$Users;\n 59: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #53 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #54 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #56 // String Users(id=\n 9: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #21 // Field id:I\n 16: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #65 // String , name=\n 21: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #24 // Field name:Ljava/lang/String;\n 28: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: ldc #67 // String , isCricketLover=\n 33: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #28 // Field isCricketLover:Z\n 40: invokevirtual #70 // Method java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;\n 43: ldc #72 // String , isFootballLover=\n 45: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #31 // Field isFootballLover:Z\n 52: invokevirtual #70 // Method java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;\n 55: bipush 41\n 57: invokevirtual #75 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 60: invokevirtual #77 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 63: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #21 // Field id:I\n 4: invokestatic #83 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #24 // Field name:Ljava/lang/String;\n 16: invokevirtual #87 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #28 // Field isCricketLover:Z\n 29: invokestatic #92 // Method java/lang/Boolean.hashCode:(Z)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #31 // Field isFootballLover:Z\n 42: invokestatic #92 // Method java/lang/Boolean.hashCode:(Z)I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class CollectionFunctionsKt$main$Users\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class CollectionFunctionsKt$main$Users\n 20: astore_2\n 21: aload_0\n 22: getfield #21 // Field id:I\n 25: aload_2\n 26: getfield #21 // Field id:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #24 // Field name:Ljava/lang/String;\n 38: aload_2\n 39: getfield #24 // Field name:Ljava/lang/String;\n 42: invokestatic #99 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: aload_0\n 51: getfield #28 // Field isCricketLover:Z\n 54: aload_2\n 55: getfield #28 // Field isCricketLover:Z\n 58: if_icmpeq 63\n 61: iconst_0\n 62: ireturn\n 63: aload_0\n 64: getfield #31 // Field isFootballLover:Z\n 67: aload_2\n 68: getfield #31 // Field isFootballLover:Z\n 71: if_icmpeq 76\n 74: iconst_0\n 75: ireturn\n 76: iconst_1\n 77: ireturn\n}\n", "javap_err": "" }, { "class_path": "mustajab-ikram__Kotlin_Tutorial__f3293e9/CollectionFunctionsKt.class", "javap": "Compiled from \"CollectionFunctions.kt\"\npublic final class CollectionFunctionsKt {\n public static final void main();\n Code:\n 0: bipush 6\n 2: anewarray #8 // class java/lang/String\n 5: astore_1\n 6: aload_1\n 7: iconst_0\n 8: ldc #10 // String Amit\n 10: aastore\n 11: aload_1\n 12: iconst_1\n 13: ldc #12 // String Ali\n 15: aastore\n 16: aload_1\n 17: iconst_2\n 18: ldc #10 // String Amit\n 20: aastore\n 21: aload_1\n 22: iconst_3\n 23: ldc #14 // String Sumit\n 25: aastore\n 26: aload_1\n 27: iconst_4\n 28: ldc #14 // String Sumit\n 30: aastore\n 31: aload_1\n 32: iconst_5\n 33: ldc #16 // String Himanshu\n 35: aastore\n 36: aload_1\n 37: astore_0\n 38: aload_0\n 39: invokestatic #22 // Method kotlin/collections/ArraysKt.distinct:([Ljava/lang/Object;)Ljava/util/List;\n 42: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 45: swap\n 46: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 49: bipush 6\n 51: anewarray #8 // class java/lang/String\n 54: astore_2\n 55: aload_2\n 56: iconst_0\n 57: ldc #10 // String Amit\n 59: aastore\n 60: aload_2\n 61: iconst_1\n 62: ldc #12 // String Ali\n 64: aastore\n 65: aload_2\n 66: iconst_2\n 67: ldc #10 // String Amit\n 69: aastore\n 70: aload_2\n 71: iconst_3\n 72: ldc #14 // String Sumit\n 74: aastore\n 75: aload_2\n 76: iconst_4\n 77: ldc #14 // String Sumit\n 79: aastore\n 80: aload_2\n 81: iconst_5\n 82: ldc #16 // String Himanshu\n 84: aastore\n 85: aload_2\n 86: astore_1\n 87: aload_1\n 88: invokestatic #38 // Method kotlin/collections/ArraysKt.toSet:([Ljava/lang/Object;)Ljava/util/Set;\n 91: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 94: swap\n 95: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 98: bipush 6\n 100: anewarray #8 // class java/lang/String\n 103: astore_3\n 104: aload_3\n 105: iconst_0\n 106: ldc #10 // String Amit\n 108: aastore\n 109: aload_3\n 110: iconst_1\n 111: ldc #12 // String Ali\n 113: aastore\n 114: aload_3\n 115: iconst_2\n 116: ldc #10 // String Amit\n 118: aastore\n 119: aload_3\n 120: iconst_3\n 121: ldc #14 // String Sumit\n 123: aastore\n 124: aload_3\n 125: iconst_4\n 126: ldc #14 // String Sumit\n 128: aastore\n 129: aload_3\n 130: iconst_5\n 131: ldc #16 // String Himanshu\n 133: aastore\n 134: aload_3\n 135: astore_2\n 136: aload_2\n 137: invokestatic #41 // Method kotlin/collections/ArraysKt.toMutableSet:([Ljava/lang/Object;)Ljava/util/Set;\n 140: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 143: swap\n 144: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 147: bipush 6\n 149: anewarray #8 // class java/lang/String\n 152: astore 4\n 154: aload 4\n 156: iconst_0\n 157: ldc #10 // String Amit\n 159: aastore\n 160: aload 4\n 162: iconst_1\n 163: ldc #12 // String Ali\n 165: aastore\n 166: aload 4\n 168: iconst_2\n 169: ldc #10 // String Amit\n 171: aastore\n 172: aload 4\n 174: iconst_3\n 175: ldc #14 // String Sumit\n 177: aastore\n 178: aload 4\n 180: iconst_4\n 181: ldc #14 // String Sumit\n 183: aastore\n 184: aload 4\n 186: iconst_5\n 187: ldc #16 // String Himanshu\n 189: aastore\n 190: aload 4\n 192: astore_3\n 193: aload_3\n 194: invokestatic #45 // Method kotlin/collections/ArraysKt.toHashSet:([Ljava/lang/Object;)Ljava/util/HashSet;\n 197: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 200: swap\n 201: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 204: bipush 10\n 206: anewarray #8 // class java/lang/String\n 209: astore 5\n 211: aload 5\n 213: iconst_0\n 214: ldc #46 // String distinct\n 216: aastore\n 217: aload 5\n 219: iconst_1\n 220: ldc #48 // String map\n 222: aastore\n 223: aload 5\n 225: iconst_2\n 226: ldc #50 // String isEmpty\n 228: aastore\n 229: aload 5\n 231: iconst_3\n 232: ldc #52 // String contains\n 234: aastore\n 235: aload 5\n 237: iconst_4\n 238: ldc #54 // String filter\n 240: aastore\n 241: aload 5\n 243: iconst_5\n 244: ldc #56 // String first\n 246: aastore\n 247: aload 5\n 249: bipush 6\n 251: ldc #58 // String last\n 253: aastore\n 254: aload 5\n 256: bipush 7\n 258: ldc #60 // String reduce\n 260: aastore\n 261: aload 5\n 263: bipush 8\n 265: ldc #62 // String single\n 267: aastore\n 268: aload 5\n 270: bipush 9\n 272: ldc #64 // String joinToString\n 274: aastore\n 275: aload 5\n 277: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 280: astore 4\n 282: aload 4\n 284: checkcast #71 // class java/lang/Iterable\n 287: ldc #73 // String ,\n 289: checkcast #75 // class java/lang/CharSequence\n 292: ldc #77 // String Kotlin has many collection functions like:\n 294: checkcast #75 // class java/lang/CharSequence\n 297: ldc #79 // String and they are awesome.\n 299: checkcast #75 // class java/lang/CharSequence\n 302: iconst_3\n 303: ldc #81 // String etc\n 305: checkcast #75 // class java/lang/CharSequence\n 308: aconst_null\n 309: bipush 32\n 311: aconst_null\n 312: invokestatic #85 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 315: astore 5\n 317: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 320: aload 5\n 322: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 325: iconst_5\n 326: anewarray #87 // class java/lang/Integer\n 329: astore 7\n 331: aload 7\n 333: iconst_0\n 334: iconst_1\n 335: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 338: aastore\n 339: aload 7\n 341: iconst_1\n 342: iconst_2\n 343: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 346: aastore\n 347: aload 7\n 349: iconst_2\n 350: iconst_3\n 351: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 354: aastore\n 355: aload 7\n 357: iconst_3\n 358: iconst_4\n 359: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 362: aastore\n 363: aload 7\n 365: iconst_4\n 366: iconst_5\n 367: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 370: aastore\n 371: aload 7\n 373: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 376: astore 6\n 378: aload 6\n 380: checkcast #71 // class java/lang/Iterable\n 383: astore 8\n 385: iconst_0\n 386: istore 9\n 388: aload 8\n 390: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 395: astore 10\n 397: aload 10\n 399: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 404: ifne 417\n 407: new #103 // class java/lang/UnsupportedOperationException\n 410: dup\n 411: ldc #105 // String Empty collection can\\'t be reduced.\n 413: invokespecial #109 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 416: athrow\n 417: aload 10\n 419: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 424: astore 11\n 426: aload 10\n 428: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 433: ifeq 477\n 436: aload 11\n 438: aload 10\n 440: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 445: checkcast #115 // class java/lang/Number\n 448: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 451: istore 12\n 453: checkcast #115 // class java/lang/Number\n 456: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 459: istore 13\n 461: iconst_0\n 462: istore 14\n 464: iload 13\n 466: iload 12\n 468: iadd\n 469: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 472: astore 11\n 474: goto 426\n 477: aload 11\n 479: checkcast #115 // class java/lang/Number\n 482: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 485: istore 7\n 487: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 490: iload 7\n 492: invokevirtual #122 // Method java/io/PrintStream.println:(I)V\n 495: new #124 // class CollectionFunctionsKt$main$Users\n 498: dup\n 499: iconst_1\n 500: ldc #10 // String Amit\n 502: iconst_1\n 503: iconst_1\n 504: invokespecial #127 // Method CollectionFunctionsKt$main$Users.\"<init>\":(ILjava/lang/String;ZZ)V\n 507: astore 8\n 509: new #124 // class CollectionFunctionsKt$main$Users\n 512: dup\n 513: iconst_2\n 514: ldc #12 // String Ali\n 516: iconst_1\n 517: iconst_1\n 518: invokespecial #127 // Method CollectionFunctionsKt$main$Users.\"<init>\":(ILjava/lang/String;ZZ)V\n 521: astore 9\n 523: new #124 // class CollectionFunctionsKt$main$Users\n 526: dup\n 527: iconst_3\n 528: ldc #14 // String Sumit\n 530: iconst_1\n 531: iconst_0\n 532: invokespecial #127 // Method CollectionFunctionsKt$main$Users.\"<init>\":(ILjava/lang/String;ZZ)V\n 535: astore 10\n 537: new #124 // class CollectionFunctionsKt$main$Users\n 540: dup\n 541: iconst_4\n 542: ldc #16 // String Himanshu\n 544: iconst_1\n 545: iconst_0\n 546: invokespecial #127 // Method CollectionFunctionsKt$main$Users.\"<init>\":(ILjava/lang/String;ZZ)V\n 549: astore 11\n 551: iconst_4\n 552: anewarray #124 // class CollectionFunctionsKt$main$Users\n 555: astore 13\n 557: aload 13\n 559: iconst_0\n 560: aload 8\n 562: aastore\n 563: aload 13\n 565: iconst_1\n 566: aload 9\n 568: aastore\n 569: aload 13\n 571: iconst_2\n 572: aload 10\n 574: aastore\n 575: aload 13\n 577: iconst_3\n 578: aload 11\n 580: aastore\n 581: aload 13\n 583: astore 12\n 585: aload 12\n 587: astore 14\n 589: iconst_0\n 590: istore 15\n 592: iconst_0\n 593: istore 16\n 595: aload 14\n 597: arraylength\n 598: istore 17\n 600: iload 16\n 602: iload 17\n 604: if_icmpge 639\n 607: aload 14\n 609: iload 16\n 611: aaload\n 612: astore 18\n 614: aload 18\n 616: astore 19\n 618: iconst_0\n 619: istore 20\n 621: aload 19\n 623: invokevirtual #130 // Method CollectionFunctionsKt$main$Users.isCricketLover:()Z\n 626: ifne 633\n 629: iconst_0\n 630: goto 640\n 633: iinc 16, 1\n 636: goto 600\n 639: iconst_1\n 640: istore 13\n 642: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 645: iload 13\n 647: invokevirtual #133 // Method java/io/PrintStream.println:(Z)V\n 650: aload 12\n 652: astore 15\n 654: iconst_0\n 655: istore 16\n 657: iconst_0\n 658: istore 17\n 660: aload 15\n 662: arraylength\n 663: istore 18\n 665: iload 17\n 667: iload 18\n 669: if_icmpge 704\n 672: aload 15\n 674: iload 17\n 676: aaload\n 677: astore 19\n 679: aload 19\n 681: astore 20\n 683: iconst_0\n 684: istore 21\n 686: aload 20\n 688: invokevirtual #136 // Method CollectionFunctionsKt$main$Users.isFootballLover:()Z\n 691: ifne 698\n 694: iconst_0\n 695: goto 705\n 698: iinc 17, 1\n 701: goto 665\n 704: iconst_1\n 705: istore 14\n 707: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 710: iload 14\n 712: invokevirtual #133 // Method java/io/PrintStream.println:(Z)V\n 715: iconst_4\n 716: anewarray #138 // class CollectionFunctionsKt$main$User3\n 719: astore 16\n 721: aload 16\n 723: iconst_0\n 724: new #138 // class CollectionFunctionsKt$main$User3\n 727: dup\n 728: iconst_1\n 729: ldc #10 // String Amit\n 731: invokespecial #141 // Method CollectionFunctionsKt$main$User3.\"<init>\":(ILjava/lang/String;)V\n 734: aastore\n 735: aload 16\n 737: iconst_1\n 738: new #138 // class CollectionFunctionsKt$main$User3\n 741: dup\n 742: iconst_2\n 743: ldc #12 // String Ali\n 745: invokespecial #141 // Method CollectionFunctionsKt$main$User3.\"<init>\":(ILjava/lang/String;)V\n 748: aastore\n 749: aload 16\n 751: iconst_2\n 752: new #138 // class CollectionFunctionsKt$main$User3\n 755: dup\n 756: iconst_3\n 757: ldc #14 // String Sumit\n 759: invokespecial #141 // Method CollectionFunctionsKt$main$User3.\"<init>\":(ILjava/lang/String;)V\n 762: aastore\n 763: aload 16\n 765: iconst_3\n 766: new #138 // class CollectionFunctionsKt$main$User3\n 769: dup\n 770: iconst_4\n 771: ldc #16 // String Himanshu\n 773: invokespecial #141 // Method CollectionFunctionsKt$main$User3.\"<init>\":(ILjava/lang/String;)V\n 776: aastore\n 777: aload 16\n 779: astore 15\n 781: aload 15\n 783: astore 17\n 785: iconst_0\n 786: istore 18\n 788: aconst_null\n 789: astore 19\n 791: iconst_0\n 792: istore 20\n 794: iconst_0\n 795: istore 21\n 797: aload 17\n 799: arraylength\n 800: istore 22\n 802: iload 21\n 804: iload 22\n 806: if_icmpge 868\n 809: aload 17\n 811: iload 21\n 813: aaload\n 814: astore 23\n 816: aload 23\n 818: astore 24\n 820: iconst_0\n 821: istore 25\n 823: aload 24\n 825: invokevirtual #144 // Method CollectionFunctionsKt$main$User3.getId:()I\n 828: iconst_3\n 829: if_icmpne 836\n 832: iconst_1\n 833: goto 837\n 836: iconst_0\n 837: ifeq 862\n 840: iload 20\n 842: ifeq 855\n 845: new #146 // class java/lang/IllegalArgumentException\n 848: dup\n 849: ldc #148 // String Array contains more than one matching element.\n 851: invokespecial #149 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 854: athrow\n 855: aload 23\n 857: astore 19\n 859: iconst_1\n 860: istore 20\n 862: iinc 21, 1\n 865: goto 802\n 868: iload 20\n 870: ifne 883\n 873: new #151 // class java/util/NoSuchElementException\n 876: dup\n 877: ldc #153 // String Array contains no element matching the predicate.\n 879: invokespecial #154 // Method java/util/NoSuchElementException.\"<init>\":(Ljava/lang/String;)V\n 882: athrow\n 883: aload 19\n 885: astore 16\n 887: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 890: aload 16\n 892: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 895: aload 15\n 897: astore 19\n 899: iconst_0\n 900: istore 20\n 902: aload 19\n 904: arraylength\n 905: istore 21\n 907: iload 20\n 909: iload 21\n 911: if_icmpge 956\n 914: aload 19\n 916: iload 20\n 918: aaload\n 919: astore 22\n 921: aload 22\n 923: astore 23\n 925: iconst_0\n 926: istore 24\n 928: aload 23\n 930: invokevirtual #144 // Method CollectionFunctionsKt$main$User3.getId:()I\n 933: iconst_1\n 934: if_icmpne 941\n 937: iconst_1\n 938: goto 942\n 941: iconst_0\n 942: ifeq 950\n 945: aload 22\n 947: goto 957\n 950: iinc 20, 1\n 953: goto 907\n 956: aconst_null\n 957: astore 17\n 959: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 962: aload 17\n 964: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 967: bipush 10\n 969: anewarray #87 // class java/lang/Integer\n 972: astore 19\n 974: aload 19\n 976: iconst_0\n 977: iconst_1\n 978: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 981: aastore\n 982: aload 19\n 984: iconst_1\n 985: iconst_2\n 986: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 989: aastore\n 990: aload 19\n 992: iconst_2\n 993: iconst_3\n 994: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 997: aastore\n 998: aload 19\n 1000: iconst_3\n 1001: iconst_4\n 1002: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1005: aastore\n 1006: aload 19\n 1008: iconst_4\n 1009: iconst_5\n 1010: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1013: aastore\n 1014: aload 19\n 1016: iconst_5\n 1017: bipush 6\n 1019: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1022: aastore\n 1023: aload 19\n 1025: bipush 6\n 1027: bipush 7\n 1029: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1032: aastore\n 1033: aload 19\n 1035: bipush 7\n 1037: bipush 8\n 1039: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1042: aastore\n 1043: aload 19\n 1045: bipush 8\n 1047: bipush 9\n 1049: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1052: aastore\n 1053: aload 19\n 1055: bipush 9\n 1057: bipush 10\n 1059: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1062: aastore\n 1063: aload 19\n 1065: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1068: astore 18\n 1070: aload 18\n 1072: checkcast #71 // class java/lang/Iterable\n 1075: iconst_3\n 1076: invokestatic #158 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 1079: astore 19\n 1081: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1084: aload 19\n 1086: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1089: bipush 10\n 1091: anewarray #87 // class java/lang/Integer\n 1094: astore 21\n 1096: aload 21\n 1098: iconst_0\n 1099: iconst_1\n 1100: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1103: aastore\n 1104: aload 21\n 1106: iconst_1\n 1107: iconst_2\n 1108: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1111: aastore\n 1112: aload 21\n 1114: iconst_2\n 1115: iconst_3\n 1116: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1119: aastore\n 1120: aload 21\n 1122: iconst_3\n 1123: iconst_4\n 1124: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1127: aastore\n 1128: aload 21\n 1130: iconst_4\n 1131: iconst_5\n 1132: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1135: aastore\n 1136: aload 21\n 1138: iconst_5\n 1139: bipush 6\n 1141: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1144: aastore\n 1145: aload 21\n 1147: bipush 6\n 1149: bipush 7\n 1151: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1154: aastore\n 1155: aload 21\n 1157: bipush 7\n 1159: bipush 8\n 1161: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1164: aastore\n 1165: aload 21\n 1167: bipush 8\n 1169: bipush 9\n 1171: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1174: aastore\n 1175: aload 21\n 1177: bipush 9\n 1179: bipush 10\n 1181: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1184: aastore\n 1185: aload 21\n 1187: astore 20\n 1189: bipush 10\n 1191: anewarray #87 // class java/lang/Integer\n 1194: astore 22\n 1196: aload 22\n 1198: iconst_0\n 1199: bipush 11\n 1201: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1204: aastore\n 1205: aload 22\n 1207: iconst_1\n 1208: bipush 12\n 1210: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1213: aastore\n 1214: aload 22\n 1216: iconst_2\n 1217: bipush 13\n 1219: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1222: aastore\n 1223: aload 22\n 1225: iconst_3\n 1226: bipush 14\n 1228: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1231: aastore\n 1232: aload 22\n 1234: iconst_4\n 1235: bipush 15\n 1237: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1240: aastore\n 1241: aload 22\n 1243: iconst_5\n 1244: bipush 16\n 1246: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1249: aastore\n 1250: aload 22\n 1252: bipush 6\n 1254: bipush 17\n 1256: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1259: aastore\n 1260: aload 22\n 1262: bipush 7\n 1264: bipush 18\n 1266: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1269: aastore\n 1270: aload 22\n 1272: bipush 8\n 1274: bipush 19\n 1276: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1279: aastore\n 1280: aload 22\n 1282: bipush 9\n 1284: bipush 20\n 1286: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1289: aastore\n 1290: aload 22\n 1292: astore 21\n 1294: aload 20\n 1296: aload 21\n 1298: iconst_2\n 1299: iconst_0\n 1300: iconst_4\n 1301: invokestatic #162 // Method kotlin/collections/ArraysKt.copyInto:([Ljava/lang/Object;[Ljava/lang/Object;III)[Ljava/lang/Object;\n 1304: pop\n 1305: aload 21\n 1307: astore 22\n 1309: iconst_0\n 1310: istore 23\n 1312: iconst_0\n 1313: istore 24\n 1315: aload 22\n 1317: arraylength\n 1318: istore 25\n 1320: iload 24\n 1322: iload 25\n 1324: if_icmpge 1382\n 1327: aload 22\n 1329: iload 24\n 1331: aaload\n 1332: astore 26\n 1334: aload 26\n 1336: checkcast #115 // class java/lang/Number\n 1339: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 1342: istore 27\n 1344: iconst_0\n 1345: istore 28\n 1347: new #164 // class java/lang/StringBuilder\n 1350: dup\n 1351: invokespecial #166 // Method java/lang/StringBuilder.\"<init>\":()V\n 1354: iload 27\n 1356: invokevirtual #170 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1359: bipush 32\n 1361: invokevirtual #173 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 1364: invokevirtual #177 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1367: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1370: swap\n 1371: invokevirtual #180 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 1374: nop\n 1375: nop\n 1376: iinc 24, 1\n 1379: goto 1320\n 1382: nop\n 1383: iconst_5\n 1384: istore 23\n 1386: iconst_0\n 1387: istore 24\n 1389: iload 23\n 1391: newarray int\n 1393: astore 25\n 1395: iload 24\n 1397: iload 23\n 1399: if_icmpge 1437\n 1402: iload 24\n 1404: istore 26\n 1406: aload 25\n 1408: iload 26\n 1410: iload 26\n 1412: istore 27\n 1414: istore 69\n 1416: astore 68\n 1418: iconst_0\n 1419: istore 28\n 1421: iconst_1\n 1422: istore 70\n 1424: aload 68\n 1426: iload 69\n 1428: iload 70\n 1430: iastore\n 1431: iinc 24, 1\n 1434: goto 1395\n 1437: aload 25\n 1439: invokestatic #186 // Method kotlin/UIntArray.\"constructor-impl\":([I)[I\n 1442: astore 22\n 1444: aload 22\n 1446: dup\n 1447: arraylength\n 1448: invokestatic #192 // Method java/util/Arrays.copyOf:([II)[I\n 1451: dup\n 1452: ldc #194 // String copyOf(...)\n 1454: invokestatic #200 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 1457: astore 23\n 1459: aload 23\n 1461: iconst_0\n 1462: iconst_0\n 1463: iastore\n 1464: aload 22\n 1466: invokestatic #204 // Method kotlin/UIntArray.\"box-impl\":([I)Lkotlin/UIntArray;\n 1469: checkcast #71 // class java/lang/Iterable\n 1472: invokestatic #208 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 1475: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1478: swap\n 1479: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1482: aload 23\n 1484: invokestatic #211 // Method kotlin/collections/ArraysKt.toList:([I)Ljava/util/List;\n 1487: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1490: swap\n 1491: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1494: iconst_5\n 1495: istore 25\n 1497: iconst_0\n 1498: istore 26\n 1500: iload 25\n 1502: newarray int\n 1504: astore 27\n 1506: iload 26\n 1508: iload 25\n 1510: if_icmpge 1548\n 1513: iload 26\n 1515: istore 28\n 1517: aload 27\n 1519: iload 28\n 1521: iload 28\n 1523: istore 29\n 1525: istore 69\n 1527: astore 68\n 1529: iconst_0\n 1530: istore 30\n 1532: iconst_1\n 1533: istore 70\n 1535: aload 68\n 1537: iload 69\n 1539: iload 70\n 1541: iastore\n 1542: iinc 26, 1\n 1545: goto 1506\n 1548: aload 27\n 1550: invokestatic #186 // Method kotlin/UIntArray.\"constructor-impl\":([I)[I\n 1553: astore 24\n 1555: aload 24\n 1557: astore 25\n 1559: aload 25\n 1561: iconst_0\n 1562: iconst_0\n 1563: iastore\n 1564: aload 24\n 1566: invokestatic #204 // Method kotlin/UIntArray.\"box-impl\":([I)Lkotlin/UIntArray;\n 1569: checkcast #71 // class java/lang/Iterable\n 1572: invokestatic #208 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 1575: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1578: swap\n 1579: invokevirtual #180 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 1582: aload 25\n 1584: invokestatic #211 // Method kotlin/collections/ArraysKt.toList:([I)Ljava/util/List;\n 1587: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1590: swap\n 1591: invokevirtual #180 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 1594: iconst_4\n 1595: anewarray #213 // class CollectionFunctionsKt$main$Contact\n 1598: astore 27\n 1600: aload 27\n 1602: iconst_0\n 1603: new #213 // class CollectionFunctionsKt$main$Contact\n 1606: dup\n 1607: ldc #10 // String Amit\n 1609: ldc #215 // String +9199XXXX1111\n 1611: invokespecial #218 // Method CollectionFunctionsKt$main$Contact.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 1614: aastore\n 1615: aload 27\n 1617: iconst_1\n 1618: new #213 // class CollectionFunctionsKt$main$Contact\n 1621: dup\n 1622: ldc #12 // String Ali\n 1624: ldc #220 // String +9199XXXX2222\n 1626: invokespecial #218 // Method CollectionFunctionsKt$main$Contact.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 1629: aastore\n 1630: aload 27\n 1632: iconst_2\n 1633: new #213 // class CollectionFunctionsKt$main$Contact\n 1636: dup\n 1637: ldc #16 // String Himanshu\n 1639: ldc #222 // String +9199XXXX3333\n 1641: invokespecial #218 // Method CollectionFunctionsKt$main$Contact.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 1644: aastore\n 1645: aload 27\n 1647: iconst_3\n 1648: new #213 // class CollectionFunctionsKt$main$Contact\n 1651: dup\n 1652: ldc #14 // String Sumit\n 1654: ldc #224 // String +9199XXXX4444\n 1656: invokespecial #218 // Method CollectionFunctionsKt$main$Contact.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 1659: aastore\n 1660: aload 27\n 1662: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1665: astore 26\n 1667: bipush 10\n 1669: anewarray #87 // class java/lang/Integer\n 1672: astore 28\n 1674: aload 28\n 1676: iconst_0\n 1677: iconst_1\n 1678: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1681: aastore\n 1682: aload 28\n 1684: iconst_1\n 1685: iconst_2\n 1686: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1689: aastore\n 1690: aload 28\n 1692: iconst_2\n 1693: iconst_2\n 1694: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1697: aastore\n 1698: aload 28\n 1700: iconst_3\n 1701: iconst_3\n 1702: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1705: aastore\n 1706: aload 28\n 1708: iconst_4\n 1709: iconst_3\n 1710: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1713: aastore\n 1714: aload 28\n 1716: iconst_5\n 1717: iconst_3\n 1718: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1721: aastore\n 1722: aload 28\n 1724: bipush 6\n 1726: iconst_4\n 1727: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1730: aastore\n 1731: aload 28\n 1733: bipush 7\n 1735: iconst_4\n 1736: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1739: aastore\n 1740: aload 28\n 1742: bipush 8\n 1744: iconst_4\n 1745: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1748: aastore\n 1749: aload 28\n 1751: bipush 9\n 1753: iconst_4\n 1754: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1757: aastore\n 1758: aload 28\n 1760: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1763: astore 27\n 1765: aload 27\n 1767: checkcast #71 // class java/lang/Iterable\n 1770: invokestatic #226 // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;\n 1773: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1776: swap\n 1777: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1780: bipush 7\n 1782: anewarray #87 // class java/lang/Integer\n 1785: astore 29\n 1787: aload 29\n 1789: iconst_0\n 1790: iconst_1\n 1791: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1794: aastore\n 1795: aload 29\n 1797: iconst_1\n 1798: iconst_2\n 1799: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1802: aastore\n 1803: aload 29\n 1805: iconst_2\n 1806: iconst_3\n 1807: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1810: aastore\n 1811: aload 29\n 1813: iconst_3\n 1814: iconst_3\n 1815: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1818: aastore\n 1819: aload 29\n 1821: iconst_4\n 1822: iconst_4\n 1823: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1826: aastore\n 1827: aload 29\n 1829: iconst_5\n 1830: iconst_5\n 1831: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1834: aastore\n 1835: aload 29\n 1837: bipush 6\n 1839: bipush 6\n 1841: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1844: aastore\n 1845: aload 29\n 1847: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1850: astore 28\n 1852: bipush 7\n 1854: anewarray #87 // class java/lang/Integer\n 1857: astore 30\n 1859: aload 30\n 1861: iconst_0\n 1862: iconst_2\n 1863: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1866: aastore\n 1867: aload 30\n 1869: iconst_1\n 1870: iconst_2\n 1871: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1874: aastore\n 1875: aload 30\n 1877: iconst_2\n 1878: iconst_4\n 1879: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1882: aastore\n 1883: aload 30\n 1885: iconst_3\n 1886: iconst_5\n 1887: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1890: aastore\n 1891: aload 30\n 1893: iconst_4\n 1894: bipush 6\n 1896: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1899: aastore\n 1900: aload 30\n 1902: iconst_5\n 1903: bipush 7\n 1905: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1908: aastore\n 1909: aload 30\n 1911: bipush 6\n 1913: bipush 8\n 1915: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1918: aastore\n 1919: aload 30\n 1921: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1924: astore 29\n 1926: aload 28\n 1928: checkcast #71 // class java/lang/Iterable\n 1931: aload 29\n 1933: checkcast #71 // class java/lang/Iterable\n 1936: invokestatic #230 // Method kotlin/collections/CollectionsKt.union:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 1939: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1942: swap\n 1943: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1946: bipush 7\n 1948: anewarray #87 // class java/lang/Integer\n 1951: astore 31\n 1953: aload 31\n 1955: iconst_0\n 1956: iconst_1\n 1957: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1960: aastore\n 1961: aload 31\n 1963: iconst_1\n 1964: iconst_2\n 1965: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1968: aastore\n 1969: aload 31\n 1971: iconst_2\n 1972: iconst_3\n 1973: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1976: aastore\n 1977: aload 31\n 1979: iconst_3\n 1980: iconst_3\n 1981: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1984: aastore\n 1985: aload 31\n 1987: iconst_4\n 1988: iconst_4\n 1989: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1992: aastore\n 1993: aload 31\n 1995: iconst_5\n 1996: iconst_5\n 1997: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2000: aastore\n 2001: aload 31\n 2003: bipush 6\n 2005: bipush 6\n 2007: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2010: aastore\n 2011: aload 31\n 2013: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2016: astore 30\n 2018: bipush 7\n 2020: anewarray #87 // class java/lang/Integer\n 2023: astore 32\n 2025: aload 32\n 2027: iconst_0\n 2028: iconst_2\n 2029: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2032: aastore\n 2033: aload 32\n 2035: iconst_1\n 2036: iconst_2\n 2037: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2040: aastore\n 2041: aload 32\n 2043: iconst_2\n 2044: iconst_4\n 2045: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2048: aastore\n 2049: aload 32\n 2051: iconst_3\n 2052: iconst_5\n 2053: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2056: aastore\n 2057: aload 32\n 2059: iconst_4\n 2060: bipush 6\n 2062: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2065: aastore\n 2066: aload 32\n 2068: iconst_5\n 2069: bipush 7\n 2071: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2074: aastore\n 2075: aload 32\n 2077: bipush 6\n 2079: bipush 8\n 2081: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2084: aastore\n 2085: aload 32\n 2087: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2090: astore 31\n 2092: aload 30\n 2094: checkcast #71 // class java/lang/Iterable\n 2097: aload 31\n 2099: checkcast #71 // class java/lang/Iterable\n 2102: invokestatic #233 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 2105: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 2108: swap\n 2109: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 2112: bipush 7\n 2114: anewarray #87 // class java/lang/Integer\n 2117: astore 33\n 2119: aload 33\n 2121: iconst_0\n 2122: iconst_1\n 2123: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2126: aastore\n 2127: aload 33\n 2129: iconst_1\n 2130: iconst_2\n 2131: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2134: aastore\n 2135: aload 33\n 2137: iconst_2\n 2138: iconst_3\n 2139: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2142: aastore\n 2143: aload 33\n 2145: iconst_3\n 2146: iconst_3\n 2147: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2150: aastore\n 2151: aload 33\n 2153: iconst_4\n 2154: iconst_4\n 2155: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2158: aastore\n 2159: aload 33\n 2161: iconst_5\n 2162: iconst_5\n 2163: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2166: aastore\n 2167: aload 33\n 2169: bipush 6\n 2171: bipush 6\n 2173: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2176: aastore\n 2177: aload 33\n 2179: invokestatic #236 // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;\n 2182: astore 32\n 2184: bipush 7\n 2186: anewarray #87 // class java/lang/Integer\n 2189: astore 34\n 2191: aload 34\n 2193: iconst_0\n 2194: iconst_1\n 2195: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2198: aastore\n 2199: aload 34\n 2201: iconst_1\n 2202: iconst_2\n 2203: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2206: aastore\n 2207: aload 34\n 2209: iconst_2\n 2210: iconst_3\n 2211: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2214: aastore\n 2215: aload 34\n 2217: iconst_3\n 2218: iconst_3\n 2219: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2222: aastore\n 2223: aload 34\n 2225: iconst_4\n 2226: iconst_4\n 2227: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2230: aastore\n 2231: aload 34\n 2233: iconst_5\n 2234: iconst_5\n 2235: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2238: aastore\n 2239: aload 34\n 2241: bipush 6\n 2243: bipush 6\n 2245: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2248: aastore\n 2249: aload 34\n 2251: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2254: astore 33\n 2256: bipush 7\n 2258: anewarray #87 // class java/lang/Integer\n 2261: astore 35\n 2263: aload 35\n 2265: iconst_0\n 2266: iconst_1\n 2267: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2270: aastore\n 2271: aload 35\n 2273: iconst_1\n 2274: iconst_2\n 2275: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2278: aastore\n 2279: aload 35\n 2281: iconst_2\n 2282: iconst_3\n 2283: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2286: aastore\n 2287: aload 35\n 2289: iconst_3\n 2290: iconst_3\n 2291: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2294: aastore\n 2295: aload 35\n 2297: iconst_4\n 2298: iconst_4\n 2299: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2302: aastore\n 2303: aload 35\n 2305: iconst_5\n 2306: iconst_5\n 2307: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2310: aastore\n 2311: aload 35\n 2313: bipush 6\n 2315: bipush 7\n 2317: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2320: aastore\n 2321: aload 35\n 2323: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2326: astore 34\n 2328: aload 32\n 2330: aload 33\n 2332: checkcast #238 // class java/util/Collection\n 2335: invokeinterface #244, 2 // InterfaceMethod java/util/List.retainAll:(Ljava/util/Collection;)Z\n 2340: istore 35\n 2342: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 2345: iload 35\n 2347: invokevirtual #133 // Method java/io/PrintStream.println:(Z)V\n 2350: aload 32\n 2352: aload 34\n 2354: checkcast #238 // class java/util/Collection\n 2357: invokeinterface #244, 2 // InterfaceMethod java/util/List.retainAll:(Ljava/util/Collection;)Z\n 2362: istore 35\n 2364: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 2367: iload 35\n 2369: invokevirtual #133 // Method java/io/PrintStream.println:(Z)V\n 2372: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 2375: aload 32\n 2377: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 2380: bipush 8\n 2382: anewarray #87 // class java/lang/Integer\n 2385: astore 36\n 2387: aload 36\n 2389: iconst_0\n 2390: iconst_1\n 2391: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2394: aastore\n 2395: aload 36\n 2397: iconst_1\n 2398: iconst_2\n 2399: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2402: aastore\n 2403: aload 36\n 2405: iconst_2\n 2406: iconst_3\n 2407: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2410: aastore\n 2411: aload 36\n 2413: iconst_3\n 2414: iconst_4\n 2415: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2418: aastore\n 2419: aload 36\n 2421: iconst_4\n 2422: iconst_5\n 2423: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2426: aastore\n 2427: aload 36\n 2429: iconst_5\n 2430: bipush 6\n 2432: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2435: aastore\n 2436: aload 36\n 2438: bipush 6\n 2440: bipush 7\n 2442: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2445: aastore\n 2446: aload 36\n 2448: bipush 7\n 2450: bipush 8\n 2452: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2455: aastore\n 2456: aload 36\n 2458: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2461: astore 35\n 2463: aload 35\n 2465: checkcast #71 // class java/lang/Iterable\n 2468: astore 37\n 2470: iconst_0\n 2471: istore 38\n 2473: aload 37\n 2475: astore 39\n 2477: new #246 // class java/util/ArrayList\n 2480: dup\n 2481: invokespecial #247 // Method java/util/ArrayList.\"<init>\":()V\n 2484: checkcast #238 // class java/util/Collection\n 2487: astore 40\n 2489: iconst_0\n 2490: istore 41\n 2492: aload 39\n 2494: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 2499: astore 42\n 2501: aload 42\n 2503: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 2508: ifeq 2561\n 2511: aload 42\n 2513: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 2518: astore 43\n 2520: aload 43\n 2522: checkcast #115 // class java/lang/Number\n 2525: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 2528: istore 44\n 2530: iconst_0\n 2531: istore 45\n 2533: iload 44\n 2535: iconst_2\n 2536: irem\n 2537: ifne 2544\n 2540: iconst_1\n 2541: goto 2545\n 2544: iconst_0\n 2545: ifeq 2501\n 2548: aload 40\n 2550: aload 43\n 2552: invokeinterface #251, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 2557: pop\n 2558: goto 2501\n 2561: aload 40\n 2563: checkcast #240 // class java/util/List\n 2566: nop\n 2567: astore 36\n 2569: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 2572: aload 36\n 2574: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 2577: bipush 8\n 2579: anewarray #87 // class java/lang/Integer\n 2582: astore 38\n 2584: aload 38\n 2586: iconst_0\n 2587: iconst_1\n 2588: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2591: aastore\n 2592: aload 38\n 2594: iconst_1\n 2595: iconst_2\n 2596: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2599: aastore\n 2600: aload 38\n 2602: iconst_2\n 2603: iconst_3\n 2604: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2607: aastore\n 2608: aload 38\n 2610: iconst_3\n 2611: iconst_4\n 2612: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2615: aastore\n 2616: aload 38\n 2618: iconst_4\n 2619: iconst_5\n 2620: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2623: aastore\n 2624: aload 38\n 2626: iconst_5\n 2627: bipush 6\n 2629: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2632: aastore\n 2633: aload 38\n 2635: bipush 6\n 2637: bipush 7\n 2639: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2642: aastore\n 2643: aload 38\n 2645: bipush 7\n 2647: bipush 8\n 2649: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2652: aastore\n 2653: aload 38\n 2655: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2658: astore 37\n 2660: new #246 // class java/util/ArrayList\n 2663: dup\n 2664: invokespecial #247 // Method java/util/ArrayList.\"<init>\":()V\n 2667: checkcast #240 // class java/util/List\n 2670: astore 38\n 2672: aload 35\n 2674: checkcast #71 // class java/lang/Iterable\n 2677: astore 39\n 2679: iconst_0\n 2680: istore 40\n 2682: aload 39\n 2684: astore 41\n 2686: iconst_0\n 2687: istore 42\n 2689: iconst_0\n 2690: istore 43\n 2692: aload 41\n 2694: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 2699: astore 44\n 2701: aload 44\n 2703: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 2708: ifeq 2809\n 2711: aload 44\n 2713: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 2718: astore 45\n 2720: iload 43\n 2722: iinc 43, 1\n 2725: istore 46\n 2727: iload 46\n 2729: ifge 2735\n 2732: invokestatic #254 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 2735: iload 46\n 2737: aload 45\n 2739: astore 47\n 2741: istore 48\n 2743: iconst_0\n 2744: istore 49\n 2746: iload 48\n 2748: aload 47\n 2750: checkcast #115 // class java/lang/Number\n 2753: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 2756: istore 50\n 2758: istore 51\n 2760: iconst_0\n 2761: istore 52\n 2763: aload 37\n 2765: iload 51\n 2767: invokeinterface #258, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 2772: checkcast #115 // class java/lang/Number\n 2775: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 2778: iconst_2\n 2779: irem\n 2780: ifne 2787\n 2783: iconst_1\n 2784: goto 2788\n 2787: iconst_0\n 2788: ifeq 2804\n 2791: aload 38\n 2793: checkcast #238 // class java/util/Collection\n 2796: aload 47\n 2798: invokeinterface #251, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 2803: pop\n 2804: nop\n 2805: nop\n 2806: goto 2701\n 2809: nop\n 2810: aload 38\n 2812: checkcast #238 // class java/util/Collection\n 2815: pop\n 2816: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 2819: aload 38\n 2821: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 2824: bipush 12\n 2826: anewarray #4 // class java/lang/Object\n 2829: astore 40\n 2831: aload 40\n 2833: iconst_0\n 2834: iconst_1\n 2835: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2838: aastore\n 2839: aload 40\n 2841: iconst_1\n 2842: iconst_2\n 2843: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2846: aastore\n 2847: aload 40\n 2849: iconst_2\n 2850: iconst_3\n 2851: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2854: aastore\n 2855: aload 40\n 2857: iconst_3\n 2858: ldc_w #260 // String one\n 2861: aastore\n 2862: aload 40\n 2864: iconst_4\n 2865: ldc_w #262 // String two\n 2868: aastore\n 2869: aload 40\n 2871: iconst_5\n 2872: iconst_4\n 2873: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2876: aastore\n 2877: aload 40\n 2879: bipush 6\n 2881: ldc_w #264 // String three\n 2884: aastore\n 2885: aload 40\n 2887: bipush 7\n 2889: ldc_w #266 // String four\n 2892: aastore\n 2893: aload 40\n 2895: bipush 8\n 2897: iconst_5\n 2898: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2901: aastore\n 2902: aload 40\n 2904: bipush 9\n 2906: bipush 6\n 2908: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2911: aastore\n 2912: aload 40\n 2914: bipush 10\n 2916: ldc_w #268 // String five\n 2919: aastore\n 2920: aload 40\n 2922: bipush 11\n 2924: bipush 7\n 2926: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 2929: aastore\n 2930: aload 40\n 2932: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2935: astore 39\n 2937: aload 39\n 2939: checkcast #71 // class java/lang/Iterable\n 2942: astore 41\n 2944: iconst_0\n 2945: istore 42\n 2947: aload 41\n 2949: astore 43\n 2951: new #246 // class java/util/ArrayList\n 2954: dup\n 2955: invokespecial #247 // Method java/util/ArrayList.\"<init>\":()V\n 2958: checkcast #238 // class java/util/Collection\n 2961: astore 44\n 2963: iconst_0\n 2964: istore 45\n 2966: aload 43\n 2968: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 2973: astore 46\n 2975: aload 46\n 2977: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 2982: ifeq 3015\n 2985: aload 46\n 2987: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 2992: astore 47\n 2994: aload 47\n 2996: instanceof #8 // class java/lang/String\n 2999: ifeq 2975\n 3002: aload 44\n 3004: aload 47\n 3006: invokeinterface #251, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 3011: pop\n 3012: goto 2975\n 3015: aload 44\n 3017: checkcast #240 // class java/util/List\n 3020: nop\n 3021: astore 40\n 3023: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3026: aload 40\n 3028: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3031: iconst_5\n 3032: anewarray #87 // class java/lang/Integer\n 3035: astore 42\n 3037: aload 42\n 3039: iconst_0\n 3040: iconst_1\n 3041: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3044: aastore\n 3045: aload 42\n 3047: iconst_1\n 3048: iconst_2\n 3049: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3052: aastore\n 3053: aload 42\n 3055: iconst_2\n 3056: iconst_3\n 3057: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3060: aastore\n 3061: aload 42\n 3063: iconst_3\n 3064: iconst_4\n 3065: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3068: aastore\n 3069: aload 42\n 3071: iconst_4\n 3072: iconst_5\n 3073: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3076: aastore\n 3077: aload 42\n 3079: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3082: astore 41\n 3084: bipush 6\n 3086: anewarray #8 // class java/lang/String\n 3089: astore 43\n 3091: aload 43\n 3093: iconst_0\n 3094: ldc_w #270 // String a\n 3097: aastore\n 3098: aload 43\n 3100: iconst_1\n 3101: ldc_w #272 // String b\n 3104: aastore\n 3105: aload 43\n 3107: iconst_2\n 3108: ldc_w #274 // String c\n 3111: aastore\n 3112: aload 43\n 3114: iconst_3\n 3115: ldc_w #276 // String d\n 3118: aastore\n 3119: aload 43\n 3121: iconst_4\n 3122: ldc_w #278 // String e\n 3125: aastore\n 3126: aload 43\n 3128: iconst_5\n 3129: ldc_w #280 // String f\n 3132: aastore\n 3133: aload 43\n 3135: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3138: astore 42\n 3140: aload 41\n 3142: checkcast #71 // class java/lang/Iterable\n 3145: aload 42\n 3147: checkcast #71 // class java/lang/Iterable\n 3150: invokestatic #284 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 3153: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3156: swap\n 3157: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3160: iconst_5\n 3161: anewarray #87 // class java/lang/Integer\n 3164: astore 44\n 3166: aload 44\n 3168: iconst_0\n 3169: iconst_1\n 3170: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3173: aastore\n 3174: aload 44\n 3176: iconst_1\n 3177: iconst_2\n 3178: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3181: aastore\n 3182: aload 44\n 3184: iconst_2\n 3185: iconst_3\n 3186: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3189: aastore\n 3190: aload 44\n 3192: iconst_3\n 3193: iconst_4\n 3194: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3197: aastore\n 3198: aload 44\n 3200: iconst_4\n 3201: iconst_5\n 3202: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3205: aastore\n 3206: aload 44\n 3208: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3211: astore 43\n 3213: aload 43\n 3215: checkcast #71 // class java/lang/Iterable\n 3218: invokestatic #287 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 3221: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3224: swap\n 3225: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3228: iconst_4\n 3229: anewarray #289 // class kotlin/Pair\n 3232: astore 45\n 3234: aload 45\n 3236: iconst_0\n 3237: ldc #10 // String Amit\n 3239: bipush 8\n 3241: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3244: invokestatic #295 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 3247: aastore\n 3248: aload 45\n 3250: iconst_1\n 3251: ldc #12 // String Ali\n 3253: bipush 10\n 3255: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3258: invokestatic #295 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 3261: aastore\n 3262: aload 45\n 3264: iconst_2\n 3265: ldc #14 // String Sumit\n 3267: iconst_4\n 3268: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3271: invokestatic #295 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 3274: aastore\n 3275: aload 45\n 3277: iconst_3\n 3278: ldc #16 // String Himanshu\n 3280: iconst_2\n 3281: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3284: invokestatic #295 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 3287: aastore\n 3288: aload 45\n 3290: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3293: astore 44\n 3295: aload 44\n 3297: checkcast #71 // class java/lang/Iterable\n 3300: invokestatic #299 // Method kotlin/collections/CollectionsKt.unzip:(Ljava/lang/Iterable;)Lkotlin/Pair;\n 3303: astore 45\n 3305: aload 45\n 3307: invokevirtual #302 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 3310: checkcast #240 // class java/util/List\n 3313: astore 46\n 3315: aload 45\n 3317: invokevirtual #305 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 3320: checkcast #240 // class java/util/List\n 3323: astore 47\n 3325: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3328: aload 46\n 3330: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3333: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3336: aload 47\n 3338: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3341: iconst_4\n 3342: anewarray #307 // class CollectionFunctionsKt$main$User\n 3345: astore 49\n 3347: aload 49\n 3349: iconst_0\n 3350: new #307 // class CollectionFunctionsKt$main$User\n 3353: dup\n 3354: iconst_1\n 3355: ldc #10 // String Amit\n 3357: iconst_1\n 3358: invokespecial #310 // Method CollectionFunctionsKt$main$User.\"<init>\":(ILjava/lang/String;Z)V\n 3361: aastore\n 3362: aload 49\n 3364: iconst_1\n 3365: new #307 // class CollectionFunctionsKt$main$User\n 3368: dup\n 3369: iconst_2\n 3370: ldc #12 // String Ali\n 3372: iconst_1\n 3373: invokespecial #310 // Method CollectionFunctionsKt$main$User.\"<init>\":(ILjava/lang/String;Z)V\n 3376: aastore\n 3377: aload 49\n 3379: iconst_2\n 3380: new #307 // class CollectionFunctionsKt$main$User\n 3383: dup\n 3384: iconst_3\n 3385: ldc #14 // String Sumit\n 3387: iconst_0\n 3388: invokespecial #310 // Method CollectionFunctionsKt$main$User.\"<init>\":(ILjava/lang/String;Z)V\n 3391: aastore\n 3392: aload 49\n 3394: iconst_3\n 3395: new #307 // class CollectionFunctionsKt$main$User\n 3398: dup\n 3399: iconst_4\n 3400: ldc #16 // String Himanshu\n 3402: iconst_0\n 3403: invokespecial #310 // Method CollectionFunctionsKt$main$User.\"<init>\":(ILjava/lang/String;Z)V\n 3406: aastore\n 3407: aload 49\n 3409: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3412: astore 48\n 3414: aload 48\n 3416: checkcast #71 // class java/lang/Iterable\n 3419: astore 50\n 3421: iconst_0\n 3422: istore 51\n 3424: new #246 // class java/util/ArrayList\n 3427: dup\n 3428: invokespecial #247 // Method java/util/ArrayList.\"<init>\":()V\n 3431: astore 52\n 3433: new #246 // class java/util/ArrayList\n 3436: dup\n 3437: invokespecial #247 // Method java/util/ArrayList.\"<init>\":()V\n 3440: astore 53\n 3442: aload 50\n 3444: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 3449: astore 54\n 3451: aload 54\n 3453: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 3458: ifeq 3509\n 3461: aload 54\n 3463: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 3468: astore 55\n 3470: aload 55\n 3472: checkcast #307 // class CollectionFunctionsKt$main$User\n 3475: astore 56\n 3477: iconst_0\n 3478: istore 57\n 3480: aload 56\n 3482: invokevirtual #311 // Method CollectionFunctionsKt$main$User.isFootballLover:()Z\n 3485: ifeq 3498\n 3488: aload 52\n 3490: aload 55\n 3492: invokevirtual #312 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 3495: goto 3505\n 3498: aload 53\n 3500: aload 55\n 3502: invokevirtual #312 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 3505: pop\n 3506: goto 3451\n 3509: new #289 // class kotlin/Pair\n 3512: dup\n 3513: aload 52\n 3515: aload 53\n 3517: invokespecial #315 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 3520: astore 49\n 3522: aload 49\n 3524: invokevirtual #302 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 3527: checkcast #240 // class java/util/List\n 3530: astore 50\n 3532: aload 49\n 3534: invokevirtual #305 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 3537: checkcast #240 // class java/util/List\n 3540: astore 51\n 3542: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3545: aload 50\n 3547: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3550: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3553: aload 51\n 3555: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3558: iconst_5\n 3559: anewarray #87 // class java/lang/Integer\n 3562: astore 53\n 3564: aload 53\n 3566: iconst_0\n 3567: iconst_1\n 3568: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3571: aastore\n 3572: aload 53\n 3574: iconst_1\n 3575: iconst_2\n 3576: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3579: aastore\n 3580: aload 53\n 3582: iconst_2\n 3583: iconst_3\n 3584: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3587: aastore\n 3588: aload 53\n 3590: iconst_3\n 3591: iconst_4\n 3592: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3595: aastore\n 3596: aload 53\n 3598: iconst_4\n 3599: iconst_5\n 3600: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3603: aastore\n 3604: aload 53\n 3606: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3609: astore 52\n 3611: aload 52\n 3613: checkcast #71 // class java/lang/Iterable\n 3616: invokestatic #318 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;\n 3619: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3622: swap\n 3623: invokevirtual #180 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 3626: aload 52\n 3628: invokestatic #322 // Method kotlin/collections/CollectionsKt.asReversed:(Ljava/util/List;)Ljava/util/List;\n 3631: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3634: swap\n 3635: invokevirtual #180 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 3638: bipush 10\n 3640: anewarray #87 // class java/lang/Integer\n 3643: astore 54\n 3645: aload 54\n 3647: iconst_0\n 3648: iconst_1\n 3649: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3652: aastore\n 3653: aload 54\n 3655: iconst_1\n 3656: iconst_2\n 3657: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3660: aastore\n 3661: aload 54\n 3663: iconst_2\n 3664: iconst_3\n 3665: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3668: aastore\n 3669: aload 54\n 3671: iconst_3\n 3672: iconst_4\n 3673: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3676: aastore\n 3677: aload 54\n 3679: iconst_4\n 3680: iconst_5\n 3681: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3684: aastore\n 3685: aload 54\n 3687: iconst_5\n 3688: bipush 6\n 3690: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3693: aastore\n 3694: aload 54\n 3696: bipush 6\n 3698: bipush 7\n 3700: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3703: aastore\n 3704: aload 54\n 3706: bipush 7\n 3708: bipush 8\n 3710: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3713: aastore\n 3714: aload 54\n 3716: bipush 8\n 3718: bipush 9\n 3720: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3723: aastore\n 3724: aload 54\n 3726: bipush 9\n 3728: bipush 10\n 3730: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3733: aastore\n 3734: aload 54\n 3736: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3739: astore 53\n 3741: aload 53\n 3743: checkcast #71 // class java/lang/Iterable\n 3746: astore 54\n 3748: iconst_0\n 3749: istore 55\n 3751: aload 54\n 3753: astore 56\n 3755: new #324 // class java/util/LinkedHashMap\n 3758: dup\n 3759: invokespecial #325 // Method java/util/LinkedHashMap.\"<init>\":()V\n 3762: checkcast #327 // class java/util/Map\n 3765: astore 57\n 3767: iconst_0\n 3768: istore 58\n 3770: aload 56\n 3772: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 3777: astore 59\n 3779: aload 59\n 3781: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 3786: ifeq 3896\n 3789: aload 59\n 3791: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 3796: astore 60\n 3798: aload 60\n 3800: checkcast #115 // class java/lang/Number\n 3803: invokevirtual #119 // Method java/lang/Number.intValue:()I\n 3806: istore 61\n 3808: iconst_0\n 3809: istore 62\n 3811: iload 61\n 3813: iconst_4\n 3814: irem\n 3815: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3818: astore 63\n 3820: aload 57\n 3822: astore 64\n 3824: iconst_0\n 3825: istore 65\n 3827: aload 64\n 3829: aload 63\n 3831: invokeinterface #330, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 3836: astore 66\n 3838: aload 66\n 3840: ifnonnull 3875\n 3843: iconst_0\n 3844: istore 67\n 3846: new #246 // class java/util/ArrayList\n 3849: dup\n 3850: invokespecial #247 // Method java/util/ArrayList.\"<init>\":()V\n 3853: checkcast #240 // class java/util/List\n 3856: astore 67\n 3858: aload 64\n 3860: aload 63\n 3862: aload 67\n 3864: invokeinterface #334, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 3869: pop\n 3870: aload 67\n 3872: goto 3877\n 3875: aload 66\n 3877: nop\n 3878: checkcast #240 // class java/util/List\n 3881: astore 61\n 3883: aload 61\n 3885: aload 60\n 3887: invokeinterface #335, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 3892: pop\n 3893: goto 3779\n 3896: aload 57\n 3898: nop\n 3899: astore 54\n 3901: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3904: aload 54\n 3906: invokevirtual #180 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 3909: bipush 7\n 3911: anewarray #87 // class java/lang/Integer\n 3914: astore 55\n 3916: aload 55\n 3918: iconst_0\n 3919: bipush 10\n 3921: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3924: aastore\n 3925: aload 55\n 3927: iconst_1\n 3928: iconst_4\n 3929: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3932: aastore\n 3933: aload 55\n 3935: iconst_2\n 3936: iconst_1\n 3937: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3940: aastore\n 3941: aload 55\n 3943: iconst_3\n 3944: iconst_3\n 3945: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3948: aastore\n 3949: aload 55\n 3951: iconst_4\n 3952: bipush 7\n 3954: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3957: aastore\n 3958: aload 55\n 3960: iconst_5\n 3961: iconst_2\n 3962: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3965: aastore\n 3966: aload 55\n 3968: bipush 6\n 3970: bipush 6\n 3972: invokestatic #91 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 3975: aastore\n 3976: aload 55\n 3978: invokestatic #69 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 3981: astore 54\n 3983: aload 54\n 3985: checkcast #71 // class java/lang/Iterable\n 3988: invokestatic #338 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;\n 3991: getstatic #28 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3994: swap\n 3995: invokevirtual #34 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 3998: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #483 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
winger__team-competitions__df24b92/hashcode/y2018/qual/Main.kt
import java.io.File import java.io.PrintWriter import java.util.* //val filename = "a_example" //val filename = "b_should_be_easy" //val filename = "c_no_hurry" val filename = "d_metropolis" //val filename = "e_high_bonus" fun main(args: Array<String>) { val sc = Scanner(File("data/$filename.in")) val (_, _, V, R) = Array(4) { sc.nextInt() } B = sc.nextInt() val T = sc.nextInt() val rides = Array(R) { sc.nextRide(it) } val cars = Array(V) { Car(Point(0, 0), 0) } println("Max score: " + rides.sumBy { it.duration + B }) rides.sortBy { it.end - it.duration } for (ride in rides) { cars.maxBy { it.canScore(ride) }?.take(ride) } println(cars.totalScore) printSolution(cars) } val Array<Car>.totalScore get() = fold(0) { acc, state -> acc + state.score } var B = 0 class Car(var point: Point, var time: Int, val schedule: MutableList<Ride> = mutableListOf(), var score: Int = 0) { fun willFinishAt(ride: Ride) = possibleArrival(ride) + ride.duration fun possibleArrival(ride: Ride) = Math.max(time + (ride.start - point), ride.begin) fun waitTime(ride: Ride) = Math.max(possibleArrival(ride) - time, 0) fun canScore(ride: Ride): Int { return if (willFinishAt(ride) <= ride.end) { ride.duration + if (possibleArrival(ride) <= ride.begin) B else 0 } else 0 } fun take(ride: Ride) { score += canScore(ride) schedule += ride time = willFinishAt(ride) point = ride.finish } } fun printSolution(solution: Array<Car>) { PrintWriter("$filename-${solution.totalScore}.out").use { pr -> solution.forEach { pr.print(it.schedule.size) it.schedule.forEach { pr.print(" ${it.num}") } pr.println() } } } operator fun Point.minus(o: Point) = Math.abs(x - o.x) + Math.abs(y - o.y) data class Point(val x: Int, val y: Int) data class Ride(val num: Int, val start: Point, val finish: Point, val begin: Int, val end: Int) { val duration get() = finish - start } val Ride.longRide get() = finish.x > 5000 || finish.y > 5000 fun Scanner.nextPoint() = Point(nextInt(), nextInt()) fun Scanner.nextRide(num: Int) = Ride(num, nextPoint(), nextPoint(), nextInt(), nextInt())
[ { "class_path": "winger__team-competitions__df24b92/MainKt.class", "javap": "Compiled from \"Main.kt\"\npublic final class MainKt {\n private static final java.lang.String filename;\n\n private static int B;\n\n public static final java.lang.String getFilename();\n Code:\n 0: getstatic #11 // Field filename:Ljava/lang/String;\n 3: areturn\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #15 // String args\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #23 // class java/util/Scanner\n 9: dup\n 10: new #25 // class java/io/File\n 13: dup\n 14: new #27 // class java/lang/StringBuilder\n 17: dup\n 18: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 21: ldc #33 // String data/\n 23: invokevirtual #37 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 26: getstatic #11 // Field filename:Ljava/lang/String;\n 29: invokevirtual #37 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 32: ldc #39 // String .in\n 34: invokevirtual #37 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 37: invokevirtual #42 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 40: invokespecial #45 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 43: invokespecial #48 // Method java/util/Scanner.\"<init>\":(Ljava/io/File;)V\n 46: astore_1\n 47: iconst_0\n 48: istore_3\n 49: iconst_4\n 50: anewarray #50 // class java/lang/Integer\n 53: astore 4\n 55: iload_3\n 56: iconst_4\n 57: if_icmpge 81\n 60: iload_3\n 61: istore 5\n 63: aload 4\n 65: iload 5\n 67: aload_1\n 68: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 71: invokestatic #58 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 74: aastore\n 75: iinc 3, 1\n 78: goto 55\n 81: aload 4\n 83: astore_2\n 84: aload_2\n 85: iconst_2\n 86: aaload\n 87: checkcast #60 // class java/lang/Number\n 90: invokevirtual #63 // Method java/lang/Number.intValue:()I\n 93: istore_3\n 94: aload_2\n 95: iconst_3\n 96: aaload\n 97: checkcast #60 // class java/lang/Number\n 100: invokevirtual #63 // Method java/lang/Number.intValue:()I\n 103: istore 4\n 105: aload_1\n 106: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 109: putstatic #67 // Field B:I\n 112: aload_1\n 113: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 116: istore 5\n 118: iconst_0\n 119: istore 7\n 121: iload 4\n 123: anewarray #69 // class Ride\n 126: astore 8\n 128: iload 7\n 130: iload 4\n 132: if_icmpge 156\n 135: iload 7\n 137: istore 9\n 139: aload 8\n 141: iload 9\n 143: aload_1\n 144: iload 9\n 146: invokestatic #73 // Method nextRide:(Ljava/util/Scanner;I)LRide;\n 149: aastore\n 150: iinc 7, 1\n 153: goto 128\n 156: aload 8\n 158: astore 6\n 160: iconst_0\n 161: istore 8\n 163: iload_3\n 164: anewarray #75 // class Car\n 167: astore 9\n 169: iload 8\n 171: iload_3\n 172: if_icmpge 212\n 175: iload 8\n 177: istore 10\n 179: aload 9\n 181: iload 10\n 183: new #75 // class Car\n 186: dup\n 187: new #77 // class Point\n 190: dup\n 191: iconst_0\n 192: iconst_0\n 193: invokespecial #80 // Method Point.\"<init>\":(II)V\n 196: iconst_0\n 197: aconst_null\n 198: iconst_0\n 199: bipush 12\n 201: aconst_null\n 202: invokespecial #83 // Method Car.\"<init>\":(LPoint;ILjava/util/List;IILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 205: aastore\n 206: iinc 8, 1\n 209: goto 169\n 212: aload 9\n 214: astore 7\n 216: new #27 // class java/lang/StringBuilder\n 219: dup\n 220: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 223: ldc #85 // String Max score:\n 225: invokevirtual #37 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 228: aload 6\n 230: astore 8\n 232: astore 21\n 234: iconst_0\n 235: istore 9\n 237: iconst_0\n 238: istore 10\n 240: iconst_0\n 241: istore 11\n 243: aload 8\n 245: arraylength\n 246: istore 12\n 248: iload 11\n 250: iload 12\n 252: if_icmpge 297\n 255: aload 8\n 257: iload 11\n 259: aaload\n 260: astore 13\n 262: iload 10\n 264: aload 13\n 266: astore 14\n 268: istore 22\n 270: iconst_0\n 271: istore 15\n 273: aload 14\n 275: invokevirtual #88 // Method Ride.getDuration:()I\n 278: getstatic #67 // Field B:I\n 281: iadd\n 282: istore 23\n 284: iload 22\n 286: iload 23\n 288: iadd\n 289: istore 10\n 291: iinc 11, 1\n 294: goto 248\n 297: iload 10\n 299: istore 22\n 301: aload 21\n 303: iload 22\n 305: invokevirtual #91 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 308: invokevirtual #42 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 311: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 314: swap\n 315: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 318: aload 6\n 320: astore 8\n 322: iconst_0\n 323: istore 9\n 325: aload 8\n 327: arraylength\n 328: iconst_1\n 329: if_icmple 347\n 332: aload 8\n 334: new #105 // class MainKt$main$$inlined$sortBy$1\n 337: dup\n 338: invokespecial #106 // Method MainKt$main$$inlined$sortBy$1.\"<init>\":()V\n 341: checkcast #108 // class java/util/Comparator\n 344: invokestatic #114 // Method kotlin/collections/ArraysKt.sortWith:([Ljava/lang/Object;Ljava/util/Comparator;)V\n 347: nop\n 348: iconst_0\n 349: istore 8\n 351: aload 6\n 353: arraylength\n 354: istore 9\n 356: iload 8\n 358: iload 9\n 360: if_icmpge 520\n 363: aload 6\n 365: iload 8\n 367: aaload\n 368: astore 10\n 370: aload 7\n 372: astore 12\n 374: iconst_0\n 375: istore 13\n 377: aload 12\n 379: arraylength\n 380: ifne 387\n 383: iconst_1\n 384: goto 388\n 387: iconst_0\n 388: ifeq 399\n 391: new #116 // class java/util/NoSuchElementException\n 394: dup\n 395: invokespecial #117 // Method java/util/NoSuchElementException.\"<init>\":()V\n 398: athrow\n 399: aload 12\n 401: iconst_0\n 402: aaload\n 403: astore 14\n 405: aload 12\n 407: invokestatic #121 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I\n 410: istore 15\n 412: iload 15\n 414: ifne 422\n 417: aload 14\n 419: goto 501\n 422: aload 14\n 424: astore 16\n 426: iconst_0\n 427: istore 17\n 429: aload 16\n 431: aload 10\n 433: invokevirtual #125 // Method Car.canScore:(LRide;)I\n 436: istore 16\n 438: iconst_1\n 439: istore 17\n 441: iload 17\n 443: iload 15\n 445: if_icmpgt 499\n 448: aload 12\n 450: iload 17\n 452: aaload\n 453: astore 18\n 455: aload 18\n 457: astore 19\n 459: iconst_0\n 460: istore 20\n 462: aload 19\n 464: aload 10\n 466: invokevirtual #125 // Method Car.canScore:(LRide;)I\n 469: istore 19\n 471: iload 16\n 473: iload 19\n 475: if_icmpge 486\n 478: aload 18\n 480: astore 14\n 482: iload 19\n 484: istore 16\n 486: iload 17\n 488: iload 15\n 490: if_icmpeq 499\n 493: iinc 17, 1\n 496: goto 448\n 499: aload 14\n 501: dup\n 502: ifnull 513\n 505: aload 10\n 507: invokevirtual #129 // Method Car.take:(LRide;)V\n 510: goto 514\n 513: pop\n 514: iinc 8, 1\n 517: goto 356\n 520: aload 7\n 522: invokestatic #133 // Method getTotalScore:([LCar;)I\n 525: istore 8\n 527: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 530: iload 8\n 532: invokevirtual #136 // Method java/io/PrintStream.println:(I)V\n 535: aload 7\n 537: invokestatic #140 // Method printSolution:([LCar;)V\n 540: return\n\n public static final int getTotalScore(Car[]);\n Code:\n 0: aload_0\n 1: ldc #179 // String <this>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_1\n 8: iconst_0\n 9: istore_2\n 10: iconst_0\n 11: istore_3\n 12: iload_2\n 13: istore 4\n 15: iconst_0\n 16: istore 5\n 18: aload_1\n 19: arraylength\n 20: istore 6\n 22: iload 5\n 24: iload 6\n 26: if_icmpge 62\n 29: aload_1\n 30: iload 5\n 32: aaload\n 33: astore 7\n 35: iload 4\n 37: aload 7\n 39: astore 8\n 41: istore 9\n 43: iconst_0\n 44: istore 10\n 46: iload 9\n 48: aload 8\n 50: invokevirtual #182 // Method Car.getScore:()I\n 53: iadd\n 54: istore 4\n 56: iinc 5, 1\n 59: goto 22\n 62: iload 4\n 64: ireturn\n\n public static final int getB();\n Code:\n 0: getstatic #67 // Field B:I\n 3: ireturn\n\n public static final void setB(int);\n Code:\n 0: iload_0\n 1: putstatic #67 // Field B:I\n 4: return\n\n public static final void printSolution(Car[]);\n Code:\n 0: aload_0\n 1: ldc #197 // String solution\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #199 // class java/io/PrintWriter\n 9: dup\n 10: new #27 // class java/lang/StringBuilder\n 13: dup\n 14: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 17: getstatic #11 // Field filename:Ljava/lang/String;\n 20: invokevirtual #37 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 23: bipush 45\n 25: invokevirtual #202 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 28: aload_0\n 29: invokestatic #133 // Method getTotalScore:([LCar;)I\n 32: invokevirtual #91 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 35: ldc #204 // String .out\n 37: invokevirtual #37 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 40: invokevirtual #42 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 43: invokespecial #205 // Method java/io/PrintWriter.\"<init>\":(Ljava/lang/String;)V\n 46: checkcast #207 // class java/io/Closeable\n 49: astore_1\n 50: aconst_null\n 51: astore_2\n 52: nop\n 53: aload_1\n 54: checkcast #199 // class java/io/PrintWriter\n 57: astore_3\n 58: iconst_0\n 59: istore 4\n 61: aload_0\n 62: astore 5\n 64: iconst_0\n 65: istore 6\n 67: iconst_0\n 68: istore 7\n 70: aload 5\n 72: arraylength\n 73: istore 8\n 75: iload 7\n 77: iload 8\n 79: if_icmpge 206\n 82: aload 5\n 84: iload 7\n 86: aaload\n 87: astore 9\n 89: aload 9\n 91: astore 10\n 93: iconst_0\n 94: istore 11\n 96: aload_3\n 97: aload 10\n 99: invokevirtual #211 // Method Car.getSchedule:()Ljava/util/List;\n 102: invokeinterface #216, 1 // InterfaceMethod java/util/List.size:()I\n 107: invokevirtual #219 // Method java/io/PrintWriter.print:(I)V\n 110: aload 10\n 112: invokevirtual #211 // Method Car.getSchedule:()Ljava/util/List;\n 115: checkcast #221 // class java/lang/Iterable\n 118: astore 12\n 120: iconst_0\n 121: istore 13\n 123: aload 12\n 125: invokeinterface #225, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 130: astore 14\n 132: aload 14\n 134: invokeinterface #231, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 139: ifeq 193\n 142: aload 14\n 144: invokeinterface #235, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 149: astore 15\n 151: aload 15\n 153: checkcast #69 // class Ride\n 156: astore 16\n 158: iconst_0\n 159: istore 17\n 161: aload_3\n 162: new #27 // class java/lang/StringBuilder\n 165: dup\n 166: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 169: bipush 32\n 171: invokevirtual #202 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 174: aload 16\n 176: invokevirtual #238 // Method Ride.getNum:()I\n 179: invokevirtual #91 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 182: invokevirtual #42 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 185: invokevirtual #240 // Method java/io/PrintWriter.print:(Ljava/lang/String;)V\n 188: nop\n 189: nop\n 190: goto 132\n 193: nop\n 194: aload_3\n 195: invokevirtual #242 // Method java/io/PrintWriter.println:()V\n 198: nop\n 199: nop\n 200: iinc 7, 1\n 203: goto 75\n 206: nop\n 207: nop\n 208: getstatic #248 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 211: astore_3\n 212: aload_1\n 213: aload_2\n 214: invokestatic #254 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 217: goto 238\n 220: astore 4\n 222: aload 4\n 224: astore_2\n 225: aload 4\n 227: athrow\n 228: astore 4\n 230: aload_1\n 231: aload_2\n 232: invokestatic #254 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 235: aload 4\n 237: athrow\n 238: return\n Exception table:\n from to target type\n 52 212 220 Class java/lang/Throwable\n 52 212 228 any\n 220 228 228 any\n 228 230 228 any\n\n public static final int minus(Point, Point);\n Code:\n 0: aload_0\n 1: ldc #179 // String <this>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #266 // String o\n 10: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: invokevirtual #269 // Method Point.getX:()I\n 17: aload_1\n 18: invokevirtual #269 // Method Point.getX:()I\n 21: isub\n 22: invokestatic #275 // Method java/lang/Math.abs:(I)I\n 25: aload_0\n 26: invokevirtual #278 // Method Point.getY:()I\n 29: aload_1\n 30: invokevirtual #278 // Method Point.getY:()I\n 33: isub\n 34: invokestatic #275 // Method java/lang/Math.abs:(I)I\n 37: iadd\n 38: ireturn\n\n public static final boolean getLongRide(Ride);\n Code:\n 0: aload_0\n 1: ldc #179 // String <this>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #286 // Method Ride.getFinish:()LPoint;\n 10: invokevirtual #269 // Method Point.getX:()I\n 13: sipush 5000\n 16: if_icmpgt 32\n 19: aload_0\n 20: invokevirtual #286 // Method Ride.getFinish:()LPoint;\n 23: invokevirtual #278 // Method Point.getY:()I\n 26: sipush 5000\n 29: if_icmple 36\n 32: iconst_1\n 33: goto 37\n 36: iconst_0\n 37: ireturn\n\n public static final Point nextPoint(java.util.Scanner);\n Code:\n 0: aload_0\n 1: ldc #179 // String <this>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #77 // class Point\n 9: dup\n 10: aload_0\n 11: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 14: aload_0\n 15: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 18: invokespecial #80 // Method Point.\"<init>\":(II)V\n 21: areturn\n\n public static final Ride nextRide(java.util.Scanner, int);\n Code:\n 0: aload_0\n 1: ldc #179 // String <this>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #69 // class Ride\n 9: dup\n 10: iload_1\n 11: aload_0\n 12: invokestatic #292 // Method nextPoint:(Ljava/util/Scanner;)LPoint;\n 15: aload_0\n 16: invokestatic #292 // Method nextPoint:(Ljava/util/Scanner;)LPoint;\n 19: aload_0\n 20: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 23: aload_0\n 24: invokevirtual #54 // Method java/util/Scanner.nextInt:()I\n 27: invokespecial #295 // Method Ride.\"<init>\":(ILPoint;LPoint;II)V\n 30: areturn\n\n static {};\n Code:\n 0: ldc_w #300 // String d_metropolis\n 3: putstatic #11 // Field filename:Ljava/lang/String;\n 6: return\n}\n", "javap_err": "" }, { "class_path": "winger__team-competitions__df24b92/MainKt$main$$inlined$sortBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class MainKt$main$$inlined$sortBy$1<T> implements java.util.Comparator {\n public MainKt$main$$inlined$sortBy$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_1\n 1: checkcast #23 // class Ride\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method Ride.getEnd:()I\n 12: aload_3\n 13: invokevirtual #30 // Method Ride.getDuration:()I\n 16: isub\n 17: invokestatic #36 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 20: checkcast #38 // class java/lang/Comparable\n 23: aload_2\n 24: checkcast #23 // class Ride\n 27: astore_3\n 28: astore 5\n 30: iconst_0\n 31: istore 4\n 33: aload_3\n 34: invokevirtual #27 // Method Ride.getEnd:()I\n 37: aload_3\n 38: invokevirtual #30 // Method Ride.getDuration:()I\n 41: isub\n 42: invokestatic #36 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 45: aload 5\n 47: swap\n 48: checkcast #38 // class java/lang/Comparable\n 51: invokestatic #44 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 54: ireturn\n}\n", "javap_err": "" } ]
getnahid__programing-problem-solves-kotlin__589c392/OddOccurrencesInArray.kt
/* OddOccurrencesInArray Find value that occurs in odd number of elements. A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired. For example, in array A such that: A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5] = 7 A[6] = 9 the elements at indexes 0 and 2 have value 9, the elements at indexes 1 and 3 have value 3, the elements at indexes 4 and 6 have value 9, the element at index 5 has value 7 and is unpaired. Write a function: fun solution(A: IntArray): Int that, given an array A consisting of N integers fulfilling the above conditions, returns the value of the unpaired element. For example, given array A such that: A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5] = 7 A[6] = 9 the function should return 7, as explained in the example above. Write an efficient algorithm for the following assumptions: N is an odd integer within the range [1..1,000,000]; each element of array A is an integer within the range [1..1,000,000,000]; all but one of the values in A occur an even number of times.*/ fun solution(array: IntArray): Int { array.sort() val length = array.size for (i in array.indices step 2) { if (i + 1 < length && array[i] == array[i + 1]) continue return array[i] } return 0 }
[ { "class_path": "getnahid__programing-problem-solves-kotlin__589c392/OddOccurrencesInArrayKt.class", "javap": "Compiled from \"OddOccurrencesInArray.kt\"\npublic final class OddOccurrencesInArrayKt {\n public static final int solution(int[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String array\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #21 // Method kotlin/collections/ArraysKt.sort:([I)V\n 10: aload_0\n 11: arraylength\n 12: istore_1\n 13: aload_0\n 14: arraylength\n 15: iconst_m1\n 16: iadd\n 17: istore_2\n 18: iconst_0\n 19: istore_3\n 20: iconst_0\n 21: iload_2\n 22: iconst_2\n 23: invokestatic #27 // Method kotlin/internal/ProgressionUtilKt.getProgressionLastElement:(III)I\n 26: istore 4\n 28: iload_3\n 29: iload 4\n 31: if_icmpgt 68\n 34: iload_3\n 35: iconst_1\n 36: iadd\n 37: iload_1\n 38: if_icmpge 52\n 41: aload_0\n 42: iload_3\n 43: iaload\n 44: aload_0\n 45: iload_3\n 46: iconst_1\n 47: iadd\n 48: iaload\n 49: if_icmpeq 56\n 52: aload_0\n 53: iload_3\n 54: iaload\n 55: ireturn\n 56: iload_3\n 57: iload 4\n 59: if_icmpeq 68\n 62: iinc 3, 2\n 65: goto 34\n 68: iconst_0\n 69: ireturn\n}\n", "javap_err": "" } ]
getnahid__programing-problem-solves-kotlin__589c392/CyclicRotation.kt
/* CyclicRotation Rotate an array to the right by a given number of steps. An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9, 7] (elements are shifted right by one index and 6 is moved to the first place). The goal is to rotate array A K times; that is, each element of A will be shifted to the right K times. Write a function: class Solution { public int[] solution(int[] A, int K); } that, given an array A consisting of N integers and an integer K, returns the array A rotated K times. For example, given A = [3, 8, 9, 7, 6] K = 3 the function should return [9, 7, 6, 3, 8]. Three rotations were made: [3, 8, 9, 7, 6] -> [6, 3, 8, 9, 7] [6, 3, 8, 9, 7] -> [7, 6, 3, 8, 9] [7, 6, 3, 8, 9] -> [9, 7, 6, 3, 8] For another example, given A = [0, 0, 0] K = 1 the function should return [0, 0, 0] Given A = [1, 2, 3, 4] K = 4 the function should return [1, 2, 3, 4] Assume that: N and K are integers within the range [0..100]; each element of array A is an integer within the range [−1,000..1,000]. In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.*/ fun solution(array: IntArray, k: Int): IntArray { val arrayLength: Int = array.size val sol = IntArray(array.size) for (i in array.indices) { sol[(i + k) % arrayLength] = array.get(i) } //array.forEach { print(it) } return array }
[ { "class_path": "getnahid__programing-problem-solves-kotlin__589c392/CyclicRotationKt.class", "javap": "Compiled from \"CyclicRotation.kt\"\npublic final class CyclicRotationKt {\n public static final int[] solution(int[], int);\n Code:\n 0: aload_0\n 1: ldc #9 // String array\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: arraylength\n 8: istore_2\n 9: aload_0\n 10: arraylength\n 11: newarray int\n 13: astore_3\n 14: iconst_0\n 15: istore 4\n 17: aload_0\n 18: arraylength\n 19: istore 5\n 21: iload 4\n 23: iload 5\n 25: if_icmpge 46\n 28: aload_3\n 29: iload 4\n 31: iload_1\n 32: iadd\n 33: iload_2\n 34: irem\n 35: aload_0\n 36: iload 4\n 38: iaload\n 39: iastore\n 40: iinc 4, 1\n 43: goto 21\n 46: aload_0\n 47: areturn\n}\n", "javap_err": "" } ]
getnahid__programing-problem-solves-kotlin__589c392/BinaryGap.kt
/* BinaryGap Find longest sequence of zeros in binary representation of an integer. A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps. Write a function: class Solution { public int solution(int N); } that, given a positive integer N, returns the length of its longest binary gap. The function should return 0 if N doesn't contain a binary gap. For example, given N = 1041 the function should return 5, because N has binary representation 10000010001 and so its longest binary gap is of length 5. Given N = 32 the function should return 0, because N has binary representation '100000' and thus no binary gaps. Write an efficient algorithm for the following assumptions: N is an integer within the range [1..2,147,483,647].*/ fun solution(n: Int): Int { val stringBinary = Integer.toBinaryString(n) var part = Integer.toBinaryString(n).substring(0, stringBinary.lastIndexOf("1")) val parts = part.split("1", part) var max = 0; for (p in parts) { if (p.length > max) max = p.length } return max; }
[ { "class_path": "getnahid__programing-problem-solves-kotlin__589c392/BinaryGapKt.class", "javap": "Compiled from \"BinaryGap.kt\"\npublic final class BinaryGapKt {\n public static final int solution(int);\n Code:\n 0: iload_0\n 1: invokestatic #12 // Method java/lang/Integer.toBinaryString:(I)Ljava/lang/String;\n 4: astore_1\n 5: iload_0\n 6: invokestatic #12 // Method java/lang/Integer.toBinaryString:(I)Ljava/lang/String;\n 9: dup\n 10: ldc #14 // String toBinaryString(...)\n 12: invokestatic #20 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 15: astore_3\n 16: iconst_0\n 17: istore 4\n 19: aload_1\n 20: invokestatic #24 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 23: aload_1\n 24: checkcast #26 // class java/lang/CharSequence\n 27: ldc #28 // String 1\n 29: iconst_0\n 30: iconst_0\n 31: bipush 6\n 33: aconst_null\n 34: invokestatic #34 // Method kotlin/text/StringsKt.lastIndexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 37: istore 5\n 39: aload_3\n 40: iload 4\n 42: iload 5\n 44: invokevirtual #40 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 47: dup\n 48: ldc #42 // String substring(...)\n 50: invokestatic #20 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 53: astore_2\n 54: aload_2\n 55: checkcast #26 // class java/lang/CharSequence\n 58: iconst_2\n 59: anewarray #36 // class java/lang/String\n 62: astore 4\n 64: aload 4\n 66: iconst_0\n 67: ldc #28 // String 1\n 69: aastore\n 70: aload 4\n 72: iconst_1\n 73: aload_2\n 74: aastore\n 75: aload 4\n 77: iconst_0\n 78: iconst_0\n 79: bipush 6\n 81: aconst_null\n 82: invokestatic #46 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 85: astore_3\n 86: iconst_0\n 87: istore 4\n 89: aload_3\n 90: invokeinterface #52, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 95: astore 5\n 97: aload 5\n 99: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 104: ifeq 139\n 107: aload 5\n 109: invokeinterface #62, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 114: checkcast #36 // class java/lang/String\n 117: astore 6\n 119: aload 6\n 121: invokevirtual #66 // Method java/lang/String.length:()I\n 124: iload 4\n 126: if_icmple 97\n 129: aload 6\n 131: invokevirtual #66 // Method java/lang/String.length:()I\n 134: istore 4\n 136: goto 97\n 139: iload 4\n 141: ireturn\n}\n", "javap_err": "" } ]
BioniCosmos__neko-programming-class__5d6a15f/lesson-3_dynamic-programming/0-1-knapsack-problem/memoization/main.kt
import kotlin.math.max fun main() { var tmp = readLine()!!.split(' ') val n = tmp[0].toInt() val balance = tmp[1].toInt() val values = Array(n) { 0 } val like = Array(n) { 0 } val rec = Array(n) { Array(balance + 1) { 0 } } for (i in 0 until n) { tmp = readLine()!!.split(' ') values[i] = tmp[0].toInt() like[i] = tmp[1].toInt() } println(getFav(n - 1, balance, values, like, rec)) } fun getFav(i: Int, balance: Int, values: Array<Int>, like: Array<Int>, rec: Array<Array<Int>>): Int { if (i == -1 || balance <= 0) { return 0 } if (rec[i][balance] == 0) { if (values[i] > balance) { rec[i][balance] = getFav(i - 1, balance, values, like, rec) } else { rec[i][balance] = max( getFav(i - 1, balance, values, like, rec), getFav(i - 1, balance - values[i], values, like, rec) + like[i], ) } } return rec[i][balance] }
[ { "class_path": "BioniCosmos__neko-programming-class__5d6a15f/MainKt.class", "javap": "Compiled from \"main.kt\"\npublic final class MainKt {\n public static final void main();\n Code:\n 0: invokestatic #12 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 3: dup\n 4: invokestatic #18 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 7: checkcast #20 // class java/lang/CharSequence\n 10: iconst_1\n 11: newarray char\n 13: astore_1\n 14: aload_1\n 15: iconst_0\n 16: bipush 32\n 18: castore\n 19: aload_1\n 20: iconst_0\n 21: iconst_0\n 22: bipush 6\n 24: aconst_null\n 25: invokestatic #26 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;\n 28: astore_0\n 29: aload_0\n 30: iconst_0\n 31: invokeinterface #32, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 36: checkcast #34 // class java/lang/String\n 39: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 42: istore_1\n 43: aload_0\n 44: iconst_1\n 45: invokeinterface #32, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 50: checkcast #34 // class java/lang/String\n 53: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 56: istore_2\n 57: iconst_0\n 58: istore 4\n 60: iload_1\n 61: anewarray #36 // class java/lang/Integer\n 64: astore 5\n 66: iload 4\n 68: iload_1\n 69: if_icmpge 91\n 72: iload 4\n 74: istore 6\n 76: aload 5\n 78: iload 6\n 80: iconst_0\n 81: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 84: aastore\n 85: iinc 4, 1\n 88: goto 66\n 91: aload 5\n 93: astore_3\n 94: iconst_0\n 95: istore 5\n 97: iload_1\n 98: anewarray #36 // class java/lang/Integer\n 101: astore 6\n 103: iload 5\n 105: iload_1\n 106: if_icmpge 128\n 109: iload 5\n 111: istore 7\n 113: aload 6\n 115: iload 7\n 117: iconst_0\n 118: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 121: aastore\n 122: iinc 5, 1\n 125: goto 103\n 128: aload 6\n 130: astore 4\n 132: iconst_0\n 133: istore 6\n 135: iload_1\n 136: anewarray #46 // class \"[Ljava/lang/Integer;\"\n 139: astore 7\n 141: iload 6\n 143: iload_1\n 144: if_icmpge 213\n 147: iload 6\n 149: istore 8\n 151: aload 7\n 153: iload 8\n 155: iconst_0\n 156: istore 9\n 158: iload_2\n 159: iconst_1\n 160: iadd\n 161: istore 10\n 163: iload 10\n 165: anewarray #36 // class java/lang/Integer\n 168: astore 11\n 170: istore 14\n 172: astore 13\n 174: iload 9\n 176: iload 10\n 178: if_icmpge 200\n 181: iload 9\n 183: istore 12\n 185: aload 11\n 187: iload 12\n 189: iconst_0\n 190: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 193: aastore\n 194: iinc 9, 1\n 197: goto 174\n 200: aload 13\n 202: iload 14\n 204: aload 11\n 206: aastore\n 207: iinc 6, 1\n 210: goto 141\n 213: aload 7\n 215: astore 5\n 217: iconst_0\n 218: istore 6\n 220: iload 6\n 222: iload_1\n 223: if_icmpge 305\n 226: invokestatic #12 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 229: dup\n 230: invokestatic #18 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 233: checkcast #20 // class java/lang/CharSequence\n 236: iconst_1\n 237: newarray char\n 239: astore 7\n 241: aload 7\n 243: iconst_0\n 244: bipush 32\n 246: castore\n 247: aload 7\n 249: iconst_0\n 250: iconst_0\n 251: bipush 6\n 253: aconst_null\n 254: invokestatic #26 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;\n 257: astore_0\n 258: aload_3\n 259: iload 6\n 261: aload_0\n 262: iconst_0\n 263: invokeinterface #32, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 268: checkcast #34 // class java/lang/String\n 271: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 274: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 277: aastore\n 278: aload 4\n 280: iload 6\n 282: aload_0\n 283: iconst_1\n 284: invokeinterface #32, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 289: checkcast #34 // class java/lang/String\n 292: invokestatic #40 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 295: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 298: aastore\n 299: iinc 6, 1\n 302: goto 220\n 305: iload_1\n 306: iconst_1\n 307: isub\n 308: iload_2\n 309: aload_3\n 310: aload 4\n 312: aload 5\n 314: invokestatic #50 // Method getFav:(II[Ljava/lang/Integer;[Ljava/lang/Integer;[[Ljava/lang/Integer;)I\n 317: istore 6\n 319: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 322: iload 6\n 324: invokevirtual #62 // Method java/io/PrintStream.println:(I)V\n 327: return\n\n public static final int getFav(int, int, java.lang.Integer[], java.lang.Integer[], java.lang.Integer[][]);\n Code:\n 0: aload_2\n 1: ldc #75 // String values\n 3: invokestatic #79 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: ldc #80 // String like\n 9: invokestatic #79 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload 4\n 14: ldc #81 // String rec\n 16: invokestatic #79 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: iload_0\n 20: iconst_m1\n 21: if_icmpeq 28\n 24: iload_1\n 25: ifgt 30\n 28: iconst_0\n 29: ireturn\n 30: aload 4\n 32: iload_0\n 33: aaload\n 34: iload_1\n 35: aaload\n 36: invokevirtual #85 // Method java/lang/Integer.intValue:()I\n 39: ifne 124\n 42: aload_2\n 43: iload_0\n 44: aaload\n 45: invokevirtual #85 // Method java/lang/Integer.intValue:()I\n 48: iload_1\n 49: if_icmple 75\n 52: aload 4\n 54: iload_0\n 55: aaload\n 56: iload_1\n 57: iload_0\n 58: iconst_1\n 59: isub\n 60: iload_1\n 61: aload_2\n 62: aload_3\n 63: aload 4\n 65: invokestatic #50 // Method getFav:(II[Ljava/lang/Integer;[Ljava/lang/Integer;[[Ljava/lang/Integer;)I\n 68: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 71: aastore\n 72: goto 124\n 75: aload 4\n 77: iload_0\n 78: aaload\n 79: iload_1\n 80: nop\n 81: iload_0\n 82: iconst_1\n 83: isub\n 84: iload_1\n 85: aload_2\n 86: aload_3\n 87: aload 4\n 89: invokestatic #50 // Method getFav:(II[Ljava/lang/Integer;[Ljava/lang/Integer;[[Ljava/lang/Integer;)I\n 92: iload_0\n 93: iconst_1\n 94: isub\n 95: iload_1\n 96: aload_2\n 97: iload_0\n 98: aaload\n 99: invokevirtual #85 // Method java/lang/Integer.intValue:()I\n 102: isub\n 103: aload_2\n 104: aload_3\n 105: aload 4\n 107: invokestatic #50 // Method getFav:(II[Ljava/lang/Integer;[Ljava/lang/Integer;[[Ljava/lang/Integer;)I\n 110: aload_3\n 111: iload_0\n 112: aaload\n 113: invokevirtual #85 // Method java/lang/Integer.intValue:()I\n 116: iadd\n 117: invokestatic #91 // Method java/lang/Math.max:(II)I\n 120: invokestatic #44 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 123: aastore\n 124: aload 4\n 126: iload_0\n 127: aaload\n 128: iload_1\n 129: aaload\n 130: invokevirtual #85 // Method java/lang/Integer.intValue:()I\n 133: ireturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #94 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
darwineee__adventOfCode2022__f4354b8/src/main/kotlin/Puzzle5.kt
import java.io.File private val numberRegex = "\\d+".toRegex() /** * With this puzzle we do not use stack data structure in part 1, even though it is maybe easier. * Because I want to keep most common logic from both part of the puzzle. */ fun puzzle5(args: Array<String>, isOnWrongShip: Boolean) { val graphStacks = args[0] val moveStrategy = args[1] val graphMatrix = graphStacks.getGraphMatrix() File(moveStrategy) .readLines() .map { it.getCraneMove().mapWithArrayIndex() } .forEach { if (isOnWrongShip) { moveCraneOn9000Ship(graphMatrix, it) } else { moveCraneOn9001Ship(graphMatrix, it) } } println( graphMatrix.mapNotNull { it.lastOrNull() }.joinToString("") ) } private fun moveCraneOn9000Ship( graphMatrix: List<MutableList<Char>>, moveStrategy: Triple<Int, Int, Int> ) { val (quantity, from, to) = moveStrategy repeat(quantity) { _ -> graphMatrix[from].lastOrNull()?.let { item -> graphMatrix[to].add(item) graphMatrix[from].removeLast() } } } private fun moveCraneOn9001Ship( graphMatrix: List<MutableList<Char>>, moveStrategy: Triple<Int, Int, Int> ) { val (quantity, from, to) = moveStrategy graphMatrix[to].addAll(graphMatrix[from].takeLast(quantity)) repeat(quantity) { graphMatrix[from].removeLastOrNull() } } private fun String.getGraphMatrix(): List<MutableList<Char>> { val graphMatrix = mutableListOf<MutableList<Char>>() File(this) .readLines() .map { it.toCharArray() } .forEach { row -> for ((columnIndex, rowIndex) in (1 until row.size step 4).withIndex()) { if (columnIndex > graphMatrix.lastIndex) { graphMatrix.add(mutableListOf()) } val item = row[rowIndex] if (item.isLetter()) { graphMatrix[columnIndex].add(0, item) } } } return graphMatrix } private fun String.getCraneMove(): Triple<Int, Int, Int> { val (first, second, third) = numberRegex .findAll(this) .mapNotNull { it.value.toIntOrNull() } .toList() return Triple(first, second, third) } private fun Triple<Int, Int, Int>.mapWithArrayIndex(): Triple<Int, Int, Int> { return Triple( first = this.first, second = this.second - 1, third = this.third - 1 ) }
[ { "class_path": "darwineee__adventOfCode2022__f4354b8/Puzzle5Kt.class", "javap": "Compiled from \"Puzzle5.kt\"\npublic final class Puzzle5Kt {\n private static final kotlin.text.Regex numberRegex;\n\n public static final void puzzle5(java.lang.String[], boolean);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iconst_0\n 8: aaload\n 9: astore_2\n 10: aload_0\n 11: iconst_1\n 12: aaload\n 13: astore_3\n 14: aload_2\n 15: invokestatic #19 // Method getGraphMatrix:(Ljava/lang/String;)Ljava/util/List;\n 18: astore 4\n 20: new #21 // class java/io/File\n 23: dup\n 24: aload_3\n 25: invokespecial #25 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 28: aconst_null\n 29: iconst_1\n 30: aconst_null\n 31: invokestatic #31 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 34: checkcast #33 // class java/lang/Iterable\n 37: astore 5\n 39: nop\n 40: iconst_0\n 41: istore 6\n 43: aload 5\n 45: astore 7\n 47: new #35 // class java/util/ArrayList\n 50: dup\n 51: aload 5\n 53: bipush 10\n 55: invokestatic #41 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 58: invokespecial #44 // Method java/util/ArrayList.\"<init>\":(I)V\n 61: checkcast #46 // class java/util/Collection\n 64: astore 8\n 66: iconst_0\n 67: istore 9\n 69: aload 7\n 71: invokeinterface #50, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 76: astore 10\n 78: aload 10\n 80: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 85: ifeq 131\n 88: aload 10\n 90: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 95: astore 11\n 97: aload 8\n 99: aload 11\n 101: checkcast #62 // class java/lang/String\n 104: astore 12\n 106: astore 20\n 108: iconst_0\n 109: istore 13\n 111: aload 12\n 113: invokestatic #66 // Method getCraneMove:(Ljava/lang/String;)Lkotlin/Triple;\n 116: invokestatic #70 // Method mapWithArrayIndex:(Lkotlin/Triple;)Lkotlin/Triple;\n 119: aload 20\n 121: swap\n 122: invokeinterface #74, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 127: pop\n 128: goto 78\n 131: aload 8\n 133: checkcast #76 // class java/util/List\n 136: nop\n 137: checkcast #33 // class java/lang/Iterable\n 140: astore 5\n 142: nop\n 143: iconst_0\n 144: istore 6\n 146: aload 5\n 148: invokeinterface #50, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 153: astore 7\n 155: aload 7\n 157: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 162: ifeq 210\n 165: aload 7\n 167: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 172: astore 8\n 174: aload 8\n 176: checkcast #78 // class kotlin/Triple\n 179: astore 9\n 181: iconst_0\n 182: istore 10\n 184: iload_1\n 185: ifeq 198\n 188: aload 4\n 190: aload 9\n 192: invokestatic #82 // Method moveCraneOn9000Ship:(Ljava/util/List;Lkotlin/Triple;)V\n 195: goto 205\n 198: aload 4\n 200: aload 9\n 202: invokestatic #85 // Method moveCraneOn9001Ship:(Ljava/util/List;Lkotlin/Triple;)V\n 205: nop\n 206: nop\n 207: goto 155\n 210: nop\n 211: aload 4\n 213: checkcast #33 // class java/lang/Iterable\n 216: astore 5\n 218: iconst_0\n 219: istore 6\n 221: aload 5\n 223: astore 7\n 225: new #35 // class java/util/ArrayList\n 228: dup\n 229: invokespecial #88 // Method java/util/ArrayList.\"<init>\":()V\n 232: checkcast #46 // class java/util/Collection\n 235: astore 8\n 237: iconst_0\n 238: istore 9\n 240: aload 7\n 242: astore 10\n 244: iconst_0\n 245: istore 11\n 247: aload 10\n 249: invokeinterface #50, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 254: astore 12\n 256: aload 12\n 258: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 263: ifeq 327\n 266: aload 12\n 268: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 273: astore 13\n 275: aload 13\n 277: astore 14\n 279: iconst_0\n 280: istore 15\n 282: aload 14\n 284: checkcast #76 // class java/util/List\n 287: astore 16\n 289: iconst_0\n 290: istore 17\n 292: aload 16\n 294: invokestatic #92 // Method kotlin/collections/CollectionsKt.lastOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 297: checkcast #94 // class java/lang/Character\n 300: dup\n 301: ifnull 322\n 304: astore 18\n 306: iconst_0\n 307: istore 19\n 309: aload 8\n 311: aload 18\n 313: invokeinterface #74, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 318: pop\n 319: goto 323\n 322: pop\n 323: nop\n 324: goto 256\n 327: nop\n 328: aload 8\n 330: checkcast #76 // class java/util/List\n 333: nop\n 334: checkcast #33 // class java/lang/Iterable\n 337: ldc #96 // String\n 339: checkcast #98 // class java/lang/CharSequence\n 342: aconst_null\n 343: aconst_null\n 344: iconst_0\n 345: aconst_null\n 346: aconst_null\n 347: bipush 62\n 349: aconst_null\n 350: invokestatic #102 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 353: astore 5\n 355: getstatic #108 // Field java/lang/System.out:Ljava/io/PrintStream;\n 358: aload 5\n 360: invokevirtual #114 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 363: return\n\n private static final void moveCraneOn9000Ship(java.util.List<? extends java.util.List<java.lang.Character>>, kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_1\n 1: invokevirtual #155 // Method kotlin/Triple.component1:()Ljava/lang/Object;\n 4: checkcast #157 // class java/lang/Number\n 7: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 10: istore_2\n 11: aload_1\n 12: invokevirtual #164 // Method kotlin/Triple.component2:()Ljava/lang/Object;\n 15: checkcast #157 // class java/lang/Number\n 18: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 21: istore_3\n 22: aload_1\n 23: invokevirtual #167 // Method kotlin/Triple.component3:()Ljava/lang/Object;\n 26: checkcast #157 // class java/lang/Number\n 29: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 32: istore 4\n 34: iconst_0\n 35: istore 5\n 37: iload 5\n 39: iload_2\n 40: if_icmpge 125\n 43: iconst_0\n 44: istore 6\n 46: aload_0\n 47: iload_3\n 48: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 53: checkcast #76 // class java/util/List\n 56: invokestatic #92 // Method kotlin/collections/CollectionsKt.lastOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 59: checkcast #94 // class java/lang/Character\n 62: dup\n 63: ifnull 116\n 66: invokevirtual #175 // Method java/lang/Character.charValue:()C\n 69: istore 7\n 71: iconst_0\n 72: istore 8\n 74: aload_0\n 75: iload 4\n 77: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 82: checkcast #76 // class java/util/List\n 85: iload 7\n 87: invokestatic #179 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 90: invokeinterface #180, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 95: pop\n 96: aload_0\n 97: iload_3\n 98: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 103: checkcast #76 // class java/util/List\n 106: invokeinterface #183, 1 // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;\n 111: pop\n 112: nop\n 113: goto 118\n 116: pop\n 117: nop\n 118: nop\n 119: iinc 5, 1\n 122: goto 37\n 125: return\n\n private static final void moveCraneOn9001Ship(java.util.List<? extends java.util.List<java.lang.Character>>, kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_1\n 1: invokevirtual #155 // Method kotlin/Triple.component1:()Ljava/lang/Object;\n 4: checkcast #157 // class java/lang/Number\n 7: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 10: istore_2\n 11: aload_1\n 12: invokevirtual #164 // Method kotlin/Triple.component2:()Ljava/lang/Object;\n 15: checkcast #157 // class java/lang/Number\n 18: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 21: istore_3\n 22: aload_1\n 23: invokevirtual #167 // Method kotlin/Triple.component3:()Ljava/lang/Object;\n 26: checkcast #157 // class java/lang/Number\n 29: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 32: istore 4\n 34: aload_0\n 35: iload 4\n 37: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 42: checkcast #76 // class java/util/List\n 45: aload_0\n 46: iload_3\n 47: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 52: checkcast #76 // class java/util/List\n 55: iload_2\n 56: invokestatic #194 // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;\n 59: checkcast #46 // class java/util/Collection\n 62: invokeinterface #198, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 67: pop\n 68: iconst_0\n 69: istore 5\n 71: iload 5\n 73: iload_2\n 74: if_icmpge 105\n 77: iload 5\n 79: istore 6\n 81: iconst_0\n 82: istore 7\n 84: aload_0\n 85: iload_3\n 86: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 91: checkcast #76 // class java/util/List\n 94: invokestatic #201 // Method kotlin/collections/CollectionsKt.removeLastOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 97: pop\n 98: nop\n 99: iinc 5, 1\n 102: goto 71\n 105: return\n\n private static final java.util.List<java.util.List<java.lang.Character>> getGraphMatrix(java.lang.String);\n Code:\n 0: new #35 // class java/util/ArrayList\n 3: dup\n 4: invokespecial #88 // Method java/util/ArrayList.\"<init>\":()V\n 7: checkcast #76 // class java/util/List\n 10: astore_1\n 11: new #21 // class java/io/File\n 14: dup\n 15: aload_0\n 16: invokespecial #25 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 19: aconst_null\n 20: iconst_1\n 21: aconst_null\n 22: invokestatic #31 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 25: checkcast #33 // class java/lang/Iterable\n 28: astore_2\n 29: nop\n 30: iconst_0\n 31: istore_3\n 32: aload_2\n 33: astore 4\n 35: new #35 // class java/util/ArrayList\n 38: dup\n 39: aload_2\n 40: bipush 10\n 42: invokestatic #41 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 45: invokespecial #44 // Method java/util/ArrayList.\"<init>\":(I)V\n 48: checkcast #46 // class java/util/Collection\n 51: astore 5\n 53: iconst_0\n 54: istore 6\n 56: aload 4\n 58: invokeinterface #50, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 63: astore 7\n 65: aload 7\n 67: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 72: ifeq 122\n 75: aload 7\n 77: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 82: astore 8\n 84: aload 5\n 86: aload 8\n 88: checkcast #62 // class java/lang/String\n 91: astore 9\n 93: astore 16\n 95: iconst_0\n 96: istore 10\n 98: aload 9\n 100: invokevirtual #207 // Method java/lang/String.toCharArray:()[C\n 103: dup\n 104: ldc #209 // String toCharArray(...)\n 106: invokestatic #212 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 109: nop\n 110: aload 16\n 112: swap\n 113: invokeinterface #74, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 118: pop\n 119: goto 65\n 122: aload 5\n 124: checkcast #76 // class java/util/List\n 127: nop\n 128: checkcast #33 // class java/lang/Iterable\n 131: astore_2\n 132: nop\n 133: iconst_0\n 134: istore_3\n 135: aload_2\n 136: invokeinterface #50, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 141: astore 4\n 143: aload 4\n 145: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 150: ifeq 335\n 153: aload 4\n 155: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 160: astore 5\n 162: aload 5\n 164: checkcast #214 // class \"[C\"\n 167: astore 6\n 169: iconst_0\n 170: istore 7\n 172: iconst_1\n 173: aload 6\n 175: arraylength\n 176: invokestatic #220 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 179: checkcast #222 // class kotlin/ranges/IntProgression\n 182: iconst_4\n 183: invokestatic #226 // Method kotlin/ranges/RangesKt.step:(Lkotlin/ranges/IntProgression;I)Lkotlin/ranges/IntProgression;\n 186: astore 8\n 188: aload 8\n 190: invokevirtual #229 // Method kotlin/ranges/IntProgression.getFirst:()I\n 193: istore 9\n 195: aload 8\n 197: invokevirtual #232 // Method kotlin/ranges/IntProgression.getLast:()I\n 200: istore 10\n 202: aload 8\n 204: invokevirtual #235 // Method kotlin/ranges/IntProgression.getStep:()I\n 207: istore 11\n 209: iconst_0\n 210: istore 12\n 212: iload 11\n 214: ifle 224\n 217: iload 9\n 219: iload 10\n 221: if_icmple 236\n 224: iload 11\n 226: ifge 330\n 229: iload 10\n 231: iload 9\n 233: if_icmpgt 330\n 236: iload 12\n 238: istore 13\n 240: iload 12\n 242: iconst_1\n 243: iadd\n 244: istore 12\n 246: iload 9\n 248: istore 14\n 250: iload 13\n 252: aload_1\n 253: invokestatic #239 // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I\n 256: if_icmple 276\n 259: aload_1\n 260: new #35 // class java/util/ArrayList\n 263: dup\n 264: invokespecial #88 // Method java/util/ArrayList.\"<init>\":()V\n 267: checkcast #76 // class java/util/List\n 270: invokeinterface #180, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 275: pop\n 276: aload 6\n 278: iload 14\n 280: caload\n 281: istore 15\n 283: iload 15\n 285: invokestatic #243 // Method java/lang/Character.isLetter:(C)Z\n 288: ifeq 313\n 291: aload_1\n 292: iload 13\n 294: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 299: checkcast #76 // class java/util/List\n 302: iconst_0\n 303: iload 15\n 305: invokestatic #179 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 308: invokeinterface #246, 3 // InterfaceMethod java/util/List.add:(ILjava/lang/Object;)V\n 313: iload 14\n 315: iload 10\n 317: if_icmpeq 330\n 320: iload 9\n 322: iload 11\n 324: iadd\n 325: istore 9\n 327: goto 236\n 330: nop\n 331: nop\n 332: goto 143\n 335: nop\n 336: aload_1\n 337: areturn\n\n private static final kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer> getCraneMove(java.lang.String);\n Code:\n 0: getstatic #257 // Field numberRegex:Lkotlin/text/Regex;\n 3: aload_0\n 4: checkcast #98 // class java/lang/CharSequence\n 7: iconst_0\n 8: iconst_2\n 9: aconst_null\n 10: invokestatic #263 // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;\n 13: invokedynamic #282, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 18: invokestatic #288 // Method kotlin/sequences/SequencesKt.mapNotNull:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 21: invokestatic #292 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;\n 24: astore_1\n 25: aload_1\n 26: iconst_0\n 27: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 32: checkcast #157 // class java/lang/Number\n 35: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 38: istore_2\n 39: aload_1\n 40: iconst_1\n 41: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 46: checkcast #157 // class java/lang/Number\n 49: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 52: istore_3\n 53: aload_1\n 54: iconst_2\n 55: invokeinterface #171, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 60: checkcast #157 // class java/lang/Number\n 63: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 66: istore 4\n 68: new #78 // class kotlin/Triple\n 71: dup\n 72: iload_2\n 73: invokestatic #297 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 76: iload_3\n 77: invokestatic #297 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 80: iload 4\n 82: invokestatic #297 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 85: invokespecial #300 // Method kotlin/Triple.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V\n 88: areturn\n\n private static final kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer> mapWithArrayIndex(kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer>);\n Code:\n 0: new #78 // class kotlin/Triple\n 3: dup\n 4: aload_0\n 5: invokevirtual #307 // Method kotlin/Triple.getFirst:()Ljava/lang/Object;\n 8: aload_0\n 9: invokevirtual #310 // Method kotlin/Triple.getSecond:()Ljava/lang/Object;\n 12: checkcast #157 // class java/lang/Number\n 15: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 18: iconst_1\n 19: isub\n 20: invokestatic #297 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 23: aload_0\n 24: invokevirtual #313 // Method kotlin/Triple.getThird:()Ljava/lang/Object;\n 27: checkcast #157 // class java/lang/Number\n 30: invokevirtual #161 // Method java/lang/Number.intValue:()I\n 33: iconst_1\n 34: isub\n 35: invokestatic #297 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 38: invokespecial #300 // Method kotlin/Triple.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V\n 41: areturn\n\n private static final java.lang.Integer getCraneMove$lambda$8(kotlin.text.MatchResult);\n Code:\n 0: aload_0\n 1: ldc_w #315 // String it\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokeinterface #321, 1 // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;\n 13: invokestatic #327 // Method kotlin/text/StringsKt.toIntOrNull:(Ljava/lang/String;)Ljava/lang/Integer;\n 16: areturn\n\n static {};\n Code:\n 0: new #259 // class kotlin/text/Regex\n 3: dup\n 4: ldc_w #331 // String \\\\d+\n 7: invokespecial #332 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 10: putstatic #257 // Field numberRegex:Lkotlin/text/Regex;\n 13: return\n}\n", "javap_err": "" } ]
darwineee__adventOfCode2022__f4354b8/src/main/kotlin/Puzzle3.kt
import java.io.File fun puzzle3Part1(args: Array<String>) { var sum = 0 File(args[0]) .readLines() .forEach { val commonItem = it.toCharArray().getCommonItem() if (commonItem != null) { sum += commonItem.toPriorityPoint() } } println(sum) } private fun CharArray.getCommonItem(): Char? { // as the requirement, the array item always have size is even number // and always have common item val compartmentSize = this.size / 2 val compartmentLeft = this.take(compartmentSize).toHashSet() val compartmentRight = this.takeLast(compartmentSize).toHashSet() compartmentLeft.forEach { if (it in compartmentRight) return it } return null } fun puzzle3Part2(args: Array<String>) { var sum = 0 File(args[0]) .readLines() .chunked(3) .forEach { val groupBadge = it.getGroupBadge() if (groupBadge != null) { sum += groupBadge.toPriorityPoint() } } println(sum) } private fun List<String>.getGroupBadge(): Char? { val (rucksack1, rucksack2, rucksack3) = this.map { it.toCharArray().toHashSet() } return when { rucksack1.size * 2 < rucksack2.size + rucksack3.size -> { getGroupBadge(rucksack1, rucksack2, rucksack3) } rucksack2.size * 2 < rucksack1.size + rucksack3.size -> { getGroupBadge(rucksack2, rucksack1, rucksack3) } else -> { getGroupBadge(rucksack3, rucksack1, rucksack2) } } } private fun getGroupBadge(rucksack1: HashSet<Char>, rucksack2: HashSet<Char>, rucksack3: HashSet<Char>): Char? { rucksack1.forEach { if (it in rucksack2 && it in rucksack3) return it } return null } private fun Char.toPriorityPoint(): Int { return if (this.isUpperCase()) { this.code - 38 } else this.code - 96 }
[ { "class_path": "darwineee__adventOfCode2022__f4354b8/Puzzle3Kt.class", "javap": "Compiled from \"Puzzle3.kt\"\npublic final class Puzzle3Kt {\n public static final void puzzle3Part1(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_0\n 7: istore_1\n 8: new #17 // class java/io/File\n 11: dup\n 12: aload_0\n 13: iconst_0\n 14: aaload\n 15: invokespecial #21 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 18: aconst_null\n 19: iconst_1\n 20: aconst_null\n 21: invokestatic #27 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 24: checkcast #29 // class java/lang/Iterable\n 27: astore_2\n 28: nop\n 29: iconst_0\n 30: istore_3\n 31: aload_2\n 32: invokeinterface #33, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 37: astore 4\n 39: aload 4\n 41: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 46: ifeq 105\n 49: aload 4\n 51: invokeinterface #43, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 56: astore 5\n 58: aload 5\n 60: checkcast #45 // class java/lang/String\n 63: astore 6\n 65: iconst_0\n 66: istore 7\n 68: aload 6\n 70: invokevirtual #49 // Method java/lang/String.toCharArray:()[C\n 73: dup\n 74: ldc #51 // String toCharArray(...)\n 76: invokestatic #54 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 79: invokestatic #58 // Method getCommonItem:([C)Ljava/lang/Character;\n 82: astore 8\n 84: aload 8\n 86: ifnull 100\n 89: iload_1\n 90: aload 8\n 92: invokevirtual #64 // Method java/lang/Character.charValue:()C\n 95: invokestatic #68 // Method toPriorityPoint:(C)I\n 98: iadd\n 99: istore_1\n 100: nop\n 101: nop\n 102: goto 39\n 105: nop\n 106: iload_1\n 107: istore_2\n 108: getstatic #74 // Field java/lang/System.out:Ljava/io/PrintStream;\n 111: iload_2\n 112: invokevirtual #80 // Method java/io/PrintStream.println:(I)V\n 115: return\n\n private static final java.lang.Character getCommonItem(char[]);\n Code:\n 0: aload_0\n 1: arraylength\n 2: iconst_2\n 3: idiv\n 4: istore_1\n 5: aload_0\n 6: iload_1\n 7: invokestatic #100 // Method kotlin/collections/ArraysKt.take:([CI)Ljava/util/List;\n 10: checkcast #29 // class java/lang/Iterable\n 13: invokestatic #106 // Method kotlin/collections/CollectionsKt.toHashSet:(Ljava/lang/Iterable;)Ljava/util/HashSet;\n 16: astore_2\n 17: aload_0\n 18: iload_1\n 19: invokestatic #109 // Method kotlin/collections/ArraysKt.takeLast:([CI)Ljava/util/List;\n 22: checkcast #29 // class java/lang/Iterable\n 25: invokestatic #106 // Method kotlin/collections/CollectionsKt.toHashSet:(Ljava/lang/Iterable;)Ljava/util/HashSet;\n 28: astore_3\n 29: aload_2\n 30: checkcast #29 // class java/lang/Iterable\n 33: astore 4\n 35: iconst_0\n 36: istore 5\n 38: aload 4\n 40: invokeinterface #33, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 6\n 47: aload 6\n 49: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 102\n 57: aload 6\n 59: invokeinterface #43, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 7\n 66: aload 7\n 68: checkcast #60 // class java/lang/Character\n 71: invokevirtual #64 // Method java/lang/Character.charValue:()C\n 74: istore 8\n 76: iconst_0\n 77: istore 9\n 79: aload_3\n 80: iload 8\n 82: invokestatic #113 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 85: invokevirtual #119 // Method java/util/HashSet.contains:(Ljava/lang/Object;)Z\n 88: ifeq 97\n 91: iload 8\n 93: invokestatic #113 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 96: areturn\n 97: nop\n 98: nop\n 99: goto 47\n 102: nop\n 103: aconst_null\n 104: areturn\n\n public static final void puzzle3Part2(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_0\n 7: istore_1\n 8: new #17 // class java/io/File\n 11: dup\n 12: aload_0\n 13: iconst_0\n 14: aaload\n 15: invokespecial #21 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 18: aconst_null\n 19: iconst_1\n 20: aconst_null\n 21: invokestatic #27 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 24: checkcast #29 // class java/lang/Iterable\n 27: iconst_3\n 28: invokestatic #133 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 31: checkcast #29 // class java/lang/Iterable\n 34: astore_2\n 35: nop\n 36: iconst_0\n 37: istore_3\n 38: aload_2\n 39: invokeinterface #33, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 4\n 46: aload 4\n 48: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 103\n 56: aload 4\n 58: invokeinterface #43, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 5\n 65: aload 5\n 67: checkcast #135 // class java/util/List\n 70: astore 6\n 72: iconst_0\n 73: istore 7\n 75: aload 6\n 77: invokestatic #139 // Method getGroupBadge:(Ljava/util/List;)Ljava/lang/Character;\n 80: astore 8\n 82: aload 8\n 84: ifnull 98\n 87: iload_1\n 88: aload 8\n 90: invokevirtual #64 // Method java/lang/Character.charValue:()C\n 93: invokestatic #68 // Method toPriorityPoint:(C)I\n 96: iadd\n 97: istore_1\n 98: nop\n 99: nop\n 100: goto 46\n 103: nop\n 104: iload_1\n 105: istore_2\n 106: getstatic #74 // Field java/lang/System.out:Ljava/io/PrintStream;\n 109: iload_2\n 110: invokevirtual #80 // Method java/io/PrintStream.println:(I)V\n 113: return\n\n private static final java.lang.Character getGroupBadge(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: checkcast #29 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: astore 4\n 10: new #145 // class java/util/ArrayList\n 13: dup\n 14: aload_2\n 15: bipush 10\n 17: invokestatic #149 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 20: invokespecial #151 // Method java/util/ArrayList.\"<init>\":(I)V\n 23: checkcast #153 // class java/util/Collection\n 26: astore 5\n 28: iconst_0\n 29: istore 6\n 31: aload 4\n 33: invokeinterface #33, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 38: astore 7\n 40: aload 7\n 42: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 47: ifeq 99\n 50: aload 7\n 52: invokeinterface #43, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 57: astore 8\n 59: aload 5\n 61: aload 8\n 63: checkcast #45 // class java/lang/String\n 66: astore 9\n 68: astore 11\n 70: iconst_0\n 71: istore 10\n 73: aload 9\n 75: invokevirtual #49 // Method java/lang/String.toCharArray:()[C\n 78: dup\n 79: ldc #51 // String toCharArray(...)\n 81: invokestatic #54 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 84: invokestatic #156 // Method kotlin/collections/ArraysKt.toHashSet:([C)Ljava/util/HashSet;\n 87: aload 11\n 89: swap\n 90: invokeinterface #159, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 95: pop\n 96: goto 40\n 99: aload 5\n 101: checkcast #135 // class java/util/List\n 104: nop\n 105: astore_1\n 106: aload_1\n 107: iconst_0\n 108: invokeinterface #163, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 113: checkcast #115 // class java/util/HashSet\n 116: astore_2\n 117: aload_1\n 118: iconst_1\n 119: invokeinterface #163, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 124: checkcast #115 // class java/util/HashSet\n 127: astore_3\n 128: aload_1\n 129: iconst_2\n 130: invokeinterface #163, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 135: checkcast #115 // class java/util/HashSet\n 138: astore 4\n 140: nop\n 141: aload_2\n 142: invokevirtual #167 // Method java/util/HashSet.size:()I\n 145: iconst_2\n 146: imul\n 147: aload_3\n 148: invokevirtual #167 // Method java/util/HashSet.size:()I\n 151: aload 4\n 153: invokevirtual #167 // Method java/util/HashSet.size:()I\n 156: iadd\n 157: if_icmpge 170\n 160: aload_2\n 161: aload_3\n 162: aload 4\n 164: invokestatic #170 // Method getGroupBadge:(Ljava/util/HashSet;Ljava/util/HashSet;Ljava/util/HashSet;)Ljava/lang/Character;\n 167: goto 206\n 170: aload_3\n 171: invokevirtual #167 // Method java/util/HashSet.size:()I\n 174: iconst_2\n 175: imul\n 176: aload_2\n 177: invokevirtual #167 // Method java/util/HashSet.size:()I\n 180: aload 4\n 182: invokevirtual #167 // Method java/util/HashSet.size:()I\n 185: iadd\n 186: if_icmpge 199\n 189: aload_3\n 190: aload_2\n 191: aload 4\n 193: invokestatic #170 // Method getGroupBadge:(Ljava/util/HashSet;Ljava/util/HashSet;Ljava/util/HashSet;)Ljava/lang/Character;\n 196: goto 206\n 199: aload 4\n 201: aload_2\n 202: aload_3\n 203: invokestatic #170 // Method getGroupBadge:(Ljava/util/HashSet;Ljava/util/HashSet;Ljava/util/HashSet;)Ljava/lang/Character;\n 206: areturn\n\n private static final java.lang.Character getGroupBadge(java.util.HashSet<java.lang.Character>, java.util.HashSet<java.lang.Character>, java.util.HashSet<java.lang.Character>);\n Code:\n 0: aload_0\n 1: checkcast #29 // class java/lang/Iterable\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokeinterface #33, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 14: astore 5\n 16: aload 5\n 18: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 23: ifeq 83\n 26: aload 5\n 28: invokeinterface #43, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 33: astore 6\n 35: aload 6\n 37: checkcast #60 // class java/lang/Character\n 40: invokevirtual #64 // Method java/lang/Character.charValue:()C\n 43: istore 7\n 45: iconst_0\n 46: istore 8\n 48: aload_1\n 49: iload 7\n 51: invokestatic #113 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 54: invokevirtual #119 // Method java/util/HashSet.contains:(Ljava/lang/Object;)Z\n 57: ifeq 78\n 60: aload_2\n 61: iload 7\n 63: invokestatic #113 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 66: invokevirtual #119 // Method java/util/HashSet.contains:(Ljava/lang/Object;)Z\n 69: ifeq 78\n 72: iload 7\n 74: invokestatic #113 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 77: areturn\n 78: nop\n 79: nop\n 80: goto 16\n 83: nop\n 84: aconst_null\n 85: areturn\n\n private static final int toPriorityPoint(char);\n Code:\n 0: iload_0\n 1: invokestatic #188 // Method java/lang/Character.isUpperCase:(C)Z\n 4: ifeq 14\n 7: iload_0\n 8: bipush 38\n 10: isub\n 11: goto 18\n 14: iload_0\n 15: bipush 96\n 17: isub\n 18: ireturn\n}\n", "javap_err": "" } ]
HarshCasper__NeoAlgo__4f1e5bd/Kotlin/Maths/HappyNumber.kt
/* A number is called happy if it leads to 1 after a sequence of steps wherein each step number is replaced by the sum of squares of its digit that is if we start with Happy Number and keep replacing it with digits square sum, we reach 1. Examples of Happy numbers are:- 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70,... */ import java.util.* fun squaredSum(n: Int): Int{ var sum_of_square:Int = 0 var c:Int = n while(c!=0){ sum_of_square += c%10 * (c % 10) c /= 10 } return sum_of_square } //defining a boolean function to check whether the number is happy number or not fun Happynumber(number: Int): Boolean { var slow: Int var fast: Int fast = number slow = fast do { slow = squaredSum(slow) fast = squaredSum(squaredSum(fast)) } while (slow != fast) return slow == 1 } //Testing code fun main(){ val input = Scanner(System.`in`) println("Enter the number which you want to check") val n = input.nextInt() if (Happynumber(n)) println("$n is a Happy number") else println("$n is not a happy number") } /* Enter the number which you want to check 19 19 is a Happy number Enter the number which you want to check 20 20 is not a happy number */ /* Time complexity :- O(N) Space complexity :- O(1), which is constant */
[ { "class_path": "HarshCasper__NeoAlgo__4f1e5bd/HappyNumberKt.class", "javap": "Compiled from \"HappyNumber.kt\"\npublic final class HappyNumberKt {\n public static final int squaredSum(int);\n Code:\n 0: iconst_0\n 1: istore_1\n 2: iload_0\n 3: istore_2\n 4: iload_2\n 5: ifeq 28\n 8: iload_1\n 9: iload_2\n 10: bipush 10\n 12: irem\n 13: iload_2\n 14: bipush 10\n 16: irem\n 17: imul\n 18: iadd\n 19: istore_1\n 20: iload_2\n 21: bipush 10\n 23: idiv\n 24: istore_2\n 25: goto 4\n 28: iload_1\n 29: ireturn\n\n public static final boolean Happynumber(int);\n Code:\n 0: iconst_0\n 1: istore_1\n 2: iconst_0\n 3: istore_2\n 4: iload_0\n 5: istore_2\n 6: iload_2\n 7: istore_1\n 8: iload_1\n 9: invokestatic #14 // Method squaredSum:(I)I\n 12: istore_1\n 13: iload_2\n 14: invokestatic #14 // Method squaredSum:(I)I\n 17: invokestatic #14 // Method squaredSum:(I)I\n 20: istore_2\n 21: iload_1\n 22: iload_2\n 23: if_icmpne 8\n 26: iload_1\n 27: iconst_1\n 28: if_icmpne 35\n 31: iconst_1\n 32: goto 36\n 35: iconst_0\n 36: ireturn\n\n public static final void main();\n Code:\n 0: new #21 // class java/util/Scanner\n 3: dup\n 4: getstatic #27 // Field java/lang/System.in:Ljava/io/InputStream;\n 7: invokespecial #31 // Method java/util/Scanner.\"<init>\":(Ljava/io/InputStream;)V\n 10: astore_0\n 11: ldc #33 // String Enter the number which you want to check\n 13: getstatic #37 // Field java/lang/System.out:Ljava/io/PrintStream;\n 16: swap\n 17: invokevirtual #43 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 20: aload_0\n 21: invokevirtual #47 // Method java/util/Scanner.nextInt:()I\n 24: istore_1\n 25: iload_1\n 26: invokestatic #49 // Method Happynumber:(I)Z\n 29: ifeq 61\n 32: new #51 // class java/lang/StringBuilder\n 35: dup\n 36: invokespecial #53 // Method java/lang/StringBuilder.\"<init>\":()V\n 39: iload_1\n 40: invokevirtual #57 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: ldc #59 // String is a Happy number\n 45: invokevirtual #62 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: invokevirtual #66 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: getstatic #37 // Field java/lang/System.out:Ljava/io/PrintStream;\n 54: swap\n 55: invokevirtual #43 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 58: goto 87\n 61: new #51 // class java/lang/StringBuilder\n 64: dup\n 65: invokespecial #53 // Method java/lang/StringBuilder.\"<init>\":()V\n 68: iload_1\n 69: invokevirtual #57 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 72: ldc #68 // String is not a happy number\n 74: invokevirtual #62 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 77: invokevirtual #66 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 80: getstatic #37 // Field java/lang/System.out:Ljava/io/PrintStream;\n 83: swap\n 84: invokevirtual #43 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 87: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #73 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
HarshCasper__NeoAlgo__4f1e5bd/Kotlin/sort/MergeSort/src/MergeSort.kt
fun mergeSort(list : MutableList<Int>) : MutableList<Int>{ // check if the given list has more than 1 elements if (list.size > 1){ // a list to store sorted list val sortedList = MutableList(list.size) { 0 } // taking note of middle element of the list val middle = list.size / 2 // splitting list into a left side and right side var leftSide = list.slice(0 until middle).toMutableList() var rightSide = list.slice(middle until list.size).toMutableList() // performing mergesort on the list and storing the results as the sides name leftSide = mergeSort(leftSide) rightSide = mergeSort(rightSide) var i = 0; var j = 0; var k = 0 // getting smaller elements from the list until one of them is exhausted // once one list gets exhausted we know that the elements in the remaining // list are larger than the one's we sorted while (i < leftSide.size && j < rightSide.size){ if (leftSide[i] < rightSide[j]) { sortedList[k] = leftSide[i] i++ } else { sortedList[k] = rightSide[j] j++ } k++ } // putting the elements of leftSide if they are left after one list gets // exhausted while ( i < leftSide.size){ sortedList[k] = leftSide[i] i++ k++ } // putting the elements of rightSide if they are left after one list gets // exhausted while ( j < rightSide.size){ sortedList[k] = rightSide[j] j++ k++ } // returning the sorted list return sortedList } // if the size is less than 1 then the list is considered as sorted // in itself, just return the item return list } fun main() { print("Enter the number of items to sort - ") val lengthOfList = readLine()!!.toInt() val list = MutableList(lengthOfList) { 0 } list.withIndex().forEach { print("Enter value ${it.index + 1} - ") list[it.index] = readLine()!!.toInt() } println("unsorted list is $list") val sorted = mergeSort(list.toMutableList()); println("sorted list is $sorted") } /* Enter the number of items to sort - 12 Enter value 1 - 1 Enter value 2 - 3 Enter value 3 - 5 Enter value 4 - 2 Enter value 5 - 90 Enter value 6 - 24 Enter value 7 - 67 Enter value 8 - 48 Enter value 9 - 95 Enter value 10 - 29 Enter value 11 - 5 Enter value 12 - 16 unsorted list is [1, 3, 5, 2, 90, 24, 67, 48, 95, 29, 5, 16] sorted list is [1, 2, 3, 5, 5, 16, 24, 29, 48, 67, 90, 95] Time Complexity - Best Case Complexity: O(n*log n) Worst Case Complexity: O(n*log n) Average Case Complexity: O(n*log n) Space Complexity - The space complexity of merge sort is O(n). */
[ { "class_path": "HarshCasper__NeoAlgo__4f1e5bd/MergeSortKt.class", "javap": "Compiled from \"MergeSort.kt\"\npublic final class MergeSortKt {\n public static final java.util.List<java.lang.Integer> mergeSort(java.util.List<java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 12: iconst_1\n 13: if_icmple 328\n 16: aload_0\n 17: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 22: istore_2\n 23: new #24 // class java/util/ArrayList\n 26: dup\n 27: iload_2\n 28: invokespecial #28 // Method java/util/ArrayList.\"<init>\":(I)V\n 31: astore_3\n 32: iconst_0\n 33: istore 4\n 35: iload 4\n 37: iload_2\n 38: if_icmpge 72\n 41: iload 4\n 43: istore 5\n 45: aload_3\n 46: iload 5\n 48: istore 6\n 50: astore 8\n 52: iconst_0\n 53: istore 7\n 55: iconst_0\n 56: invokestatic #34 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 59: aload 8\n 61: swap\n 62: invokevirtual #38 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 65: pop\n 66: iinc 4, 1\n 69: goto 35\n 72: aload_3\n 73: checkcast #18 // class java/util/List\n 76: astore_1\n 77: aload_0\n 78: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 83: iconst_2\n 84: idiv\n 85: istore_2\n 86: aload_0\n 87: iconst_0\n 88: iload_2\n 89: invokestatic #44 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 92: invokestatic #50 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;\n 95: checkcast #52 // class java/util/Collection\n 98: invokestatic #56 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 101: astore_3\n 102: aload_0\n 103: iload_2\n 104: aload_0\n 105: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 110: invokestatic #44 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 113: invokestatic #50 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;\n 116: checkcast #52 // class java/util/Collection\n 119: invokestatic #56 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 122: astore 4\n 124: aload_3\n 125: invokestatic #58 // Method mergeSort:(Ljava/util/List;)Ljava/util/List;\n 128: astore_3\n 129: aload 4\n 131: invokestatic #58 // Method mergeSort:(Ljava/util/List;)Ljava/util/List;\n 134: astore 4\n 136: iconst_0\n 137: istore 5\n 139: iconst_0\n 140: istore 6\n 142: iconst_0\n 143: istore 7\n 145: iload 5\n 147: aload_3\n 148: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 153: if_icmpge 250\n 156: iload 6\n 158: aload 4\n 160: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 165: if_icmpge 250\n 168: aload_3\n 169: iload 5\n 171: invokeinterface #62, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 176: checkcast #64 // class java/lang/Number\n 179: invokevirtual #67 // Method java/lang/Number.intValue:()I\n 182: aload 4\n 184: iload 6\n 186: invokeinterface #62, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 191: checkcast #64 // class java/lang/Number\n 194: invokevirtual #67 // Method java/lang/Number.intValue:()I\n 197: if_icmpge 223\n 200: aload_1\n 201: iload 7\n 203: aload_3\n 204: iload 5\n 206: invokeinterface #62, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 211: invokeinterface #71, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 216: pop\n 217: iinc 5, 1\n 220: goto 244\n 223: aload_1\n 224: iload 7\n 226: aload 4\n 228: iload 6\n 230: invokeinterface #62, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 235: invokeinterface #71, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 240: pop\n 241: iinc 6, 1\n 244: iinc 7, 1\n 247: goto 145\n 250: iload 5\n 252: aload_3\n 253: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 258: if_icmpge 287\n 261: aload_1\n 262: iload 7\n 264: aload_3\n 265: iload 5\n 267: invokeinterface #62, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 272: invokeinterface #71, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 277: pop\n 278: iinc 5, 1\n 281: iinc 7, 1\n 284: goto 250\n 287: iload 6\n 289: aload 4\n 291: invokeinterface #22, 1 // InterfaceMethod java/util/List.size:()I\n 296: if_icmpge 326\n 299: aload_1\n 300: iload 7\n 302: aload 4\n 304: iload 6\n 306: invokeinterface #62, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 311: invokeinterface #71, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 316: pop\n 317: iinc 6, 1\n 320: iinc 7, 1\n 323: goto 287\n 326: aload_1\n 327: areturn\n 328: aload_0\n 329: areturn\n\n public static final void main();\n Code:\n 0: ldc #86 // String Enter the number of items to sort -\n 2: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 5: swap\n 6: invokevirtual #98 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 9: invokestatic #104 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 12: dup\n 13: invokestatic #107 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 16: invokestatic #111 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 19: istore_0\n 20: new #24 // class java/util/ArrayList\n 23: dup\n 24: iload_0\n 25: invokespecial #28 // Method java/util/ArrayList.\"<init>\":(I)V\n 28: astore_2\n 29: iconst_0\n 30: istore_3\n 31: iload_3\n 32: iload_0\n 33: if_icmpge 66\n 36: iload_3\n 37: istore 4\n 39: aload_2\n 40: iload 4\n 42: istore 5\n 44: astore 8\n 46: iconst_0\n 47: istore 6\n 49: iconst_0\n 50: invokestatic #34 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 53: aload 8\n 55: swap\n 56: invokevirtual #38 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 59: pop\n 60: iinc 3, 1\n 63: goto 31\n 66: aload_2\n 67: checkcast #18 // class java/util/List\n 70: astore_1\n 71: aload_1\n 72: checkcast #113 // class java/lang/Iterable\n 75: invokestatic #117 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 78: astore_2\n 79: iconst_0\n 80: istore_3\n 81: aload_2\n 82: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 87: astore 4\n 89: aload 4\n 91: invokeinterface #127, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 96: ifeq 185\n 99: aload 4\n 101: invokeinterface #131, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 106: astore 5\n 108: aload 5\n 110: checkcast #133 // class kotlin/collections/IndexedValue\n 113: astore 6\n 115: iconst_0\n 116: istore 7\n 118: new #135 // class java/lang/StringBuilder\n 121: dup\n 122: invokespecial #137 // Method java/lang/StringBuilder.\"<init>\":()V\n 125: ldc #139 // String Enter value\n 127: invokevirtual #143 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 130: aload 6\n 132: invokevirtual #146 // Method kotlin/collections/IndexedValue.getIndex:()I\n 135: iconst_1\n 136: iadd\n 137: invokevirtual #149 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 140: ldc #151 // String -\n 142: invokevirtual #143 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 145: invokevirtual #154 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 148: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 151: swap\n 152: invokevirtual #98 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 155: aload_1\n 156: aload 6\n 158: invokevirtual #146 // Method kotlin/collections/IndexedValue.getIndex:()I\n 161: invokestatic #104 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 164: dup\n 165: invokestatic #107 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 168: invokestatic #111 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 171: invokestatic #34 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 174: invokeinterface #71, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 179: pop\n 180: nop\n 181: nop\n 182: goto 89\n 185: nop\n 186: new #135 // class java/lang/StringBuilder\n 189: dup\n 190: invokespecial #137 // Method java/lang/StringBuilder.\"<init>\":()V\n 193: ldc #156 // String unsorted list is\n 195: invokevirtual #143 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 198: aload_1\n 199: invokevirtual #159 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 202: invokevirtual #154 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 205: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 208: swap\n 209: invokevirtual #162 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 212: aload_1\n 213: checkcast #52 // class java/util/Collection\n 216: invokestatic #56 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 219: invokestatic #58 // Method mergeSort:(Ljava/util/List;)Ljava/util/List;\n 222: astore_2\n 223: new #135 // class java/lang/StringBuilder\n 226: dup\n 227: invokespecial #137 // Method java/lang/StringBuilder.\"<init>\":()V\n 230: ldc #164 // String sorted list is\n 232: invokevirtual #143 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 235: aload_2\n 236: invokevirtual #159 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 239: invokevirtual #154 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 242: getstatic #92 // Field java/lang/System.out:Ljava/io/PrintStream;\n 245: swap\n 246: invokevirtual #162 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 249: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #177 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
HarshCasper__NeoAlgo__4f1e5bd/Kotlin/search/TernarySearch.kt
//Kotlin program to implement ternary search using recursive approach import java.util.* // A function to declare ternary search fun ternarySearch(left:Int, right:Int, key:Int, array: ArrayList<Int>): Int{ if (right >= left) { // Finding the midterms val mid1 = left + (right - left) / 3 val mid2 = right - (right - left) / 3 // Check if the value is present in the first mid term if (array[mid1] == key) { return mid1 } // Check if the value is present in the second mid term if (array[mid2] == key) { return mid2 } // If the element is not present in the mid positions, the following cases can be a possibility. // Checking if the value is less than mid1 element if (key < array[mid1]) { return ternarySearch(left, mid1 - 1, key, array) } // Checking if the value is greater than mid2 element else if (key > array[mid2]) { return ternarySearch(mid2 + 1, right, key, array) } // The last possibility is that, the element may be present between the mid1 and mid2 else { return ternarySearch(mid1 + 1, mid2 - 1, key, array) } } // If all the possibilities fail, the element is not present inside the array return -1 } //Testing code fun main(){ val input = Scanner(System.`in`) println("Enter the length of the array") val arrayLength = input.nextInt() val arrayOfElements = arrayListOf<Int>() println("Enter the elements of the array in ascending order") for(index in 0 until arrayLength) { val element = input.nextInt() arrayOfElements.add(element) } print("Enter the number you want to search for :") val number = input.nextInt() input.close() val left:Int = -1 val right:Int = arrayLength - 1 // Search the number using ternarySearch val position = ternarySearch(left, right, number, arrayOfElements) + 1 if(position == 0) println("Key: $number is not present in the array") else println("Key: $number is present in the array at position $position") } /* Sample Test Cases:- Test Case 1:- Enter the length of the array 5 Enter the elements of the array in ascending order 1 2 3 4 5 Enter the number you want to search for :5 Key: 5 is present in the array at position 5 Test Case 2:- Enter the length of the array 5 Enter the elements of the array in ascending order 10 20 30 40 50 Enter the number you want to search for :60 Key: 60 is not present in the array Time Complexity:- The time complexity of this algorithm is O(log3n), where n is the size of the array Space cComplexity:- The space complexity of this algorithm is O(1), which is constant, irrespective of any case. */
[ { "class_path": "HarshCasper__NeoAlgo__4f1e5bd/TernarySearchKt.class", "javap": "Compiled from \"TernarySearch.kt\"\npublic final class TernarySearchKt {\n public static final int ternarySearch(int, int, int, java.util.ArrayList<java.lang.Integer>);\n Code:\n 0: aload_3\n 1: ldc #10 // String array\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iload_1\n 7: iload_0\n 8: if_icmplt 159\n 11: iload_0\n 12: iload_1\n 13: iload_0\n 14: isub\n 15: iconst_3\n 16: idiv\n 17: iadd\n 18: istore 4\n 20: iload_1\n 21: iload_1\n 22: iload_0\n 23: isub\n 24: iconst_3\n 25: idiv\n 26: isub\n 27: istore 5\n 29: aload_3\n 30: iload 4\n 32: invokevirtual #22 // Method java/util/ArrayList.get:(I)Ljava/lang/Object;\n 35: checkcast #24 // class java/lang/Integer\n 38: iload_2\n 39: istore 6\n 41: dup\n 42: ifnonnull 49\n 45: pop\n 46: goto 60\n 49: invokevirtual #28 // Method java/lang/Integer.intValue:()I\n 52: iload 6\n 54: if_icmpne 60\n 57: iload 4\n 59: ireturn\n 60: aload_3\n 61: iload 5\n 63: invokevirtual #22 // Method java/util/ArrayList.get:(I)Ljava/lang/Object;\n 66: checkcast #24 // class java/lang/Integer\n 69: iload_2\n 70: istore 6\n 72: dup\n 73: ifnonnull 80\n 76: pop\n 77: goto 91\n 80: invokevirtual #28 // Method java/lang/Integer.intValue:()I\n 83: iload 6\n 85: if_icmpne 91\n 88: iload 5\n 90: ireturn\n 91: iload_2\n 92: aload_3\n 93: iload 4\n 95: invokevirtual #22 // Method java/util/ArrayList.get:(I)Ljava/lang/Object;\n 98: checkcast #30 // class java/lang/Number\n 101: invokevirtual #31 // Method java/lang/Number.intValue:()I\n 104: if_icmpge 118\n 107: iload_0\n 108: iload 4\n 110: iconst_1\n 111: isub\n 112: iload_2\n 113: aload_3\n 114: invokestatic #33 // Method ternarySearch:(IIILjava/util/ArrayList;)I\n 117: ireturn\n 118: iload_2\n 119: aload_3\n 120: iload 5\n 122: invokevirtual #22 // Method java/util/ArrayList.get:(I)Ljava/lang/Object;\n 125: checkcast #30 // class java/lang/Number\n 128: invokevirtual #31 // Method java/lang/Number.intValue:()I\n 131: if_icmple 145\n 134: iload 5\n 136: iconst_1\n 137: iadd\n 138: iload_1\n 139: iload_2\n 140: aload_3\n 141: invokestatic #33 // Method ternarySearch:(IIILjava/util/ArrayList;)I\n 144: ireturn\n 145: iload 4\n 147: iconst_1\n 148: iadd\n 149: iload 5\n 151: iconst_1\n 152: isub\n 153: iload_2\n 154: aload_3\n 155: invokestatic #33 // Method ternarySearch:(IIILjava/util/ArrayList;)I\n 158: ireturn\n 159: iconst_m1\n 160: ireturn\n\n public static final void main();\n Code:\n 0: new #44 // class java/util/Scanner\n 3: dup\n 4: getstatic #50 // Field java/lang/System.in:Ljava/io/InputStream;\n 7: invokespecial #54 // Method java/util/Scanner.\"<init>\":(Ljava/io/InputStream;)V\n 10: astore_0\n 11: ldc #56 // String Enter the length of the array\n 13: getstatic #60 // Field java/lang/System.out:Ljava/io/PrintStream;\n 16: swap\n 17: invokevirtual #66 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 20: aload_0\n 21: invokevirtual #69 // Method java/util/Scanner.nextInt:()I\n 24: istore_1\n 25: new #18 // class java/util/ArrayList\n 28: dup\n 29: invokespecial #71 // Method java/util/ArrayList.\"<init>\":()V\n 32: astore_2\n 33: ldc #73 // String Enter the elements of the array in ascending order\n 35: getstatic #60 // Field java/lang/System.out:Ljava/io/PrintStream;\n 38: swap\n 39: invokevirtual #66 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 42: iconst_0\n 43: istore_3\n 44: iload_3\n 45: iload_1\n 46: if_icmpge 71\n 49: aload_0\n 50: invokevirtual #69 // Method java/util/Scanner.nextInt:()I\n 53: istore 4\n 55: aload_2\n 56: iload 4\n 58: invokestatic #77 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 61: invokevirtual #81 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 64: pop\n 65: iinc 3, 1\n 68: goto 44\n 71: ldc #83 // String Enter the number you want to search for :\n 73: getstatic #60 // Field java/lang/System.out:Ljava/io/PrintStream;\n 76: swap\n 77: invokevirtual #86 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 80: aload_0\n 81: invokevirtual #69 // Method java/util/Scanner.nextInt:()I\n 84: istore_3\n 85: aload_0\n 86: invokevirtual #89 // Method java/util/Scanner.close:()V\n 89: iconst_m1\n 90: istore 4\n 92: iload_1\n 93: iconst_1\n 94: isub\n 95: istore 5\n 97: iload 4\n 99: iload 5\n 101: iload_3\n 102: aload_2\n 103: invokestatic #33 // Method ternarySearch:(IIILjava/util/ArrayList;)I\n 106: iconst_1\n 107: iadd\n 108: istore 6\n 110: iload 6\n 112: ifne 149\n 115: new #91 // class java/lang/StringBuilder\n 118: dup\n 119: invokespecial #92 // Method java/lang/StringBuilder.\"<init>\":()V\n 122: ldc #94 // String Key:\n 124: invokevirtual #98 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 127: iload_3\n 128: invokevirtual #101 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 131: ldc #103 // String is not present in the array\n 133: invokevirtual #98 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 136: invokevirtual #107 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 139: getstatic #60 // Field java/lang/System.out:Ljava/io/PrintStream;\n 142: swap\n 143: invokevirtual #66 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 146: goto 185\n 149: new #91 // class java/lang/StringBuilder\n 152: dup\n 153: invokespecial #92 // Method java/lang/StringBuilder.\"<init>\":()V\n 156: ldc #94 // String Key:\n 158: invokevirtual #98 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 161: iload_3\n 162: invokevirtual #101 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 165: ldc #109 // String is present in the array at position\n 167: invokevirtual #98 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 170: iload 6\n 172: invokevirtual #101 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 175: invokevirtual #107 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 178: getstatic #60 // Field java/lang/System.out:Ljava/io/PrintStream;\n 181: swap\n 182: invokevirtual #66 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 185: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #120 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
HarshCasper__NeoAlgo__4f1e5bd/Kotlin/sort/RadixSort/src/RadixSort.kt
// Function to Implement Radix Sort // The radix sorting algorithm is an integer sorting algorithm, // that sorts by grouping numbers by their individual digits (or by their radix). // It uses each radix/digit as a key, and implements counting sort or // bucket sort under the hood in order to do the work of sorting. // Takes an IntArray as arguments and returns a sorted IntArray to the caller function fun radixSort(original: IntArray): IntArray { // Array needs to be mutable var old = original for (shift in 31 downTo 0) { val tmp = IntArray(old.size) // The number of 0s var j = 0 // Move the 0s to the new array, and the 1s to the old one for (i in 0 until old.size) { // If there is a 1 in the bit we are testing, the number will be negative val move = (old[i] shl shift) >= 0 // If this is the last bit, negative numbers are actually lower val toBeMoved = if (shift != 0) move else !move if (toBeMoved) { tmp[j++] = old[i] } else { // It's a 1, so stick it in the old array for now old[i - j] = old[i] } } // Copy over the 1s from the old array for (i in j until tmp.size) { tmp[i] = old[i - j] } old = tmp } return old } fun main(args: Array<String>) { print("Enter N: "); val n= readLine()!!.toInt(); println("Enter array of N integers: "); val arrays = IntArray(n) { readLine()!!.toInt() } val array= radixSort(arrays); print("Array after Radix Sort is: ") for(i in array){ print("$i ") } } /* Time Complexity: O(log n) Sample Input: Enter N: 5 Enter array of N integers: 3 -1 2 3 4 Sample Output: Array after Radix Sort is: -1 2 3 3 4 */
[ { "class_path": "HarshCasper__NeoAlgo__4f1e5bd/RadixSortKt.class", "javap": "Compiled from \"RadixSort.kt\"\npublic final class RadixSortKt {\n public static final int[] radixSort(int[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String original\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_1\n 8: bipush 31\n 10: istore_2\n 11: iconst_m1\n 12: iload_2\n 13: if_icmpge 151\n 16: aload_1\n 17: arraylength\n 18: newarray int\n 20: astore_3\n 21: iconst_0\n 22: istore 4\n 24: iconst_0\n 25: istore 5\n 27: aload_1\n 28: arraylength\n 29: istore 6\n 31: iload 5\n 33: iload 6\n 35: if_icmpge 111\n 38: aload_1\n 39: iload 5\n 41: iaload\n 42: iload_2\n 43: ishl\n 44: iflt 51\n 47: iconst_1\n 48: goto 52\n 51: iconst_0\n 52: istore 7\n 54: iload_2\n 55: ifeq 63\n 58: iload 7\n 60: goto 73\n 63: iload 7\n 65: ifne 72\n 68: iconst_1\n 69: goto 73\n 72: iconst_0\n 73: istore 8\n 75: iload 8\n 77: ifeq 94\n 80: aload_3\n 81: iload 4\n 83: iinc 4, 1\n 86: aload_1\n 87: iload 5\n 89: iaload\n 90: iastore\n 91: goto 105\n 94: aload_1\n 95: iload 5\n 97: iload 4\n 99: isub\n 100: aload_1\n 101: iload 5\n 103: iaload\n 104: iastore\n 105: iinc 5, 1\n 108: goto 31\n 111: iload 4\n 113: istore 5\n 115: aload_3\n 116: arraylength\n 117: istore 6\n 119: iload 5\n 121: iload 6\n 123: if_icmpge 143\n 126: aload_3\n 127: iload 5\n 129: aload_1\n 130: iload 5\n 132: iload 4\n 134: isub\n 135: iaload\n 136: iastore\n 137: iinc 5, 1\n 140: goto 119\n 143: aload_3\n 144: astore_1\n 145: iinc 2, -1\n 148: goto 11\n 151: aload_1\n 152: areturn\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #30 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: ldc #32 // String Enter N:\n 8: getstatic #38 // Field java/lang/System.out:Ljava/io/PrintStream;\n 11: swap\n 12: invokevirtual #44 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 15: invokestatic #50 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 18: dup\n 19: invokestatic #53 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 22: invokestatic #59 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 25: istore_1\n 26: ldc #61 // String Enter array of N integers:\n 28: getstatic #38 // Field java/lang/System.out:Ljava/io/PrintStream;\n 31: swap\n 32: invokevirtual #64 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 35: iconst_0\n 36: istore_3\n 37: iload_1\n 38: newarray int\n 40: astore 4\n 42: iload_3\n 43: iload_1\n 44: if_icmpge 71\n 47: iload_3\n 48: istore 5\n 50: aload 4\n 52: iload 5\n 54: invokestatic #50 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 57: dup\n 58: invokestatic #53 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 61: invokestatic #59 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 64: iastore\n 65: iinc 3, 1\n 68: goto 42\n 71: aload 4\n 73: astore_2\n 74: aload_2\n 75: invokestatic #66 // Method radixSort:([I)[I\n 78: astore_3\n 79: ldc #68 // String Array after Radix Sort is:\n 81: getstatic #38 // Field java/lang/System.out:Ljava/io/PrintStream;\n 84: swap\n 85: invokevirtual #44 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 88: iconst_0\n 89: istore 4\n 91: aload_3\n 92: arraylength\n 93: istore 5\n 95: iload 4\n 97: iload 5\n 99: if_icmpge 141\n 102: aload_3\n 103: iload 4\n 105: iaload\n 106: istore 6\n 108: new #70 // class java/lang/StringBuilder\n 111: dup\n 112: invokespecial #74 // Method java/lang/StringBuilder.\"<init>\":()V\n 115: iload 6\n 117: invokevirtual #78 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 120: bipush 32\n 122: invokevirtual #81 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 125: invokevirtual #84 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 128: getstatic #38 // Field java/lang/System.out:Ljava/io/PrintStream;\n 131: swap\n 132: invokevirtual #44 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 135: iinc 4, 1\n 138: goto 95\n 141: return\n}\n", "javap_err": "" } ]
HarshCasper__NeoAlgo__4f1e5bd/Kotlin/sort/QuickSort/src/QuickSort.kt
/* QuickSort Algortihm works on Divide and Conquer Algorithm. It creates two empty arrays to hold elements less than the pivot value and elements greater than the pivot value, and then recursively sort the sub arrays. There are two basic operations in the algorithm, swapping items in place and partitioning a section of the array. */ //Importing the Java.util package, it is needed because we are using the scanner object. import java.util.* //The function which will sort the given array in ascending order using QuickSort Algortihm fun quicksort(items:List<Int>):List<Int>{ //If there is only one element in the list, then there is no need to sort if (items.count() < 2){ return items } //Vaiable pivot stores the index of middle element of the list val pivot = items[items.count()/2] //Variable equalto stores the elements at the pivot index val equalto = items.filter { it == pivot } //Variable lesser stores the list of element with indexes less than the pivot index val lesser = items.filter { it < pivot } //Variable greater stores the list of element with indexes less than the pivot index val greater = items.filter { it > pivot } //Calling the quicksort function recursively on the splitted arrays //This will get recursively called until left with multiple arrays with a single element and arranged in order return quicksort(lesser) + equalto + quicksort(greater) } //Main Driver Code fun main() { val input = Scanner(System.`in`) println("Enter the length of the array") val arrayLength = input.nextInt() val arrayOfElements = arrayListOf<Int>() println("Enter the List of numbers you want to Sort:") for(index in 0 until arrayLength) { val element = input.nextInt() arrayOfElements.add(element) } print("Original List: ") for(index in 0..4) { val number: Int = arrayOfElements[index] print("$number\t") } print("\nOrdered list: ") val ordered = quicksort(arrayOfElements) println(ordered) } /* First Testcasee: Enter the length of the array 6 Enter the List of numbers you want to Sort: 34 33 67 3 2 45 Original List: 34 33 67 3 2 45 Ordered list: [2, 3, 33, 34, 45, 67] Time Complexity: O(n log n) Space Complexity: O(log n) */
[ { "class_path": "HarshCasper__NeoAlgo__4f1e5bd/QuickSortKt.class", "javap": "Compiled from \"QuickSort.kt\"\npublic final class QuickSortKt {\n public static final java.util.List<java.lang.Integer> quicksort(java.util.List<java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #10 // String items\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #18 // class java/util/Collection\n 10: invokeinterface #22, 1 // InterfaceMethod java/util/Collection.size:()I\n 15: iconst_2\n 16: if_icmpge 21\n 19: aload_0\n 20: areturn\n 21: aload_0\n 22: aload_0\n 23: checkcast #18 // class java/util/Collection\n 26: invokeinterface #22, 1 // InterfaceMethod java/util/Collection.size:()I\n 31: iconst_2\n 32: idiv\n 33: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 38: checkcast #30 // class java/lang/Number\n 41: invokevirtual #33 // Method java/lang/Number.intValue:()I\n 44: istore_1\n 45: aload_0\n 46: checkcast #35 // class java/lang/Iterable\n 49: astore_3\n 50: iconst_0\n 51: istore 4\n 53: aload_3\n 54: astore 5\n 56: new #37 // class java/util/ArrayList\n 59: dup\n 60: invokespecial #41 // Method java/util/ArrayList.\"<init>\":()V\n 63: checkcast #18 // class java/util/Collection\n 66: astore 6\n 68: iconst_0\n 69: istore 7\n 71: aload 5\n 73: invokeinterface #45, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 78: astore 8\n 80: aload 8\n 82: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 87: ifeq 139\n 90: aload 8\n 92: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 97: astore 9\n 99: aload 9\n 101: checkcast #30 // class java/lang/Number\n 104: invokevirtual #33 // Method java/lang/Number.intValue:()I\n 107: istore 10\n 109: iconst_0\n 110: istore 11\n 112: iload 10\n 114: iload_1\n 115: if_icmpne 122\n 118: iconst_1\n 119: goto 123\n 122: iconst_0\n 123: ifeq 80\n 126: aload 6\n 128: aload 9\n 130: invokeinterface #59, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 135: pop\n 136: goto 80\n 139: aload 6\n 141: checkcast #24 // class java/util/List\n 144: nop\n 145: astore_2\n 146: aload_0\n 147: checkcast #35 // class java/lang/Iterable\n 150: astore 4\n 152: iconst_0\n 153: istore 5\n 155: aload 4\n 157: astore 6\n 159: new #37 // class java/util/ArrayList\n 162: dup\n 163: invokespecial #41 // Method java/util/ArrayList.\"<init>\":()V\n 166: checkcast #18 // class java/util/Collection\n 169: astore 7\n 171: iconst_0\n 172: istore 8\n 174: aload 6\n 176: invokeinterface #45, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 181: astore 9\n 183: aload 9\n 185: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 190: ifeq 242\n 193: aload 9\n 195: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 200: astore 10\n 202: aload 10\n 204: checkcast #30 // class java/lang/Number\n 207: invokevirtual #33 // Method java/lang/Number.intValue:()I\n 210: istore 11\n 212: iconst_0\n 213: istore 12\n 215: iload 11\n 217: iload_1\n 218: if_icmpge 225\n 221: iconst_1\n 222: goto 226\n 225: iconst_0\n 226: ifeq 183\n 229: aload 7\n 231: aload 10\n 233: invokeinterface #59, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 238: pop\n 239: goto 183\n 242: aload 7\n 244: checkcast #24 // class java/util/List\n 247: nop\n 248: astore_3\n 249: aload_0\n 250: checkcast #35 // class java/lang/Iterable\n 253: astore 5\n 255: iconst_0\n 256: istore 6\n 258: aload 5\n 260: astore 7\n 262: new #37 // class java/util/ArrayList\n 265: dup\n 266: invokespecial #41 // Method java/util/ArrayList.\"<init>\":()V\n 269: checkcast #18 // class java/util/Collection\n 272: astore 8\n 274: iconst_0\n 275: istore 9\n 277: aload 7\n 279: invokeinterface #45, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 284: astore 10\n 286: aload 10\n 288: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 293: ifeq 345\n 296: aload 10\n 298: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 303: astore 11\n 305: aload 11\n 307: checkcast #30 // class java/lang/Number\n 310: invokevirtual #33 // Method java/lang/Number.intValue:()I\n 313: istore 12\n 315: iconst_0\n 316: istore 13\n 318: iload 12\n 320: iload_1\n 321: if_icmple 328\n 324: iconst_1\n 325: goto 329\n 328: iconst_0\n 329: ifeq 286\n 332: aload 8\n 334: aload 11\n 336: invokeinterface #59, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 341: pop\n 342: goto 286\n 345: aload 8\n 347: checkcast #24 // class java/util/List\n 350: nop\n 351: astore 4\n 353: aload_3\n 354: invokestatic #61 // Method quicksort:(Ljava/util/List;)Ljava/util/List;\n 357: checkcast #18 // class java/util/Collection\n 360: aload_2\n 361: checkcast #35 // class java/lang/Iterable\n 364: invokestatic #67 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 367: checkcast #18 // class java/util/Collection\n 370: aload 4\n 372: invokestatic #61 // Method quicksort:(Ljava/util/List;)Ljava/util/List;\n 375: checkcast #35 // class java/lang/Iterable\n 378: invokestatic #67 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 381: areturn\n\n public static final void main();\n Code:\n 0: new #89 // class java/util/Scanner\n 3: dup\n 4: getstatic #95 // Field java/lang/System.in:Ljava/io/InputStream;\n 7: invokespecial #98 // Method java/util/Scanner.\"<init>\":(Ljava/io/InputStream;)V\n 10: astore_0\n 11: ldc #100 // String Enter the length of the array\n 13: getstatic #104 // Field java/lang/System.out:Ljava/io/PrintStream;\n 16: swap\n 17: invokevirtual #110 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 20: aload_0\n 21: invokevirtual #113 // Method java/util/Scanner.nextInt:()I\n 24: istore_1\n 25: new #37 // class java/util/ArrayList\n 28: dup\n 29: invokespecial #41 // Method java/util/ArrayList.\"<init>\":()V\n 32: astore_2\n 33: ldc #115 // String Enter the List of numbers you want to Sort:\n 35: getstatic #104 // Field java/lang/System.out:Ljava/io/PrintStream;\n 38: swap\n 39: invokevirtual #110 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 42: iconst_0\n 43: istore_3\n 44: iload_3\n 45: iload_1\n 46: if_icmpge 71\n 49: aload_0\n 50: invokevirtual #113 // Method java/util/Scanner.nextInt:()I\n 53: istore 4\n 55: aload_2\n 56: iload 4\n 58: invokestatic #121 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 61: invokevirtual #122 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 64: pop\n 65: iinc 3, 1\n 68: goto 44\n 71: ldc #124 // String Original List:\n 73: getstatic #104 // Field java/lang/System.out:Ljava/io/PrintStream;\n 76: swap\n 77: invokevirtual #127 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 80: iconst_0\n 81: istore_3\n 82: iload_3\n 83: iconst_5\n 84: if_icmpge 139\n 87: aload_2\n 88: iload_3\n 89: invokevirtual #128 // Method java/util/ArrayList.get:(I)Ljava/lang/Object;\n 92: dup\n 93: ldc #130 // String get(...)\n 95: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 98: checkcast #30 // class java/lang/Number\n 101: invokevirtual #33 // Method java/lang/Number.intValue:()I\n 104: istore 4\n 106: new #135 // class java/lang/StringBuilder\n 109: dup\n 110: invokespecial #136 // Method java/lang/StringBuilder.\"<init>\":()V\n 113: iload 4\n 115: invokevirtual #140 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 118: bipush 9\n 120: invokevirtual #143 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 123: invokevirtual #147 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 126: getstatic #104 // Field java/lang/System.out:Ljava/io/PrintStream;\n 129: swap\n 130: invokevirtual #127 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 133: iinc 3, 1\n 136: goto 82\n 139: ldc #149 // String \\nOrdered list:\n 141: getstatic #104 // Field java/lang/System.out:Ljava/io/PrintStream;\n 144: swap\n 145: invokevirtual #127 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 148: aload_2\n 149: checkcast #24 // class java/util/List\n 152: invokestatic #61 // Method quicksort:(Ljava/util/List;)Ljava/util/List;\n 155: astore_3\n 156: getstatic #104 // Field java/lang/System.out:Ljava/io/PrintStream;\n 159: aload_3\n 160: invokevirtual #110 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 163: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #161 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
mboos__advent-of-code__4477bb3/2020/day/21/allergens.kt
/** * Solution to https://adventofcode.com/2020/day/21 */ import java.io.File fun main(args: Array<String>) { var input: String = args[0] var potentialAllergens = mutableMapOf<String, MutableSet<String>>() var allIngredients = mutableListOf<String>() var pattern: Regex = Regex("((\\w+ )+)\\(contains (\\w+(, \\w+)*)\\)\n?") File(input).forEachLine { line -> var match = pattern.matchEntire(line) var ingredients = match!!.groupValues[1].split(" ").filter { it.isNotBlank() } allIngredients.addAll(ingredients) match.groupValues[3].split(", ").forEach { element -> if (element.isNotBlank()) { if (element in potentialAllergens) { potentialAllergens[element] = potentialAllergens[element]!!.intersect(ingredients) as MutableSet<String> } else { potentialAllergens[element] = ingredients.toMutableSet() } } } } var allPotentialIngredients = mutableSetOf<String>() potentialAllergens.values.forEach { ingredients -> allPotentialIngredients.addAll(ingredients) } var safeIngredients = 0 allIngredients.forEach { ingredient -> if (!allPotentialIngredients.contains(ingredient)) { safeIngredients += 1 } } println("Safe ingredients: ${safeIngredients}") val foundIngredients = mutableSetOf<String>() val foundAllergens = mutableMapOf<String,String>() var unmatchedAllergens = true while (unmatchedAllergens) { unmatchedAllergens = false potentialAllergens.forEach { allergen, ingredients -> if (!(allergen in foundAllergens)) { unmatchedAllergens = true if (potentialAllergens[allergen]!!.size == 1) { foundIngredients.addAll(ingredients) foundAllergens[allergen] = ingredients.first() } else { potentialAllergens[allergen]!!.removeAll(foundIngredients) } } } } println("Ingredients: ${foundAllergens.toSortedMap().values.joinTo(StringBuffer(""), ",").toString()}") }
[ { "class_path": "mboos__advent-of-code__4477bb3/AllergensKt.class", "javap": "Compiled from \"allergens.kt\"\npublic final class AllergensKt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iconst_0\n 8: aaload\n 9: astore_1\n 10: new #17 // class kotlin/jvm/internal/Ref$ObjectRef\n 13: dup\n 14: invokespecial #21 // Method kotlin/jvm/internal/Ref$ObjectRef.\"<init>\":()V\n 17: astore_2\n 18: aload_2\n 19: new #23 // class java/util/LinkedHashMap\n 22: dup\n 23: invokespecial #24 // Method java/util/LinkedHashMap.\"<init>\":()V\n 26: checkcast #26 // class java/util/Map\n 29: putfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 32: new #17 // class kotlin/jvm/internal/Ref$ObjectRef\n 35: dup\n 36: invokespecial #21 // Method kotlin/jvm/internal/Ref$ObjectRef.\"<init>\":()V\n 39: astore_3\n 40: aload_3\n 41: new #32 // class java/util/ArrayList\n 44: dup\n 45: invokespecial #33 // Method java/util/ArrayList.\"<init>\":()V\n 48: checkcast #35 // class java/util/List\n 51: putfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 54: new #17 // class kotlin/jvm/internal/Ref$ObjectRef\n 57: dup\n 58: invokespecial #21 // Method kotlin/jvm/internal/Ref$ObjectRef.\"<init>\":()V\n 61: astore 4\n 63: aload 4\n 65: new #37 // class kotlin/text/Regex\n 68: dup\n 69: ldc #39 // String ((\\\\w+ )+)\\\\(contains (\\\\w+(, \\\\w+)*)\\\\)\\n?\n 71: invokespecial #42 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 74: putfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 77: new #44 // class java/io/File\n 80: dup\n 81: aload_1\n 82: invokespecial #45 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 85: aconst_null\n 86: aload 4\n 88: aload_3\n 89: aload_2\n 90: invokedynamic #65, 0 // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$ObjectRef;)Lkotlin/jvm/functions/Function1;\n 95: iconst_1\n 96: aconst_null\n 97: invokestatic #71 // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V\n 100: aconst_null\n 101: astore 5\n 103: new #73 // class java/util/LinkedHashSet\n 106: dup\n 107: invokespecial #74 // Method java/util/LinkedHashSet.\"<init>\":()V\n 110: checkcast #76 // class java/util/Set\n 113: astore 5\n 115: aload_2\n 116: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 119: checkcast #26 // class java/util/Map\n 122: invokeinterface #80, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 127: checkcast #82 // class java/lang/Iterable\n 130: astore 6\n 132: iconst_0\n 133: istore 7\n 135: aload 6\n 137: invokeinterface #86, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 142: astore 8\n 144: aload 8\n 146: invokeinterface #92, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 151: ifeq 191\n 154: aload 8\n 156: invokeinterface #96, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 161: astore 9\n 163: aload 9\n 165: checkcast #76 // class java/util/Set\n 168: astore 10\n 170: iconst_0\n 171: istore 11\n 173: aload 5\n 175: aload 10\n 177: checkcast #98 // class java/util/Collection\n 180: invokeinterface #102, 2 // InterfaceMethod java/util/Set.addAll:(Ljava/util/Collection;)Z\n 185: pop\n 186: nop\n 187: nop\n 188: goto 144\n 191: nop\n 192: iconst_0\n 193: istore 6\n 195: aload_3\n 196: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 199: checkcast #82 // class java/lang/Iterable\n 202: astore 7\n 204: iconst_0\n 205: istore 8\n 207: aload 7\n 209: invokeinterface #86, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 214: astore 9\n 216: aload 9\n 218: invokeinterface #92, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 223: ifeq 268\n 226: aload 9\n 228: invokeinterface #96, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 233: astore 10\n 235: aload 10\n 237: checkcast #104 // class java/lang/String\n 240: astore 11\n 242: iconst_0\n 243: istore 12\n 245: aload 5\n 247: aload 11\n 249: invokeinterface #108, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 254: ifne 263\n 257: iload 6\n 259: iconst_1\n 260: iadd\n 261: istore 6\n 263: nop\n 264: nop\n 265: goto 216\n 268: nop\n 269: new #110 // class java/lang/StringBuilder\n 272: dup\n 273: invokespecial #111 // Method java/lang/StringBuilder.\"<init>\":()V\n 276: ldc #113 // String Safe ingredients:\n 278: invokevirtual #117 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 281: iload 6\n 283: invokevirtual #120 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 286: invokevirtual #124 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 289: getstatic #130 // Field java/lang/System.out:Ljava/io/PrintStream;\n 292: swap\n 293: invokevirtual #136 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 296: new #73 // class java/util/LinkedHashSet\n 299: dup\n 300: invokespecial #74 // Method java/util/LinkedHashSet.\"<init>\":()V\n 303: checkcast #76 // class java/util/Set\n 306: astore 7\n 308: new #23 // class java/util/LinkedHashMap\n 311: dup\n 312: invokespecial #24 // Method java/util/LinkedHashMap.\"<init>\":()V\n 315: checkcast #26 // class java/util/Map\n 318: astore 8\n 320: new #138 // class kotlin/jvm/internal/Ref$BooleanRef\n 323: dup\n 324: invokespecial #139 // Method kotlin/jvm/internal/Ref$BooleanRef.\"<init>\":()V\n 327: astore 9\n 329: aload 9\n 331: iconst_1\n 332: putfield #142 // Field kotlin/jvm/internal/Ref$BooleanRef.element:Z\n 335: aload 9\n 337: getfield #142 // Field kotlin/jvm/internal/Ref$BooleanRef.element:Z\n 340: ifeq 381\n 343: aload 9\n 345: iconst_0\n 346: putfield #142 // Field kotlin/jvm/internal/Ref$BooleanRef.element:Z\n 349: aload_2\n 350: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 353: checkcast #26 // class java/util/Map\n 356: aload 8\n 358: aload 9\n 360: aload_2\n 361: aload 7\n 363: invokedynamic #154, 0 // InvokeDynamic #1:invoke:(Ljava/util/Map;Lkotlin/jvm/internal/Ref$BooleanRef;Lkotlin/jvm/internal/Ref$ObjectRef;Ljava/util/Set;)Lkotlin/jvm/functions/Function2;\n 368: invokedynamic #165, 0 // InvokeDynamic #2:accept:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiConsumer;\n 373: invokeinterface #169, 2 // InterfaceMethod java/util/Map.forEach:(Ljava/util/function/BiConsumer;)V\n 378: goto 335\n 381: new #110 // class java/lang/StringBuilder\n 384: dup\n 385: invokespecial #111 // Method java/lang/StringBuilder.\"<init>\":()V\n 388: ldc #171 // String Ingredients:\n 390: invokevirtual #117 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 393: aload 8\n 395: invokestatic #177 // Method kotlin/collections/MapsKt.toSortedMap:(Ljava/util/Map;)Ljava/util/SortedMap;\n 398: invokeinterface #180, 1 // InterfaceMethod java/util/SortedMap.values:()Ljava/util/Collection;\n 403: dup\n 404: ldc #182 // String <get-values>(...)\n 406: invokestatic #185 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 409: checkcast #82 // class java/lang/Iterable\n 412: new #187 // class java/lang/StringBuffer\n 415: dup\n 416: ldc #189 // String\n 418: invokespecial #190 // Method java/lang/StringBuffer.\"<init>\":(Ljava/lang/String;)V\n 421: checkcast #192 // class java/lang/Appendable\n 424: ldc #194 // String ,\n 426: checkcast #196 // class java/lang/CharSequence\n 429: aconst_null\n 430: aconst_null\n 431: iconst_0\n 432: aconst_null\n 433: aconst_null\n 434: bipush 124\n 436: aconst_null\n 437: invokestatic #202 // Method kotlin/collections/CollectionsKt.joinTo$default:(Ljava/lang/Iterable;Ljava/lang/Appendable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Appendable;\n 440: invokevirtual #205 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 443: invokevirtual #124 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 446: getstatic #130 // Field java/lang/System.out:Ljava/io/PrintStream;\n 449: swap\n 450: invokevirtual #136 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 453: return\n\n private static final kotlin.Unit main$lambda$2(kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$ObjectRef, java.lang.String);\n Code:\n 0: aload_3\n 1: ldc #232 // String line\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 10: checkcast #37 // class kotlin/text/Regex\n 13: aload_3\n 14: checkcast #196 // class java/lang/CharSequence\n 17: invokevirtual #236 // Method kotlin/text/Regex.matchEntire:(Ljava/lang/CharSequence;)Lkotlin/text/MatchResult;\n 20: astore 4\n 22: aconst_null\n 23: astore 5\n 25: aload 4\n 27: dup\n 28: invokestatic #239 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 31: invokeinterface #245, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 36: iconst_1\n 37: invokeinterface #249, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 42: checkcast #196 // class java/lang/CharSequence\n 45: iconst_1\n 46: anewarray #104 // class java/lang/String\n 49: astore 6\n 51: aload 6\n 53: iconst_0\n 54: ldc #251 // String\n 56: aastore\n 57: aload 6\n 59: iconst_0\n 60: iconst_0\n 61: bipush 6\n 63: aconst_null\n 64: invokestatic #257 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 67: checkcast #82 // class java/lang/Iterable\n 70: astore 6\n 72: iconst_0\n 73: istore 7\n 75: aload 6\n 77: astore 8\n 79: new #32 // class java/util/ArrayList\n 82: dup\n 83: invokespecial #33 // Method java/util/ArrayList.\"<init>\":()V\n 86: checkcast #98 // class java/util/Collection\n 89: astore 9\n 91: iconst_0\n 92: istore 10\n 94: aload 8\n 96: invokeinterface #86, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 101: astore 11\n 103: aload 11\n 105: invokeinterface #92, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 110: ifeq 165\n 113: aload 11\n 115: invokeinterface #96, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 120: astore 12\n 122: aload 12\n 124: checkcast #104 // class java/lang/String\n 127: astore 13\n 129: iconst_0\n 130: istore 14\n 132: aload 13\n 134: checkcast #196 // class java/lang/CharSequence\n 137: invokestatic #261 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z\n 140: ifne 147\n 143: iconst_1\n 144: goto 148\n 147: iconst_0\n 148: nop\n 149: ifeq 103\n 152: aload 9\n 154: aload 12\n 156: invokeinterface #264, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 161: pop\n 162: goto 103\n 165: aload 9\n 167: checkcast #35 // class java/util/List\n 170: nop\n 171: astore 5\n 173: aload_1\n 174: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 177: checkcast #35 // class java/util/List\n 180: aload 5\n 182: checkcast #98 // class java/util/Collection\n 185: invokeinterface #265, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 190: pop\n 191: aload 4\n 193: invokeinterface #245, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 198: iconst_3\n 199: invokeinterface #249, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 204: checkcast #196 // class java/lang/CharSequence\n 207: iconst_1\n 208: anewarray #104 // class java/lang/String\n 211: astore 6\n 213: aload 6\n 215: iconst_0\n 216: ldc_w #267 // String ,\n 219: aastore\n 220: aload 6\n 222: iconst_0\n 223: iconst_0\n 224: bipush 6\n 226: aconst_null\n 227: invokestatic #257 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 230: checkcast #82 // class java/lang/Iterable\n 233: astore 6\n 235: iconst_0\n 236: istore 7\n 238: aload 6\n 240: invokeinterface #86, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 245: astore 8\n 247: aload 8\n 249: invokeinterface #92, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 254: ifeq 405\n 257: aload 8\n 259: invokeinterface #96, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 264: astore 9\n 266: aload 9\n 268: checkcast #104 // class java/lang/String\n 271: astore 10\n 273: iconst_0\n 274: istore 11\n 276: aload 10\n 278: checkcast #196 // class java/lang/CharSequence\n 281: invokestatic #261 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z\n 284: ifne 291\n 287: iconst_1\n 288: goto 292\n 291: iconst_0\n 292: ifeq 400\n 295: aload_2\n 296: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 299: checkcast #26 // class java/util/Map\n 302: aload 10\n 304: invokeinterface #270, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 309: ifeq 377\n 312: aload_2\n 313: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 316: checkcast #26 // class java/util/Map\n 319: astore 12\n 321: aload_2\n 322: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 325: checkcast #26 // class java/util/Map\n 328: aload 10\n 330: invokeinterface #272, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 335: dup\n 336: invokestatic #239 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 339: checkcast #82 // class java/lang/Iterable\n 342: aload 5\n 344: checkcast #82 // class java/lang/Iterable\n 347: invokestatic #276 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 350: dup\n 351: ldc_w #278 // String null cannot be cast to non-null type kotlin.collections.MutableSet<kotlin.String>\n 354: invokestatic #280 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)V\n 357: invokestatic #286 // Method kotlin/jvm/internal/TypeIntrinsics.asMutableSet:(Ljava/lang/Object;)Ljava/util/Set;\n 360: astore 13\n 362: aload 12\n 364: aload 10\n 366: aload 13\n 368: invokeinterface #289, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 373: pop\n 374: goto 400\n 377: aload_2\n 378: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 381: checkcast #26 // class java/util/Map\n 384: aload 10\n 386: aload 5\n 388: checkcast #82 // class java/lang/Iterable\n 391: invokestatic #293 // Method kotlin/collections/CollectionsKt.toMutableSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 394: invokeinterface #289, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 399: pop\n 400: nop\n 401: nop\n 402: goto 247\n 405: nop\n 406: getstatic #299 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 409: areturn\n\n private static final kotlin.Unit main$lambda$5(java.util.Map, kotlin.jvm.internal.Ref$BooleanRef, kotlin.jvm.internal.Ref$ObjectRef, java.util.Set, java.lang.String, java.util.Set);\n Code:\n 0: aload 4\n 2: ldc_w #316 // String allergen\n 5: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 8: aload 5\n 10: ldc_w #317 // String ingredients\n 13: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 16: aload_0\n 17: aload 4\n 19: invokeinterface #270, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 24: ifne 125\n 27: aload_1\n 28: iconst_1\n 29: putfield #142 // Field kotlin/jvm/internal/Ref$BooleanRef.element:Z\n 32: aload_2\n 33: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 36: checkcast #26 // class java/util/Map\n 39: aload 4\n 41: invokeinterface #272, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 46: dup\n 47: invokestatic #239 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 50: checkcast #76 // class java/util/Set\n 53: invokeinterface #321, 1 // InterfaceMethod java/util/Set.size:()I\n 58: iconst_1\n 59: if_icmpne 94\n 62: aload_3\n 63: aload 5\n 65: checkcast #98 // class java/util/Collection\n 68: invokeinterface #102, 2 // InterfaceMethod java/util/Set.addAll:(Ljava/util/Collection;)Z\n 73: pop\n 74: aload_0\n 75: aload 4\n 77: aload 5\n 79: checkcast #82 // class java/lang/Iterable\n 82: invokestatic #325 // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;\n 85: invokeinterface #289, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 90: pop\n 91: goto 125\n 94: aload_2\n 95: getfield #30 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 98: checkcast #26 // class java/util/Map\n 101: aload 4\n 103: invokeinterface #272, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 108: dup\n 109: invokestatic #239 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 112: checkcast #76 // class java/util/Set\n 115: aload_3\n 116: checkcast #98 // class java/util/Collection\n 119: invokeinterface #328, 2 // InterfaceMethod java/util/Set.removeAll:(Ljava/util/Collection;)Z\n 124: pop\n 125: getstatic #299 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 128: areturn\n\n private static final void main$lambda$6(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #335, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: pop\n 9: return\n}\n", "javap_err": "" } ]
mboos__advent-of-code__4477bb3/2020/day/13/bus.kt
/** * Solution to https://adventofcode.com/2020/day/13 */ import java.io.File fun gcf(a: Long, b: Long): Long { var tmp: Long var aa = a var bb = b while (bb != 0L) { tmp = aa % bb aa = bb bb = tmp } return aa } fun lcm(vals: List<Long>): Long { return vals.reduce{a, b -> a*b/gcf(a,b)} } fun main(args: Array<String>) { var input: String = args[0] var raw: String = File(input).readText() var secondLine: String = raw.split("\n")[1] // Part 1 var desiredDepartureTime: Long = raw.split("\n")[0].toLong() var waitTime = Long.MAX_VALUE var bestRoute: Long = 0 for (routeLabel in secondLine.split(",")) { if (routeLabel.equals("x")) { continue } var routeNum = routeLabel.toLong() var remainder = desiredDepartureTime % routeNum var potentialWaitTime: Long if (remainder > 0) { potentialWaitTime = routeNum - remainder } else { potentialWaitTime = 0 } if (potentialWaitTime < waitTime) { waitTime = potentialWaitTime bestRoute = routeNum } } println("Product of route num and wait time: ${bestRoute * waitTime}") // Part 2 var increment: Long var startTime = 0L while (true) { var failedYet: Boolean = false var goodNums: MutableList<Long> = ArrayList() for ((index, routeName) in secondLine.split(",").withIndex()) { if (routeName.equals("x")) { continue } var routeNum = routeName.toInt() if ((startTime + index) % routeNum != 0L) { failedYet = true } else { goodNums.add(routeNum.toLong()) } } if (!failedYet) { break } increment = lcm(goodNums) startTime += increment } println("Earliest timestamp: ${startTime}") }
[ { "class_path": "mboos__advent-of-code__4477bb3/BusKt.class", "javap": "Compiled from \"bus.kt\"\npublic final class BusKt {\n public static final long gcf(long, long);\n Code:\n 0: lconst_0\n 1: lstore 4\n 3: lload_0\n 4: lstore 6\n 6: lload_2\n 7: lstore 8\n 9: lload 8\n 11: lconst_0\n 12: lcmp\n 13: ifeq 34\n 16: lload 6\n 18: lload 8\n 20: lrem\n 21: lstore 4\n 23: lload 8\n 25: lstore 6\n 27: lload 4\n 29: lstore 8\n 31: goto 9\n 34: lload 6\n 36: lreturn\n\n public static final long lcm(java.util.List<java.lang.Long>);\n Code:\n 0: aload_0\n 1: ldc #18 // String vals\n 3: invokestatic #24 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #26 // class java/lang/Iterable\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 19: astore_3\n 20: aload_3\n 21: invokeinterface #36, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 26: ifne 39\n 29: new #38 // class java/lang/UnsupportedOperationException\n 32: dup\n 33: ldc #40 // String Empty collection can\\'t be reduced.\n 35: invokespecial #44 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 38: athrow\n 39: aload_3\n 40: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 45: astore 4\n 47: aload_3\n 48: invokeinterface #36, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 104\n 56: aload 4\n 58: aload_3\n 59: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: checkcast #50 // class java/lang/Number\n 67: invokevirtual #54 // Method java/lang/Number.longValue:()J\n 70: lstore 5\n 72: checkcast #50 // class java/lang/Number\n 75: invokevirtual #54 // Method java/lang/Number.longValue:()J\n 78: lstore 7\n 80: iconst_0\n 81: istore 9\n 83: lload 7\n 85: lload 5\n 87: lmul\n 88: lload 7\n 90: lload 5\n 92: invokestatic #56 // Method gcf:(JJ)J\n 95: ldiv\n 96: invokestatic #62 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 99: astore 4\n 101: goto 47\n 104: aload 4\n 106: checkcast #50 // class java/lang/Number\n 109: invokevirtual #54 // Method java/lang/Number.longValue:()J\n 112: lreturn\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #76 // String args\n 3: invokestatic #24 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iconst_0\n 8: aaload\n 9: astore_1\n 10: new #78 // class java/io/File\n 13: dup\n 14: aload_1\n 15: invokespecial #79 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 18: aconst_null\n 19: iconst_1\n 20: aconst_null\n 21: invokestatic #85 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;\n 24: astore_2\n 25: aload_2\n 26: checkcast #87 // class java/lang/CharSequence\n 29: iconst_1\n 30: anewarray #89 // class java/lang/String\n 33: astore 4\n 35: aload 4\n 37: iconst_0\n 38: ldc #91 // String \\n\n 40: aastore\n 41: aload 4\n 43: iconst_0\n 44: iconst_0\n 45: bipush 6\n 47: aconst_null\n 48: invokestatic #97 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 51: iconst_1\n 52: invokeinterface #103, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 57: checkcast #89 // class java/lang/String\n 60: astore_3\n 61: aload_2\n 62: checkcast #87 // class java/lang/CharSequence\n 65: iconst_1\n 66: anewarray #89 // class java/lang/String\n 69: astore 6\n 71: aload 6\n 73: iconst_0\n 74: ldc #91 // String \\n\n 76: aastore\n 77: aload 6\n 79: iconst_0\n 80: iconst_0\n 81: bipush 6\n 83: aconst_null\n 84: invokestatic #97 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 87: iconst_0\n 88: invokeinterface #103, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 93: checkcast #89 // class java/lang/String\n 96: invokestatic #107 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 99: lstore 4\n 101: ldc2_w #108 // long 9223372036854775807l\n 104: lstore 6\n 106: lconst_0\n 107: lstore 8\n 109: aload_3\n 110: checkcast #87 // class java/lang/CharSequence\n 113: iconst_1\n 114: anewarray #89 // class java/lang/String\n 117: astore 11\n 119: aload 11\n 121: iconst_0\n 122: ldc #111 // String ,\n 124: aastore\n 125: aload 11\n 127: iconst_0\n 128: iconst_0\n 129: bipush 6\n 131: aconst_null\n 132: invokestatic #97 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 135: invokeinterface #112, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 140: astore 10\n 142: aload 10\n 144: invokeinterface #36, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 149: ifeq 233\n 152: aload 10\n 154: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 159: checkcast #89 // class java/lang/String\n 162: astore 11\n 164: aload 11\n 166: ldc #114 // String x\n 168: invokevirtual #118 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 171: ifeq 177\n 174: goto 142\n 177: aload 11\n 179: invokestatic #107 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 182: lstore 12\n 184: lload 4\n 186: lload 12\n 188: lrem\n 189: lstore 14\n 191: lconst_0\n 192: lstore 16\n 194: lload 14\n 196: lconst_0\n 197: lcmp\n 198: ifle 211\n 201: lload 12\n 203: lload 14\n 205: lsub\n 206: lstore 16\n 208: goto 214\n 211: lconst_0\n 212: lstore 16\n 214: lload 16\n 216: lload 6\n 218: lcmp\n 219: ifge 142\n 222: lload 16\n 224: lstore 6\n 226: lload 12\n 228: lstore 8\n 230: goto 142\n 233: new #120 // class java/lang/StringBuilder\n 236: dup\n 237: invokespecial #123 // Method java/lang/StringBuilder.\"<init>\":()V\n 240: ldc #125 // String Product of route num and wait time:\n 242: invokevirtual #129 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 245: lload 8\n 247: lload 6\n 249: lmul\n 250: invokevirtual #132 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 253: invokevirtual #136 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 256: getstatic #142 // Field java/lang/System.out:Ljava/io/PrintStream;\n 259: swap\n 260: invokevirtual #148 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 263: lconst_0\n 264: lstore 10\n 266: lconst_0\n 267: lstore 12\n 269: nop\n 270: iconst_0\n 271: istore 14\n 273: new #150 // class java/util/ArrayList\n 276: dup\n 277: invokespecial #151 // Method java/util/ArrayList.\"<init>\":()V\n 280: checkcast #99 // class java/util/List\n 283: astore 15\n 285: aload_3\n 286: checkcast #87 // class java/lang/CharSequence\n 289: iconst_1\n 290: anewarray #89 // class java/lang/String\n 293: astore 17\n 295: aload 17\n 297: iconst_0\n 298: ldc #111 // String ,\n 300: aastore\n 301: aload 17\n 303: iconst_0\n 304: iconst_0\n 305: bipush 6\n 307: aconst_null\n 308: invokestatic #97 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 311: checkcast #26 // class java/lang/Iterable\n 314: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 319: astore 16\n 321: iconst_0\n 322: istore 17\n 324: aload 16\n 326: invokeinterface #36, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 331: ifeq 414\n 334: iload 17\n 336: istore 18\n 338: iload 17\n 340: iconst_1\n 341: iadd\n 342: istore 17\n 344: aload 16\n 346: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 351: checkcast #89 // class java/lang/String\n 354: astore 19\n 356: aload 19\n 358: ldc #114 // String x\n 360: invokevirtual #118 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 363: ifeq 369\n 366: goto 324\n 369: aload 19\n 371: invokestatic #157 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 374: istore 20\n 376: lload 12\n 378: iload 18\n 380: i2l\n 381: ladd\n 382: iload 20\n 384: i2l\n 385: lrem\n 386: lconst_0\n 387: lcmp\n 388: ifeq 397\n 391: iconst_1\n 392: istore 14\n 394: goto 324\n 397: aload 15\n 399: iload 20\n 401: i2l\n 402: invokestatic #62 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 405: invokeinterface #160, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 410: pop\n 411: goto 324\n 414: iload 14\n 416: ifne 422\n 419: goto 439\n 422: aload 15\n 424: invokestatic #162 // Method lcm:(Ljava/util/List;)J\n 427: lstore 10\n 429: lload 12\n 431: lload 10\n 433: ladd\n 434: lstore 12\n 436: goto 269\n 439: new #120 // class java/lang/StringBuilder\n 442: dup\n 443: invokespecial #123 // Method java/lang/StringBuilder.\"<init>\":()V\n 446: ldc #164 // String Earliest timestamp:\n 448: invokevirtual #129 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 451: lload 12\n 453: invokevirtual #132 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 456: invokevirtual #136 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 459: getstatic #142 // Field java/lang/System.out:Ljava/io/PrintStream;\n 462: swap\n 463: invokevirtual #148 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 466: return\n}\n", "javap_err": "" } ]
kgw78__kotlin-design-patterns__24b8993/Strategy.kt
// Strategy Pattern Example // ソートアルゴリズムのStrategyインターフェース interface SortStrategy { fun sort(numbers: IntArray): IntArray } // バブルソートアルゴリズム class BubbleSortStrategy : SortStrategy { override fun sort(numbers: IntArray): IntArray { val sortedArray = numbers.clone() val n = sortedArray.size for (i in 0 until n) { for (j in 0 until n - i - 1) { if (sortedArray[j] > sortedArray[j + 1]) { val temp = sortedArray[j] sortedArray[j] = sortedArray[j + 1] sortedArray[j + 1] = temp } } } return sortedArray } } // クイックソートアルゴリズム class QuickSortStrategy : SortStrategy { override fun sort(numbers: IntArray): IntArray { if (numbers.size <= 1) return numbers val pivot = numbers[numbers.size / 2] val equal = numbers.filter { it == pivot }.toIntArray() val less = numbers.filter { it < pivot }.toIntArray() val greater = numbers.filter { it > pivot }.toIntArray() return sort(less) + equal + sort(greater) } } // ソートを実行するコンテキストクラス class SortContext(private val strategy: SortStrategy) { fun executeSort(numbers: IntArray): IntArray { return strategy.sort(numbers) } } fun main() { val numbers = intArrayOf(9, 3, 7, 1, 5) // バブルソートを用いたソート val bubbleSortStrategy = BubbleSortStrategy() val bubbleSortContext = SortContext(bubbleSortStrategy) val sortedWithBubbleSort = bubbleSortContext.executeSort(numbers) println("バブルソートの結果: ${sortedWithBubbleSort.joinToString()}") // クイックソートを用いたソート val quickSortStrategy = QuickSortStrategy() val quickSortContext = SortContext(quickSortStrategy) val sortedWithQuickSort = quickSortContext.executeSort(numbers) println("クイックソートの結果: ${sortedWithQuickSort.joinToString()}") }
[ { "class_path": "kgw78__kotlin-design-patterns__24b8993/StrategyKt.class", "javap": "Compiled from \"Strategy.kt\"\npublic final class StrategyKt {\n public static final void main();\n Code:\n 0: iconst_5\n 1: newarray int\n 3: astore_1\n 4: aload_1\n 5: iconst_0\n 6: bipush 9\n 8: iastore\n 9: aload_1\n 10: iconst_1\n 11: iconst_3\n 12: iastore\n 13: aload_1\n 14: iconst_2\n 15: bipush 7\n 17: iastore\n 18: aload_1\n 19: iconst_3\n 20: iconst_1\n 21: iastore\n 22: aload_1\n 23: iconst_4\n 24: iconst_5\n 25: iastore\n 26: aload_1\n 27: astore_0\n 28: new #8 // class BubbleSortStrategy\n 31: dup\n 32: invokespecial #11 // Method BubbleSortStrategy.\"<init>\":()V\n 35: astore_1\n 36: new #13 // class SortContext\n 39: dup\n 40: aload_1\n 41: checkcast #15 // class SortStrategy\n 44: invokespecial #18 // Method SortContext.\"<init>\":(LSortStrategy;)V\n 47: astore_2\n 48: aload_2\n 49: aload_0\n 50: invokevirtual #22 // Method SortContext.executeSort:([I)[I\n 53: astore_3\n 54: new #24 // class java/lang/StringBuilder\n 57: dup\n 58: invokespecial #25 // Method java/lang/StringBuilder.\"<init>\":()V\n 61: ldc #27 // String バブルソートの結果:\n 63: invokevirtual #31 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 66: aload_3\n 67: aconst_null\n 68: aconst_null\n 69: aconst_null\n 70: iconst_0\n 71: aconst_null\n 72: aconst_null\n 73: bipush 63\n 75: aconst_null\n 76: invokestatic #37 // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 79: invokevirtual #31 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 82: invokevirtual #41 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 85: getstatic #47 // Field java/lang/System.out:Ljava/io/PrintStream;\n 88: swap\n 89: invokevirtual #53 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 92: new #55 // class QuickSortStrategy\n 95: dup\n 96: invokespecial #56 // Method QuickSortStrategy.\"<init>\":()V\n 99: astore 4\n 101: new #13 // class SortContext\n 104: dup\n 105: aload 4\n 107: checkcast #15 // class SortStrategy\n 110: invokespecial #18 // Method SortContext.\"<init>\":(LSortStrategy;)V\n 113: astore 5\n 115: aload 5\n 117: aload_0\n 118: invokevirtual #22 // Method SortContext.executeSort:([I)[I\n 121: astore 6\n 123: new #24 // class java/lang/StringBuilder\n 126: dup\n 127: invokespecial #25 // Method java/lang/StringBuilder.\"<init>\":()V\n 130: ldc #58 // String クイックソートの結果:\n 132: invokevirtual #31 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 135: aload 6\n 137: aconst_null\n 138: aconst_null\n 139: aconst_null\n 140: iconst_0\n 141: aconst_null\n 142: aconst_null\n 143: bipush 63\n 145: aconst_null\n 146: invokestatic #37 // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 149: invokevirtual #31 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 152: invokevirtual #41 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 155: getstatic #47 // Field java/lang/System.out:Ljava/io/PrintStream;\n 158: swap\n 159: invokevirtual #53 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 162: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #72 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
Road-of-CODEr__stupid-week-2021__cae1df8/2021/03/07/jjeda/Sorting.kt
// https://app.codility.com/programmers/lessons/6-sorting/distinct/ fun distinct(A: IntArray): Int { return A.toSet().size } // https://app.codility.com/programmers/lessons/6-sorting/max_product_of_three/ fun maxProductOfThree(A: IntArray): Int { val indexWithA = A.withIndex().sortedBy { it.value } val length = A.size val positiveMaxValue = indexWithA[length - 1].value * indexWithA[length - 2].value * indexWithA[length - 3].value val negativeMaxValue = indexWithA[0].value * indexWithA[1].value * indexWithA[length - 1].value return if (positiveMaxValue > negativeMaxValue) positiveMaxValue else negativeMaxValue } // https://app.codility.com/programmers/lessons/6-sorting/number_of_disc_intersections/ // TODO: Refactor this O(N^2) time complexity fun numberOfDiscIntersections(A: IntArray): Int { val sortedA = A.withIndex().sortedBy { it.index - it.value } return sortedA.asSequence().mapIndexed { index, sortedValue -> val rightEnd = if (sortedValue.index + sortedValue.value >= Int.MAX_VALUE) { Int.MAX_VALUE } else { sortedValue.index + sortedValue.value } sortedA.subList(index + 1, A.size).count { indexedValue -> rightEnd >= indexedValue.index - indexedValue.value } }.reduce { acc, number -> if (acc > 10000000) return -1 acc + number } } // https://app.codility.com/programmers/lessons/6-sorting/triangle/ fun triangle(A: IntArray): Int { val windowedA = A.sorted().reversed().windowed(3, 1) windowedA.forEach { if (it[0] < it[1] + it[2]) return 1 } return 0 }
[ { "class_path": "Road-of-CODEr__stupid-week-2021__cae1df8/SortingKt$maxProductOfThree$$inlined$sortedBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class SortingKt$maxProductOfThree$$inlined$sortedBy$1<T> implements java.util.Comparator {\n public SortingKt$maxProductOfThree$$inlined$sortedBy$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_1\n 1: checkcast #23 // class kotlin/collections/IndexedValue\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 12: checkcast #29 // class java/lang/Integer\n 15: checkcast #31 // class java/lang/Comparable\n 18: aload_2\n 19: checkcast #23 // class kotlin/collections/IndexedValue\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 32: checkcast #29 // class java/lang/Integer\n 35: aload 5\n 37: swap\n 38: checkcast #31 // class java/lang/Comparable\n 41: invokestatic #37 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" }, { "class_path": "Road-of-CODEr__stupid-week-2021__cae1df8/SortingKt$numberOfDiscIntersections$$inlined$sortedBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class SortingKt$numberOfDiscIntersections$$inlined$sortedBy$1<T> implements java.util.Comparator {\n public SortingKt$numberOfDiscIntersections$$inlined$sortedBy$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_1\n 1: checkcast #23 // class kotlin/collections/IndexedValue\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method kotlin/collections/IndexedValue.getIndex:()I\n 12: aload_3\n 13: invokevirtual #31 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 16: checkcast #33 // class java/lang/Number\n 19: invokevirtual #36 // Method java/lang/Number.intValue:()I\n 22: isub\n 23: invokestatic #42 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 26: checkcast #44 // class java/lang/Comparable\n 29: aload_2\n 30: checkcast #23 // class kotlin/collections/IndexedValue\n 33: astore_3\n 34: astore 5\n 36: iconst_0\n 37: istore 4\n 39: aload_3\n 40: invokevirtual #27 // Method kotlin/collections/IndexedValue.getIndex:()I\n 43: aload_3\n 44: invokevirtual #31 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 47: checkcast #33 // class java/lang/Number\n 50: invokevirtual #36 // Method java/lang/Number.intValue:()I\n 53: isub\n 54: invokestatic #42 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 57: aload 5\n 59: swap\n 60: checkcast #44 // class java/lang/Comparable\n 63: invokestatic #50 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 66: ireturn\n}\n", "javap_err": "" }, { "class_path": "Road-of-CODEr__stupid-week-2021__cae1df8/SortingKt.class", "javap": "Compiled from \"Sorting.kt\"\npublic final class SortingKt {\n public static final int distinct(int[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #21 // Method kotlin/collections/ArraysKt.toSet:([I)Ljava/util/Set;\n 10: invokeinterface #27, 1 // InterfaceMethod java/util/Set.size:()I\n 15: ireturn\n\n public static final int maxProductOfThree(int[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #33 // Method kotlin/collections/ArraysKt.withIndex:([I)Ljava/lang/Iterable;\n 10: astore_2\n 11: iconst_0\n 12: istore_3\n 13: aload_2\n 14: new #35 // class SortingKt$maxProductOfThree$$inlined$sortedBy$1\n 17: dup\n 18: invokespecial #39 // Method SortingKt$maxProductOfThree$$inlined$sortedBy$1.\"<init>\":()V\n 21: checkcast #41 // class java/util/Comparator\n 24: invokestatic #47 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 27: astore_1\n 28: aload_0\n 29: arraylength\n 30: istore_2\n 31: aload_1\n 32: iload_2\n 33: iconst_1\n 34: isub\n 35: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 40: checkcast #55 // class kotlin/collections/IndexedValue\n 43: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 46: checkcast #61 // class java/lang/Number\n 49: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 52: aload_1\n 53: iload_2\n 54: iconst_2\n 55: isub\n 56: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 61: checkcast #55 // class kotlin/collections/IndexedValue\n 64: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 67: checkcast #61 // class java/lang/Number\n 70: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 73: imul\n 74: aload_1\n 75: iload_2\n 76: iconst_3\n 77: isub\n 78: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 83: checkcast #55 // class kotlin/collections/IndexedValue\n 86: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 89: checkcast #61 // class java/lang/Number\n 92: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 95: imul\n 96: istore_3\n 97: aload_1\n 98: iconst_0\n 99: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 104: checkcast #55 // class kotlin/collections/IndexedValue\n 107: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 110: checkcast #61 // class java/lang/Number\n 113: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 116: aload_1\n 117: iconst_1\n 118: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 123: checkcast #55 // class kotlin/collections/IndexedValue\n 126: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 129: checkcast #61 // class java/lang/Number\n 132: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 135: imul\n 136: aload_1\n 137: iload_2\n 138: iconst_1\n 139: isub\n 140: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 145: checkcast #55 // class kotlin/collections/IndexedValue\n 148: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 151: checkcast #61 // class java/lang/Number\n 154: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 157: imul\n 158: istore 4\n 160: iload_3\n 161: iload 4\n 163: if_icmple 170\n 166: iload_3\n 167: goto 172\n 170: iload 4\n 172: ireturn\n\n public static final int numberOfDiscIntersections(int[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #33 // Method kotlin/collections/ArraysKt.withIndex:([I)Ljava/lang/Iterable;\n 10: astore_2\n 11: iconst_0\n 12: istore_3\n 13: aload_2\n 14: new #77 // class SortingKt$numberOfDiscIntersections$$inlined$sortedBy$1\n 17: dup\n 18: invokespecial #78 // Method SortingKt$numberOfDiscIntersections$$inlined$sortedBy$1.\"<init>\":()V\n 21: checkcast #41 // class java/util/Comparator\n 24: invokestatic #47 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 27: astore_1\n 28: aload_1\n 29: checkcast #80 // class java/lang/Iterable\n 32: invokestatic #84 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;\n 35: aload_1\n 36: aload_0\n 37: invokedynamic #104, 0 // InvokeDynamic #0:invoke:(Ljava/util/List;[I)Lkotlin/jvm/functions/Function2;\n 42: invokestatic #110 // Method kotlin/sequences/SequencesKt.mapIndexed:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;\n 45: astore_2\n 46: nop\n 47: iconst_0\n 48: istore_3\n 49: aload_2\n 50: invokeinterface #116, 1 // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;\n 55: astore 4\n 57: aload 4\n 59: invokeinterface #122, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 64: ifne 77\n 67: new #124 // class java/lang/UnsupportedOperationException\n 70: dup\n 71: ldc #126 // String Empty sequence can\\'t be reduced.\n 73: invokespecial #129 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 76: athrow\n 77: aload 4\n 79: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 5\n 86: aload 4\n 88: invokeinterface #122, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 93: ifeq 146\n 96: aload 5\n 98: aload 4\n 100: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 105: checkcast #61 // class java/lang/Number\n 108: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 111: istore 6\n 113: checkcast #61 // class java/lang/Number\n 116: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 119: istore 7\n 121: iconst_0\n 122: istore 8\n 124: iload 7\n 126: ldc #133 // int 10000000\n 128: if_icmple 133\n 131: iconst_m1\n 132: ireturn\n 133: iload 7\n 135: iload 6\n 137: iadd\n 138: invokestatic #139 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 141: astore 5\n 143: goto 86\n 146: aload 5\n 148: checkcast #61 // class java/lang/Number\n 151: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 154: ireturn\n\n public static final int triangle(int[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String A\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #155 // Method kotlin/collections/ArraysKt.sorted:([I)Ljava/util/List;\n 10: checkcast #80 // class java/lang/Iterable\n 13: invokestatic #159 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;\n 16: checkcast #80 // class java/lang/Iterable\n 19: iconst_3\n 20: iconst_1\n 21: iconst_0\n 22: iconst_4\n 23: aconst_null\n 24: invokestatic #163 // Method kotlin/collections/CollectionsKt.windowed$default:(Ljava/lang/Iterable;IIZILjava/lang/Object;)Ljava/util/List;\n 27: astore_1\n 28: aload_1\n 29: checkcast #80 // class java/lang/Iterable\n 32: astore_2\n 33: iconst_0\n 34: istore_3\n 35: aload_2\n 36: invokeinterface #164, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 4\n 43: aload 4\n 45: invokeinterface #122, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 125\n 53: aload 4\n 55: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 5\n 62: aload 5\n 64: checkcast #49 // class java/util/List\n 67: astore 6\n 69: iconst_0\n 70: istore 7\n 72: aload 6\n 74: iconst_0\n 75: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 80: checkcast #61 // class java/lang/Number\n 83: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 86: aload 6\n 88: iconst_1\n 89: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 94: checkcast #61 // class java/lang/Number\n 97: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 100: aload 6\n 102: iconst_2\n 103: invokeinterface #53, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 108: checkcast #61 // class java/lang/Number\n 111: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 114: iadd\n 115: if_icmpge 120\n 118: iconst_1\n 119: ireturn\n 120: nop\n 121: nop\n 122: goto 43\n 125: nop\n 126: iconst_0\n 127: ireturn\n\n private static final int numberOfDiscIntersections$lambda$3(java.util.List, int[], int, kotlin.collections.IndexedValue);\n Code:\n 0: aload_3\n 1: ldc #172 // String sortedValue\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: invokevirtual #175 // Method kotlin/collections/IndexedValue.getIndex:()I\n 10: aload_3\n 11: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 14: checkcast #61 // class java/lang/Number\n 17: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 20: iadd\n 21: ldc #176 // int 2147483647\n 23: if_icmplt 31\n 26: ldc #176 // int 2147483647\n 28: goto 46\n 31: aload_3\n 32: invokevirtual #175 // Method kotlin/collections/IndexedValue.getIndex:()I\n 35: aload_3\n 36: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 39: checkcast #61 // class java/lang/Number\n 42: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 45: iadd\n 46: istore 4\n 48: aload_0\n 49: iload_2\n 50: iconst_1\n 51: iadd\n 52: aload_1\n 53: arraylength\n 54: invokeinterface #180, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 59: checkcast #80 // class java/lang/Iterable\n 62: astore 5\n 64: iconst_0\n 65: istore 6\n 67: aload 5\n 69: instanceof #182 // class java/util/Collection\n 72: ifeq 92\n 75: aload 5\n 77: checkcast #182 // class java/util/Collection\n 80: invokeinterface #185, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 85: ifeq 92\n 88: iconst_0\n 89: goto 179\n 92: iconst_0\n 93: istore 7\n 95: aload 5\n 97: invokeinterface #164, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 102: astore 8\n 104: aload 8\n 106: invokeinterface #122, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 111: ifeq 177\n 114: aload 8\n 116: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 121: astore 9\n 123: aload 9\n 125: checkcast #55 // class kotlin/collections/IndexedValue\n 128: astore 10\n 130: iconst_0\n 131: istore 11\n 133: iload 4\n 135: aload 10\n 137: invokevirtual #175 // Method kotlin/collections/IndexedValue.getIndex:()I\n 140: aload 10\n 142: invokevirtual #59 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 145: checkcast #61 // class java/lang/Number\n 148: invokevirtual #64 // Method java/lang/Number.intValue:()I\n 151: isub\n 152: if_icmplt 159\n 155: iconst_1\n 156: goto 160\n 159: iconst_0\n 160: ifeq 104\n 163: iinc 7, 1\n 166: iload 7\n 168: ifge 104\n 171: invokestatic #188 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 174: goto 104\n 177: iload 7\n 179: ireturn\n}\n", "javap_err": "" } ]
Road-of-CODEr__stupid-week-2021__cae1df8/2021/02/28/jjeda/PrefixSums.kt
// https://app.codility.com/programmers/lessons/5-prefix_sums/count_div fun countDiv(A: Int, B: Int, K: Int): Int { val startNumber = (A..B).firstOrNull { it % K ==0 } ?: return 0 return (B - startNumber) / K + 1 } // https://app.codility.com/programmers/lessons/5-prefix_sums/genomic_range_query /* // O(N * M) fun solution(S: String, P: IntArray, Q: IntArray): IntArray { fun String.findMinValue(): Int { if (this.contains('A')) return 1 if (this.contains('C')) return 2 if (this.contains('G')) return 3 return 4 } return P.indices.map { S.substring(P[it], Q[it] + 1).findMinValue() }.toIntArray() } */ // O(N + M) fun genomicRangeQuery(S: String, P: IntArray, Q: IntArray): IntArray { fun generateDeltaList(char: Char): IntArray { val deltaArray = IntArray(S.length + 1) (0..S.length).fold(0) { acc, index -> deltaArray[index] = acc if (index == S.length) { return@fold 0 } acc + if (S[index] == char) 1 else 0 } return deltaArray } val deltaA = generateDeltaList('A') val deltaC = generateDeltaList('C') val deltaG = generateDeltaList('G') fun String.findMinValue(start: Int, end: Int): Int { if (start == end) { return when (S[start]) { 'A' -> 1 'C' -> 2 'G' -> 3 else -> 4 } } if (deltaA[start] != deltaA[end]) return 1 if (deltaC[start] != deltaC[end]) return 2 if (deltaG[start] != deltaG[end]) return 3 return 4 } return P.indices.map { S.substring(P[it], Q[it] + 1).findMinValue(P[it], Q[it] + 1) }.toIntArray() } // TODO: https://app.codility.com/programmers/lessons/5-prefix_sums/min_avg_two_slice // https://app.codility.com/programmers/lessons/5-prefix_sums/passing_cars fun passingCars(A: IntArray): Int { val accumulateCount = IntArray(A.size) A.foldIndexed(0) { index, acc, number -> accumulateCount[index] = acc + number acc + number } val totalCount = accumulateCount[A.size - 1] var count = 0 accumulateCount.forEachIndexed { index, number -> if (A[index] == 1) return@forEachIndexed if (count + totalCount - number > 1000000000) return -1 count += totalCount - number } return count }
[ { "class_path": "Road-of-CODEr__stupid-week-2021__cae1df8/PrefixSumsKt.class", "javap": "Compiled from \"PrefixSums.kt\"\npublic final class PrefixSumsKt {\n public static final int countDiv(int, int, int);\n Code:\n 0: new #8 // class kotlin/ranges/IntRange\n 3: dup\n 4: iload_0\n 5: iload_1\n 6: invokespecial #12 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 9: checkcast #14 // class java/lang/Iterable\n 12: astore 4\n 14: iconst_0\n 15: istore 5\n 17: aload 4\n 19: invokeinterface #18, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 24: astore 6\n 26: aload 6\n 28: invokeinterface #24, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 33: ifeq 78\n 36: aload 6\n 38: invokeinterface #28, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 43: astore 7\n 45: aload 7\n 47: checkcast #30 // class java/lang/Number\n 50: invokevirtual #34 // Method java/lang/Number.intValue:()I\n 53: istore 8\n 55: iconst_0\n 56: istore 9\n 58: iload 8\n 60: iload_2\n 61: irem\n 62: ifne 69\n 65: iconst_1\n 66: goto 70\n 69: iconst_0\n 70: ifeq 26\n 73: aload 7\n 75: goto 79\n 78: aconst_null\n 79: checkcast #36 // class java/lang/Integer\n 82: dup\n 83: ifnull 92\n 86: invokevirtual #37 // Method java/lang/Integer.intValue:()I\n 89: goto 95\n 92: pop\n 93: iconst_0\n 94: ireturn\n 95: istore_3\n 96: iload_1\n 97: iload_3\n 98: isub\n 99: iload_2\n 100: idiv\n 101: iconst_1\n 102: iadd\n 103: ireturn\n\n public static final int[] genomicRangeQuery(java.lang.String, int[], int[]);\n Code:\n 0: aload_0\n 1: ldc #54 // String S\n 3: invokestatic #60 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #62 // String P\n 9: invokestatic #60 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_2\n 13: ldc #64 // String Q\n 15: invokestatic #60 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload_0\n 19: bipush 65\n 21: invokestatic #68 // Method genomicRangeQuery$generateDeltaList:(Ljava/lang/String;C)[I\n 24: astore_3\n 25: aload_0\n 26: bipush 67\n 28: invokestatic #68 // Method genomicRangeQuery$generateDeltaList:(Ljava/lang/String;C)[I\n 31: astore 4\n 33: aload_0\n 34: bipush 71\n 36: invokestatic #68 // Method genomicRangeQuery$generateDeltaList:(Ljava/lang/String;C)[I\n 39: astore 5\n 41: aload_1\n 42: invokestatic #74 // Method kotlin/collections/ArraysKt.getIndices:([I)Lkotlin/ranges/IntRange;\n 45: checkcast #14 // class java/lang/Iterable\n 48: astore 6\n 50: iconst_0\n 51: istore 7\n 53: aload 6\n 55: astore 8\n 57: new #76 // class java/util/ArrayList\n 60: dup\n 61: aload 6\n 63: bipush 10\n 65: invokestatic #82 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 68: invokespecial #85 // Method java/util/ArrayList.\"<init>\":(I)V\n 71: checkcast #87 // class java/util/Collection\n 74: astore 9\n 76: iconst_0\n 77: istore 10\n 79: aload 8\n 81: invokeinterface #18, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 86: astore 11\n 88: aload 11\n 90: invokeinterface #24, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 95: ifeq 173\n 98: aload 11\n 100: checkcast #89 // class kotlin/collections/IntIterator\n 103: invokevirtual #92 // Method kotlin/collections/IntIterator.nextInt:()I\n 106: istore 12\n 108: aload 9\n 110: iload 12\n 112: istore 13\n 114: astore 15\n 116: iconst_0\n 117: istore 14\n 119: aload_0\n 120: aload_1\n 121: iload 13\n 123: iaload\n 124: aload_2\n 125: iload 13\n 127: iaload\n 128: iconst_1\n 129: iadd\n 130: invokevirtual #98 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 133: dup\n 134: ldc #100 // String substring(...)\n 136: invokestatic #103 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 139: aload_0\n 140: aload_3\n 141: aload 4\n 143: aload 5\n 145: aload_1\n 146: iload 13\n 148: iaload\n 149: aload_2\n 150: iload 13\n 152: iaload\n 153: iconst_1\n 154: iadd\n 155: invokestatic #107 // Method genomicRangeQuery$findMinValue:(Ljava/lang/String;Ljava/lang/String;[I[I[III)I\n 158: invokestatic #111 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 161: aload 15\n 163: swap\n 164: invokeinterface #115, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 169: pop\n 170: goto 88\n 173: aload 9\n 175: checkcast #117 // class java/util/List\n 178: nop\n 179: checkcast #87 // class java/util/Collection\n 182: invokestatic #121 // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I\n 185: areturn\n\n public static final int passingCars(int[]);\n Code:\n 0: aload_0\n 1: ldc #138 // String A\n 3: invokestatic #60 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: arraylength\n 8: newarray int\n 10: astore_1\n 11: aload_0\n 12: astore_2\n 13: iconst_0\n 14: istore_3\n 15: iconst_0\n 16: istore 4\n 18: iconst_0\n 19: istore 5\n 21: iload_3\n 22: istore 6\n 24: iconst_0\n 25: istore 7\n 27: aload_2\n 28: arraylength\n 29: istore 8\n 31: iload 7\n 33: iload 8\n 35: if_icmpge 84\n 38: aload_2\n 39: iload 7\n 41: iaload\n 42: istore 9\n 44: iload 5\n 46: iinc 5, 1\n 49: iload 6\n 51: iload 9\n 53: istore 10\n 55: istore 11\n 57: istore 12\n 59: iconst_0\n 60: istore 13\n 62: aload_1\n 63: iload 12\n 65: iload 11\n 67: iload 10\n 69: iadd\n 70: iastore\n 71: iload 11\n 73: iload 10\n 75: iadd\n 76: istore 6\n 78: iinc 7, 1\n 81: goto 31\n 84: nop\n 85: aload_1\n 86: aload_0\n 87: arraylength\n 88: iconst_1\n 89: isub\n 90: iaload\n 91: istore_2\n 92: iconst_0\n 93: istore_3\n 94: aload_1\n 95: astore 4\n 97: iconst_0\n 98: istore 5\n 100: iconst_0\n 101: istore 6\n 103: iconst_0\n 104: istore 7\n 106: aload 4\n 108: arraylength\n 109: istore 8\n 111: iload 7\n 113: iload 8\n 115: if_icmpge 175\n 118: aload 4\n 120: iload 7\n 122: iaload\n 123: istore 9\n 125: iload 6\n 127: iinc 6, 1\n 130: iload 9\n 132: istore 10\n 134: istore 11\n 136: iconst_0\n 137: istore 12\n 139: aload_0\n 140: iload 11\n 142: iaload\n 143: iconst_1\n 144: if_icmpeq 168\n 147: iload_3\n 148: iload_2\n 149: iadd\n 150: iload 10\n 152: isub\n 153: ldc #139 // int 1000000000\n 155: if_icmple 160\n 158: iconst_m1\n 159: ireturn\n 160: iload_3\n 161: iload_2\n 162: iload 10\n 164: isub\n 165: iadd\n 166: istore_3\n 167: nop\n 168: nop\n 169: iinc 7, 1\n 172: goto 111\n 175: nop\n 176: iload_3\n 177: ireturn\n\n private static final int[] genomicRangeQuery$generateDeltaList(java.lang.String, char);\n Code:\n 0: aload_0\n 1: invokevirtual #158 // Method java/lang/String.length:()I\n 4: iconst_1\n 5: iadd\n 6: newarray int\n 8: astore_2\n 9: new #8 // class kotlin/ranges/IntRange\n 12: dup\n 13: iconst_0\n 14: aload_0\n 15: invokevirtual #158 // Method java/lang/String.length:()I\n 18: invokespecial #12 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 21: checkcast #14 // class java/lang/Iterable\n 24: astore_3\n 25: iconst_0\n 26: istore 4\n 28: iconst_0\n 29: istore 5\n 31: iload 4\n 33: istore 6\n 35: aload_3\n 36: invokeinterface #18, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 7\n 43: aload 7\n 45: invokeinterface #24, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 116\n 53: aload 7\n 55: checkcast #89 // class kotlin/collections/IntIterator\n 58: invokevirtual #92 // Method kotlin/collections/IntIterator.nextInt:()I\n 61: istore 8\n 63: iload 6\n 65: iload 8\n 67: istore 9\n 69: istore 10\n 71: iconst_0\n 72: istore 11\n 74: aload_2\n 75: iload 9\n 77: iload 10\n 79: iastore\n 80: iload 9\n 82: aload_0\n 83: invokevirtual #158 // Method java/lang/String.length:()I\n 86: if_icmpne 93\n 89: iconst_0\n 90: goto 111\n 93: iload 10\n 95: aload_0\n 96: iload 9\n 98: invokevirtual #162 // Method java/lang/String.charAt:(I)C\n 101: iload_1\n 102: if_icmpne 109\n 105: iconst_1\n 106: goto 110\n 109: iconst_0\n 110: iadd\n 111: istore 6\n 113: goto 43\n 116: nop\n 117: aload_2\n 118: areturn\n\n private static final int genomicRangeQuery$findMinValue(java.lang.String, java.lang.String, int[], int[], int[], int, int);\n Code:\n 0: iload 5\n 2: iload 6\n 4: if_icmpne 62\n 7: aload_1\n 8: iload 5\n 10: invokevirtual #162 // Method java/lang/String.charAt:(I)C\n 13: lookupswitch { // 3\n 65: 48\n 67: 52\n 71: 56\n default: 60\n }\n 48: iconst_1\n 49: goto 61\n 52: iconst_2\n 53: goto 61\n 56: iconst_3\n 57: goto 61\n 60: iconst_4\n 61: ireturn\n 62: aload_2\n 63: iload 5\n 65: iaload\n 66: aload_2\n 67: iload 6\n 69: iaload\n 70: if_icmpeq 75\n 73: iconst_1\n 74: ireturn\n 75: aload_3\n 76: iload 5\n 78: iaload\n 79: aload_3\n 80: iload 6\n 82: iaload\n 83: if_icmpeq 88\n 86: iconst_2\n 87: ireturn\n 88: aload 4\n 90: iload 5\n 92: iaload\n 93: aload 4\n 95: iload 6\n 97: iaload\n 98: if_icmpeq 103\n 101: iconst_3\n 102: ireturn\n 103: iconst_4\n 104: ireturn\n}\n", "javap_err": "" } ]
rogerkeays__vimcash__f6a1c67/vimcash.kt
//usr/bin/env [ $0 -nt $0.jar ] && kotlinc -d $0.jar $0; [ $0.jar -nt $0 ] && kotlin -cp $0.jar VimcashKt $@; exit 0 import java.io.File fun String.parseAmount(account: String): Double { return substring(22, 34).toDouble() * if (indexOf(" $account ") > 34) -1 else 1 } fun File.calculateBalance(account: String, currency: String): Double { val filterRegex = Regex(".{15}\\| $currency [0-9. ]+[^ ]* $account .*") return readLines() .filter { it.matches(filterRegex) } .map { it.parseAmount(account) } .sum() } fun File.calculateBalances(account: String): Map<String, Double> { val filterRegex = Regex(".{15}\\| ... [0-9. ]+[^ ]* $account .*") val results = mutableMapOf<String, Double>() readLines() .filter { it.matches(filterRegex) } .forEach { val currency = it.slice(18..20) val amount = it.parseAmount(account) results.put(currency, results.get(currency)?.plus(amount) ?: amount) } return results } fun File.collectAccounts(): Set<String> { return readLines() .flatMap { it.substring(34, 52).split(' ') } .toSortedSet() } fun File.reportBalances() { collectAccounts() .filter { it.matches(allCapsRegex) } .associate { Pair(it, calculateBalances(it).filter { it.value.abs() > 0.005 }) } .filter { it.value.size > 0 } .forEach { println(it) } } val allCapsRegex = Regex("[0-9A-Z]+") fun Double.abs(): Double = kotlin.math.abs(this)
[ { "class_path": "rogerkeays__vimcash__f6a1c67/VimcashKt.class", "javap": "Compiled from \"vimcash.kt\"\npublic final class VimcashKt {\n private static final kotlin.text.Regex allCapsRegex;\n\n public static final double parseAmount(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #9 // String <this>\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #17 // String account\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: bipush 22\n 15: bipush 34\n 17: invokevirtual #23 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 20: dup\n 21: ldc #25 // String substring(...)\n 23: invokestatic #28 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 26: invokestatic #34 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D\n 29: aload_0\n 30: checkcast #36 // class java/lang/CharSequence\n 33: new #38 // class java/lang/StringBuilder\n 36: dup\n 37: invokespecial #42 // Method java/lang/StringBuilder.\"<init>\":()V\n 40: bipush 32\n 42: invokevirtual #46 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 45: aload_1\n 46: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 49: bipush 32\n 51: invokevirtual #46 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 54: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 57: iconst_0\n 58: iconst_0\n 59: bipush 6\n 61: aconst_null\n 62: invokestatic #59 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 65: bipush 34\n 67: if_icmple 74\n 70: iconst_m1\n 71: goto 75\n 74: iconst_1\n 75: i2d\n 76: dmul\n 77: dreturn\n\n public static final double calculateBalance(java.io.File, java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #9 // String <this>\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #17 // String account\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_2\n 13: ldc #65 // String currency\n 15: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: new #67 // class kotlin/text/Regex\n 21: dup\n 22: new #38 // class java/lang/StringBuilder\n 25: dup\n 26: invokespecial #42 // Method java/lang/StringBuilder.\"<init>\":()V\n 29: ldc #69 // String .{15}\\\\|\n 31: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 34: aload_2\n 35: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 38: ldc #71 // String [0-9. ]+[^ ]*\n 40: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 43: aload_1\n 44: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 47: ldc #73 // String .*\n 49: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 52: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 55: invokespecial #76 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 58: astore_3\n 59: aload_0\n 60: aconst_null\n 61: iconst_1\n 62: aconst_null\n 63: invokestatic #82 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 66: checkcast #84 // class java/lang/Iterable\n 69: astore 4\n 71: nop\n 72: iconst_0\n 73: istore 5\n 75: aload 4\n 77: astore 6\n 79: new #86 // class java/util/ArrayList\n 82: dup\n 83: invokespecial #87 // Method java/util/ArrayList.\"<init>\":()V\n 86: checkcast #89 // class java/util/Collection\n 89: astore 7\n 91: iconst_0\n 92: istore 8\n 94: aload 6\n 96: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 101: astore 9\n 103: aload 9\n 105: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 110: ifeq 159\n 113: aload 9\n 115: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 120: astore 10\n 122: aload 10\n 124: checkcast #19 // class java/lang/String\n 127: astore 11\n 129: iconst_0\n 130: istore 12\n 132: aload 11\n 134: checkcast #36 // class java/lang/CharSequence\n 137: aload_3\n 138: swap\n 139: invokevirtual #107 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 142: nop\n 143: ifeq 103\n 146: aload 7\n 148: aload 10\n 150: invokeinterface #111, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 155: pop\n 156: goto 103\n 159: aload 7\n 161: checkcast #113 // class java/util/List\n 164: nop\n 165: checkcast #84 // class java/lang/Iterable\n 168: astore 4\n 170: nop\n 171: iconst_0\n 172: istore 5\n 174: aload 4\n 176: astore 6\n 178: new #86 // class java/util/ArrayList\n 181: dup\n 182: aload 4\n 184: bipush 10\n 186: invokestatic #119 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 189: invokespecial #122 // Method java/util/ArrayList.\"<init>\":(I)V\n 192: checkcast #89 // class java/util/Collection\n 195: astore 7\n 197: iconst_0\n 198: istore 8\n 200: aload 6\n 202: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 207: astore 9\n 209: aload 9\n 211: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 216: ifeq 263\n 219: aload 9\n 221: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 226: astore 10\n 228: aload 7\n 230: aload 10\n 232: checkcast #19 // class java/lang/String\n 235: astore 11\n 237: astore 13\n 239: iconst_0\n 240: istore 12\n 242: aload 11\n 244: aload_1\n 245: invokestatic #124 // Method parseAmount:(Ljava/lang/String;Ljava/lang/String;)D\n 248: invokestatic #128 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 251: aload 13\n 253: swap\n 254: invokeinterface #111, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 259: pop\n 260: goto 209\n 263: aload 7\n 265: checkcast #113 // class java/util/List\n 268: nop\n 269: checkcast #84 // class java/lang/Iterable\n 272: invokestatic #132 // Method kotlin/collections/CollectionsKt.sumOfDouble:(Ljava/lang/Iterable;)D\n 275: dreturn\n\n public static final java.util.Map<java.lang.String, java.lang.Double> calculateBalances(java.io.File, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #9 // String <this>\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #17 // String account\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #67 // class kotlin/text/Regex\n 15: dup\n 16: new #38 // class java/lang/StringBuilder\n 19: dup\n 20: invokespecial #42 // Method java/lang/StringBuilder.\"<init>\":()V\n 23: ldc #161 // String .{15}\\\\| ... [0-9. ]+[^ ]*\n 25: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 28: aload_1\n 29: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 32: ldc #73 // String .*\n 34: invokevirtual #49 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 37: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 40: invokespecial #76 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 43: astore_2\n 44: new #163 // class java/util/LinkedHashMap\n 47: dup\n 48: invokespecial #164 // Method java/util/LinkedHashMap.\"<init>\":()V\n 51: checkcast #166 // class java/util/Map\n 54: astore_3\n 55: aload_0\n 56: aconst_null\n 57: iconst_1\n 58: aconst_null\n 59: invokestatic #82 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 62: checkcast #84 // class java/lang/Iterable\n 65: astore 4\n 67: nop\n 68: iconst_0\n 69: istore 5\n 71: aload 4\n 73: astore 6\n 75: new #86 // class java/util/ArrayList\n 78: dup\n 79: invokespecial #87 // Method java/util/ArrayList.\"<init>\":()V\n 82: checkcast #89 // class java/util/Collection\n 85: astore 7\n 87: iconst_0\n 88: istore 8\n 90: aload 6\n 92: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 97: astore 9\n 99: aload 9\n 101: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 106: ifeq 155\n 109: aload 9\n 111: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 116: astore 10\n 118: aload 10\n 120: checkcast #19 // class java/lang/String\n 123: astore 11\n 125: iconst_0\n 126: istore 12\n 128: aload 11\n 130: checkcast #36 // class java/lang/CharSequence\n 133: aload_2\n 134: swap\n 135: invokevirtual #107 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 138: nop\n 139: ifeq 99\n 142: aload 7\n 144: aload 10\n 146: invokeinterface #111, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 151: pop\n 152: goto 99\n 155: aload 7\n 157: checkcast #113 // class java/util/List\n 160: nop\n 161: checkcast #84 // class java/lang/Iterable\n 164: astore 4\n 166: nop\n 167: iconst_0\n 168: istore 5\n 170: aload 4\n 172: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 177: astore 6\n 179: aload 6\n 181: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 186: ifeq 278\n 189: aload 6\n 191: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 196: astore 7\n 198: aload 7\n 200: checkcast #19 // class java/lang/String\n 203: astore 8\n 205: iconst_0\n 206: istore 9\n 208: aload 8\n 210: new #168 // class kotlin/ranges/IntRange\n 213: dup\n 214: bipush 18\n 216: bipush 20\n 218: invokespecial #171 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 221: invokestatic #175 // Method kotlin/text/StringsKt.slice:(Ljava/lang/String;Lkotlin/ranges/IntRange;)Ljava/lang/String;\n 224: astore 10\n 226: aload 8\n 228: aload_1\n 229: invokestatic #124 // Method parseAmount:(Ljava/lang/String;Ljava/lang/String;)D\n 232: dstore 11\n 234: aload_3\n 235: aload 10\n 237: aload_3\n 238: aload 10\n 240: invokeinterface #179, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 245: checkcast #30 // class java/lang/Double\n 248: dup\n 249: ifnull 261\n 252: invokevirtual #183 // Method java/lang/Double.doubleValue:()D\n 255: dload 11\n 257: dadd\n 258: goto 264\n 261: pop\n 262: dload 11\n 264: invokestatic #128 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 267: invokeinterface #187, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 272: pop\n 273: nop\n 274: nop\n 275: goto 179\n 278: nop\n 279: aload_3\n 280: areturn\n\n public static final java.util.Set<java.lang.String> collectAccounts(java.io.File);\n Code:\n 0: aload_0\n 1: ldc #9 // String <this>\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aconst_null\n 8: iconst_1\n 9: aconst_null\n 10: invokestatic #82 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 13: checkcast #84 // class java/lang/Iterable\n 16: astore_1\n 17: nop\n 18: iconst_0\n 19: istore_2\n 20: aload_1\n 21: astore_3\n 22: new #86 // class java/util/ArrayList\n 25: dup\n 26: invokespecial #87 // Method java/util/ArrayList.\"<init>\":()V\n 29: checkcast #89 // class java/util/Collection\n 32: astore 4\n 34: iconst_0\n 35: istore 5\n 37: aload_3\n 38: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 6\n 45: aload 6\n 47: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 129\n 55: aload 6\n 57: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 7\n 64: aload 7\n 66: checkcast #19 // class java/lang/String\n 69: astore 8\n 71: iconst_0\n 72: istore 9\n 74: aload 8\n 76: bipush 34\n 78: bipush 52\n 80: invokevirtual #23 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 83: dup\n 84: ldc #25 // String substring(...)\n 86: invokestatic #28 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 89: checkcast #36 // class java/lang/CharSequence\n 92: iconst_1\n 93: newarray char\n 95: astore 10\n 97: aload 10\n 99: iconst_0\n 100: bipush 32\n 102: castore\n 103: aload 10\n 105: iconst_0\n 106: iconst_0\n 107: bipush 6\n 109: aconst_null\n 110: invokestatic #204 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;\n 113: checkcast #84 // class java/lang/Iterable\n 116: astore 8\n 118: aload 4\n 120: aload 8\n 122: invokestatic #208 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 125: pop\n 126: goto 45\n 129: aload 4\n 131: checkcast #113 // class java/util/List\n 134: nop\n 135: checkcast #84 // class java/lang/Iterable\n 138: invokestatic #212 // Method kotlin/collections/CollectionsKt.toSortedSet:(Ljava/lang/Iterable;)Ljava/util/SortedSet;\n 141: checkcast #214 // class java/util/Set\n 144: areturn\n\n public static final void reportBalances(java.io.File);\n Code:\n 0: aload_0\n 1: ldc #9 // String <this>\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #225 // Method collectAccounts:(Ljava/io/File;)Ljava/util/Set;\n 10: checkcast #84 // class java/lang/Iterable\n 13: astore_1\n 14: nop\n 15: iconst_0\n 16: istore_2\n 17: aload_1\n 18: astore_3\n 19: new #86 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #87 // Method java/util/ArrayList.\"<init>\":()V\n 26: checkcast #89 // class java/util/Collection\n 29: astore 4\n 31: iconst_0\n 32: istore 5\n 34: aload_3\n 35: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 40: astore 6\n 42: aload 6\n 44: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 49: ifeq 100\n 52: aload 6\n 54: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 59: astore 7\n 61: aload 7\n 63: checkcast #19 // class java/lang/String\n 66: astore 8\n 68: iconst_0\n 69: istore 9\n 71: aload 8\n 73: checkcast #36 // class java/lang/CharSequence\n 76: getstatic #228 // Field allCapsRegex:Lkotlin/text/Regex;\n 79: swap\n 80: invokevirtual #107 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 83: nop\n 84: ifeq 42\n 87: aload 4\n 89: aload 7\n 91: invokeinterface #111, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 96: pop\n 97: goto 42\n 100: aload 4\n 102: checkcast #113 // class java/util/List\n 105: nop\n 106: checkcast #84 // class java/lang/Iterable\n 109: astore_1\n 110: nop\n 111: iconst_0\n 112: istore_2\n 113: aload_1\n 114: bipush 10\n 116: invokestatic #119 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 119: invokestatic #234 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 122: bipush 16\n 124: invokestatic #240 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 127: istore_3\n 128: aload_1\n 129: astore 4\n 131: new #163 // class java/util/LinkedHashMap\n 134: dup\n 135: iload_3\n 136: invokespecial #241 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 139: checkcast #166 // class java/util/Map\n 142: astore 5\n 144: iconst_0\n 145: istore 6\n 147: aload 4\n 149: invokeinterface #93, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 154: astore 7\n 156: aload 7\n 158: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 163: ifeq 366\n 166: aload 7\n 168: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 173: astore 8\n 175: aload 5\n 177: astore 9\n 179: aload 8\n 181: checkcast #19 // class java/lang/String\n 184: astore 10\n 186: iconst_0\n 187: istore 11\n 189: aload 10\n 191: aload_0\n 192: aload 10\n 194: invokestatic #243 // Method calculateBalances:(Ljava/io/File;Ljava/lang/String;)Ljava/util/Map;\n 197: astore 12\n 199: astore 13\n 201: iconst_0\n 202: istore 14\n 204: aload 12\n 206: astore 15\n 208: new #163 // class java/util/LinkedHashMap\n 211: dup\n 212: invokespecial #164 // Method java/util/LinkedHashMap.\"<init>\":()V\n 215: checkcast #166 // class java/util/Map\n 218: astore 16\n 220: iconst_0\n 221: istore 17\n 223: aload 15\n 225: invokeinterface #247, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 230: invokeinterface #248, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 235: astore 18\n 237: aload 18\n 239: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 244: ifeq 322\n 247: aload 18\n 249: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 254: checkcast #250 // class java/util/Map$Entry\n 257: astore 19\n 259: aload 19\n 261: astore 20\n 263: iconst_0\n 264: istore 21\n 266: aload 20\n 268: invokeinterface #253, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 273: checkcast #255 // class java/lang/Number\n 276: invokevirtual #256 // Method java/lang/Number.doubleValue:()D\n 279: invokestatic #260 // Method abs:(D)D\n 282: ldc2_w #261 // double 0.005d\n 285: dcmpl\n 286: ifle 293\n 289: iconst_1\n 290: goto 294\n 293: iconst_0\n 294: ifeq 237\n 297: aload 16\n 299: aload 19\n 301: invokeinterface #265, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 306: aload 19\n 308: invokeinterface #253, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 313: invokeinterface #187, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 318: pop\n 319: goto 237\n 322: aload 16\n 324: nop\n 325: aload 13\n 327: swap\n 328: astore 22\n 330: astore 23\n 332: new #267 // class kotlin/Pair\n 335: dup\n 336: aload 23\n 338: aload 22\n 340: invokespecial #270 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 343: astore 10\n 345: aload 9\n 347: aload 10\n 349: invokevirtual #273 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 352: aload 10\n 354: invokevirtual #276 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 357: invokeinterface #187, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 362: pop\n 363: goto 156\n 366: aload 5\n 368: nop\n 369: astore_1\n 370: nop\n 371: iconst_0\n 372: istore_2\n 373: aload_1\n 374: astore_3\n 375: new #163 // class java/util/LinkedHashMap\n 378: dup\n 379: invokespecial #164 // Method java/util/LinkedHashMap.\"<init>\":()V\n 382: checkcast #166 // class java/util/Map\n 385: astore 4\n 387: iconst_0\n 388: istore 5\n 390: aload_3\n 391: invokeinterface #247, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 396: invokeinterface #248, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 401: astore 6\n 403: aload 6\n 405: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 410: ifeq 483\n 413: aload 6\n 415: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 420: checkcast #250 // class java/util/Map$Entry\n 423: astore 7\n 425: aload 7\n 427: astore 8\n 429: iconst_0\n 430: istore 9\n 432: aload 8\n 434: invokeinterface #253, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 439: checkcast #166 // class java/util/Map\n 442: invokeinterface #280, 1 // InterfaceMethod java/util/Map.size:()I\n 447: ifle 454\n 450: iconst_1\n 451: goto 455\n 454: iconst_0\n 455: ifeq 403\n 458: aload 4\n 460: aload 7\n 462: invokeinterface #265, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 467: aload 7\n 469: invokeinterface #253, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 474: invokeinterface #187, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 479: pop\n 480: goto 403\n 483: aload 4\n 485: nop\n 486: astore_1\n 487: nop\n 488: iconst_0\n 489: istore_2\n 490: aload_1\n 491: invokeinterface #247, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 496: invokeinterface #248, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 501: astore_3\n 502: aload_3\n 503: invokeinterface #99, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 508: ifeq 542\n 511: aload_3\n 512: invokeinterface #103, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 517: checkcast #250 // class java/util/Map$Entry\n 520: astore 4\n 522: aload 4\n 524: astore 5\n 526: iconst_0\n 527: istore 6\n 529: getstatic #286 // Field java/lang/System.out:Ljava/io/PrintStream;\n 532: aload 5\n 534: invokevirtual #292 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 537: nop\n 538: nop\n 539: goto 502\n 542: nop\n 543: return\n\n public static final kotlin.text.Regex getAllCapsRegex();\n Code:\n 0: getstatic #228 // Field allCapsRegex:Lkotlin/text/Regex;\n 3: areturn\n\n public static final double abs(double);\n Code:\n 0: dload_0\n 1: invokestatic #309 // Method java/lang/Math.abs:(D)D\n 4: dreturn\n\n static {};\n Code:\n 0: new #67 // class kotlin/text/Regex\n 3: dup\n 4: ldc_w #313 // String [0-9A-Z]+\n 7: invokespecial #76 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 10: putstatic #228 // Field allCapsRegex:Lkotlin/text/Regex;\n 13: return\n}\n", "javap_err": "" } ]
GitProger__Alferov-Lyceum-PTHS__cb1cd6d/client/logistics.kt
import java.io.InputStreamReader import java.net.URL import java.util.* import kotlin.math.absoluteValue import java.io.File data class Kettle(val id: Int, val room: String, var boilTime: Long, var ml: Int) var room = "1" var ml = 200 private const val MILLIES_IN_DAY = 86_400_000 private val start = "http://192.168.43.217:1000/" //File("ip.txt").readLines()[0] private fun query(query: String): List<String> { val url = URL(start + query) return InputStreamReader(url.openConnection().getInputStream()).readLines() } private fun ask() = query("ask.php").map { it.toKettle() } fun update(id: Int, boilTime: Long, ml: Int): List<String> { val query = "boil.php?id=$id&boil_time=$boilTime&ml=$ml" return query(query) } fun add(room: String) = query("add.php?room=$room").first().toInt() fun delete(id: Int) = query("remove.php?id=$id") fun byId(id: Int) = query("by_id.php?id=$id").first().toKettle() var graph: TreeMap<String, TreeMap<String, Int>>? = null private fun getMap() { if (graph == null) { graph = TreeMap<String, TreeMap<String, Int>>() val query = query("map.php") query.forEach { val (u, v, dist) = it.split(' ') graph!![u] = graph!!.getOrDefault(u, TreeMap<String, Int>()) graph!![v] = graph!!.getOrDefault(v, TreeMap<String, Int>()) graph!![u]!![v] = dist.toInt() graph!![v]!![u] = dist.toInt() } } } fun String.toKettle(): Kettle { val (id, room, boilTime, ml) = split(' ') return Kettle(id.toInt(), room, boilTime.toLong(), ml.toInt()) } fun updateAllKettles() = ask() fun nearKettles(currentRoom: String, ml: Int, currentTime: Long): List<Pair<Kettle, Int>> { getMap() val distance = TreeMap<String, Int>() //distance from currentRoom, calculated using Dijkstra algorithm distance[currentRoom] = 0 val dijkstra = TreeSet<String> { s1, s2 -> distance.getOrDefault(s1, Int.MAX_VALUE) - distance.getOrDefault(s2, Int.MAX_VALUE) } dijkstra.add(currentRoom) while (dijkstra.isNotEmpty()) { val cur = dijkstra.first() //nearest that's not processed yet dijkstra.remove(cur) for ((next, dist) in (graph!![cur] ?: TreeMap<String, Int>())) { if (distance.getOrDefault(next, Int.MAX_VALUE) > distance[cur]!! + dist) { dijkstra.remove(next) distance[next] = distance[cur]!! + dist dijkstra.add(next) } } } val candidates = ask().filter { it.ml >= ml } .sortedWith(compareByDescending<Kettle> { it.boilTime.coerceAtMost(currentTime) }.thenBy { distance[it.room]!! }) var currentBestDistance = Int.MAX_VALUE val optimums = mutableListOf<Pair<Kettle, Int>>() for (kettle in candidates) { if (currentBestDistance > distance.getOrDefault(kettle.room, Int.MAX_VALUE)) { optimums.add(kettle to distance[kettle.room]!!) currentBestDistance = distance[kettle.room]!! } } return optimums.filter { (kettle, _) -> (kettle.boilTime - System.currentTimeMillis()).absoluteValue < MILLIES_IN_DAY } } fun boilKettle(id: Int, volume: Int) { val boilingTime = (180L * 1000L * volume) / 1000L update(id, System.currentTimeMillis() + boilingTime, volume) } fun drink(id: Int, volumeRemaining: Int) = update(id, byId(id).boilTime, volumeRemaining)
[ { "class_path": "GitProger__Alferov-Lyceum-PTHS__cb1cd6d/LogisticsKt$nearKettles$$inlined$thenBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class LogisticsKt$nearKettles$$inlined$thenBy$1<T> implements java.util.Comparator {\n final java.util.Comparator $this_thenBy;\n\n final java.util.TreeMap $distance$inlined;\n\n public LogisticsKt$nearKettles$$inlined$thenBy$1(java.util.Comparator, java.util.TreeMap);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #20 // Field $this_thenBy:Ljava/util/Comparator;\n 5: aload_0\n 6: aload_2\n 7: putfield #22 // Field $distance$inlined:Ljava/util/TreeMap;\n 10: aload_0\n 11: invokespecial #25 // Method java/lang/Object.\"<init>\":()V\n 14: return\n\n public final int compare(T, T);\n Code:\n 0: aload_0\n 1: getfield #20 // Field $this_thenBy:Ljava/util/Comparator;\n 4: aload_1\n 5: aload_2\n 6: invokeinterface #33, 3 // InterfaceMethod java/util/Comparator.compare:(Ljava/lang/Object;Ljava/lang/Object;)I\n 11: istore_3\n 12: iload_3\n 13: ifeq 20\n 16: iload_3\n 17: goto 84\n 20: aload_1\n 21: checkcast #35 // class Kettle\n 24: astore 4\n 26: iconst_0\n 27: istore 5\n 29: aload_0\n 30: getfield #22 // Field $distance$inlined:Ljava/util/TreeMap;\n 33: aload 4\n 35: invokevirtual #39 // Method Kettle.getRoom:()Ljava/lang/String;\n 38: invokevirtual #45 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 41: dup\n 42: invokestatic #51 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 45: checkcast #53 // class java/lang/Comparable\n 48: aload_2\n 49: checkcast #35 // class Kettle\n 52: astore 4\n 54: astore 6\n 56: iconst_0\n 57: istore 5\n 59: aload_0\n 60: getfield #22 // Field $distance$inlined:Ljava/util/TreeMap;\n 63: aload 4\n 65: invokevirtual #39 // Method Kettle.getRoom:()Ljava/lang/String;\n 68: invokevirtual #45 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 71: dup\n 72: invokestatic #51 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 75: checkcast #53 // class java/lang/Comparable\n 78: aload 6\n 80: swap\n 81: invokestatic #59 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 84: ireturn\n}\n", "javap_err": "" }, { "class_path": "GitProger__Alferov-Lyceum-PTHS__cb1cd6d/LogisticsKt.class", "javap": "Compiled from \"logistics.kt\"\npublic final class LogisticsKt {\n private static java.lang.String room;\n\n private static int ml;\n\n private static final int MILLIES_IN_DAY;\n\n private static final java.lang.String start;\n\n private static java.util.TreeMap<java.lang.String, java.util.TreeMap<java.lang.String, java.lang.Integer>> graph;\n\n public static final java.lang.String getRoom();\n Code:\n 0: getstatic #11 // Field room:Ljava/lang/String;\n 3: areturn\n\n public static final void setRoom(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #15 // String <set-?>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: putstatic #11 // Field room:Ljava/lang/String;\n 10: return\n\n public static final int getMl();\n Code:\n 0: getstatic #27 // Field ml:I\n 3: ireturn\n\n public static final void setMl(int);\n Code:\n 0: iload_0\n 1: putstatic #27 // Field ml:I\n 4: return\n\n private static final java.util.List<java.lang.String> query(java.lang.String);\n Code:\n 0: new #34 // class java/net/URL\n 3: dup\n 4: new #36 // class java/lang/StringBuilder\n 7: dup\n 8: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 11: getstatic #43 // Field start:Ljava/lang/String;\n 14: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 17: aload_0\n 18: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 21: invokevirtual #50 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 24: invokespecial #52 // Method java/net/URL.\"<init>\":(Ljava/lang/String;)V\n 27: astore_1\n 28: new #54 // class java/io/InputStreamReader\n 31: dup\n 32: aload_1\n 33: invokevirtual #58 // Method java/net/URL.openConnection:()Ljava/net/URLConnection;\n 36: invokevirtual #64 // Method java/net/URLConnection.getInputStream:()Ljava/io/InputStream;\n 39: invokespecial #67 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;)V\n 42: checkcast #69 // class java/io/Reader\n 45: invokestatic #75 // Method kotlin/io/TextStreamsKt.readLines:(Ljava/io/Reader;)Ljava/util/List;\n 48: areturn\n\n private static final java.util.List<Kettle> ask();\n Code:\n 0: ldc #82 // String ask.php\n 2: invokestatic #84 // Method query:(Ljava/lang/String;)Ljava/util/List;\n 5: checkcast #86 // class java/lang/Iterable\n 8: astore_0\n 9: iconst_0\n 10: istore_1\n 11: aload_0\n 12: astore_2\n 13: new #88 // class java/util/ArrayList\n 16: dup\n 17: aload_0\n 18: bipush 10\n 20: invokestatic #94 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 23: invokespecial #96 // Method java/util/ArrayList.\"<init>\":(I)V\n 26: checkcast #98 // class java/util/Collection\n 29: astore_3\n 30: iconst_0\n 31: istore 4\n 33: aload_2\n 34: invokeinterface #102, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 39: astore 5\n 41: aload 5\n 43: invokeinterface #108, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 48: ifeq 90\n 51: aload 5\n 53: invokeinterface #112, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 58: astore 6\n 60: aload_3\n 61: aload 6\n 63: checkcast #114 // class java/lang/String\n 66: astore 7\n 68: astore 9\n 70: iconst_0\n 71: istore 8\n 73: aload 7\n 75: invokestatic #118 // Method toKettle:(Ljava/lang/String;)LKettle;\n 78: aload 9\n 80: swap\n 81: invokeinterface #122, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 86: pop\n 87: goto 41\n 90: aload_3\n 91: checkcast #124 // class java/util/List\n 94: nop\n 95: areturn\n\n public static final java.util.List<java.lang.String> update(int, long, int);\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #140 // String boil.php?id=\n 9: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: iload_0\n 13: invokevirtual #143 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 16: ldc #145 // String &boil_time=\n 18: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 21: lload_1\n 22: invokevirtual #148 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 25: ldc #150 // String &ml=\n 27: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 30: iload_3\n 31: invokevirtual #143 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 34: invokevirtual #50 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 37: astore 4\n 39: aload 4\n 41: invokestatic #84 // Method query:(Ljava/lang/String;)Ljava/util/List;\n 44: areturn\n\n public static final int add(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #155 // String room\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #36 // class java/lang/StringBuilder\n 9: dup\n 10: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 13: ldc #157 // String add.php?room=\n 15: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 18: aload_0\n 19: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: invokevirtual #50 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 25: invokestatic #84 // Method query:(Ljava/lang/String;)Ljava/util/List;\n 28: invokestatic #161 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 31: checkcast #114 // class java/lang/String\n 34: invokestatic #166 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 37: ireturn\n\n public static final java.util.List<java.lang.String> delete(int);\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #171 // String remove.php?id=\n 9: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: iload_0\n 13: invokevirtual #143 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 16: invokevirtual #50 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 19: invokestatic #84 // Method query:(Ljava/lang/String;)Ljava/util/List;\n 22: areturn\n\n public static final Kettle byId(int);\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #175 // String by_id.php?id=\n 9: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: iload_0\n 13: invokevirtual #143 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 16: invokevirtual #50 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 19: invokestatic #84 // Method query:(Ljava/lang/String;)Ljava/util/List;\n 22: invokestatic #161 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 25: checkcast #114 // class java/lang/String\n 28: invokestatic #118 // Method toKettle:(Ljava/lang/String;)LKettle;\n 31: areturn\n\n public static final java.util.TreeMap<java.lang.String, java.util.TreeMap<java.lang.String, java.lang.Integer>> getGraph();\n Code:\n 0: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 3: areturn\n\n public static final void setGraph(java.util.TreeMap<java.lang.String, java.util.TreeMap<java.lang.String, java.lang.Integer>>);\n Code:\n 0: aload_0\n 1: putstatic #183 // Field graph:Ljava/util/TreeMap;\n 4: return\n\n private static final void getMap();\n Code:\n 0: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 3: ifnonnull 282\n 6: new #189 // class java/util/TreeMap\n 9: dup\n 10: invokespecial #190 // Method java/util/TreeMap.\"<init>\":()V\n 13: putstatic #183 // Field graph:Ljava/util/TreeMap;\n 16: ldc #192 // String map.php\n 18: invokestatic #84 // Method query:(Ljava/lang/String;)Ljava/util/List;\n 21: astore_0\n 22: aload_0\n 23: checkcast #86 // class java/lang/Iterable\n 26: astore_1\n 27: iconst_0\n 28: istore_2\n 29: aload_1\n 30: invokeinterface #102, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 35: astore_3\n 36: aload_3\n 37: invokeinterface #108, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 42: ifeq 281\n 45: aload_3\n 46: invokeinterface #112, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 51: astore 4\n 53: aload 4\n 55: checkcast #114 // class java/lang/String\n 58: astore 5\n 60: iconst_0\n 61: istore 6\n 63: aload 5\n 65: checkcast #194 // class java/lang/CharSequence\n 68: iconst_1\n 69: newarray char\n 71: astore 7\n 73: aload 7\n 75: iconst_0\n 76: bipush 32\n 78: castore\n 79: aload 7\n 81: iconst_0\n 82: iconst_0\n 83: bipush 6\n 85: aconst_null\n 86: invokestatic #200 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;\n 89: astore 8\n 91: aload 8\n 93: iconst_0\n 94: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 99: checkcast #114 // class java/lang/String\n 102: astore 7\n 104: aload 8\n 106: iconst_1\n 107: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 112: checkcast #114 // class java/lang/String\n 115: astore 9\n 117: aload 8\n 119: iconst_2\n 120: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 125: checkcast #114 // class java/lang/String\n 128: astore 10\n 130: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 133: dup\n 134: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 137: checkcast #210 // class java/util/Map\n 140: aload 7\n 142: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 145: dup\n 146: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 149: aload 7\n 151: new #189 // class java/util/TreeMap\n 154: dup\n 155: invokespecial #190 // Method java/util/TreeMap.\"<init>\":()V\n 158: invokevirtual #214 // Method java/util/TreeMap.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 161: invokeinterface #217, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 166: pop\n 167: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 170: dup\n 171: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 174: checkcast #210 // class java/util/Map\n 177: aload 9\n 179: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 182: dup\n 183: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 186: aload 9\n 188: new #189 // class java/util/TreeMap\n 191: dup\n 192: invokespecial #190 // Method java/util/TreeMap.\"<init>\":()V\n 195: invokevirtual #214 // Method java/util/TreeMap.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 198: invokeinterface #217, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 203: pop\n 204: nop\n 205: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 208: dup\n 209: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 212: aload 7\n 214: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 217: dup\n 218: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 221: checkcast #210 // class java/util/Map\n 224: aload 9\n 226: aload 10\n 228: invokestatic #166 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 231: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 234: invokeinterface #217, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 239: pop\n 240: nop\n 241: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 244: dup\n 245: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 248: aload 9\n 250: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 253: dup\n 254: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 257: checkcast #210 // class java/util/Map\n 260: aload 7\n 262: aload 10\n 264: invokestatic #166 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 267: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 270: invokeinterface #217, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 275: pop\n 276: nop\n 277: nop\n 278: goto 36\n 281: nop\n 282: return\n\n public static final Kettle toKettle(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #234 // String <this>\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #194 // class java/lang/CharSequence\n 10: iconst_1\n 11: newarray char\n 13: astore_2\n 14: aload_2\n 15: iconst_0\n 16: bipush 32\n 18: castore\n 19: aload_2\n 20: iconst_0\n 21: iconst_0\n 22: bipush 6\n 24: aconst_null\n 25: invokestatic #200 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;\n 28: astore_1\n 29: aload_1\n 30: iconst_0\n 31: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 36: checkcast #114 // class java/lang/String\n 39: astore_2\n 40: aload_1\n 41: iconst_1\n 42: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 47: checkcast #114 // class java/lang/String\n 50: astore_3\n 51: aload_1\n 52: iconst_2\n 53: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 58: checkcast #114 // class java/lang/String\n 61: astore 4\n 63: aload_1\n 64: iconst_3\n 65: invokeinterface #204, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 70: checkcast #114 // class java/lang/String\n 73: astore 5\n 75: new #236 // class Kettle\n 78: dup\n 79: aload_2\n 80: invokestatic #166 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 83: aload_3\n 84: aload 4\n 86: invokestatic #242 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 89: aload 5\n 91: invokestatic #166 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 94: invokespecial #245 // Method Kettle.\"<init>\":(ILjava/lang/String;JI)V\n 97: areturn\n\n public static final java.util.List<Kettle> updateAllKettles();\n Code:\n 0: invokestatic #249 // Method ask:()Ljava/util/List;\n 3: areturn\n\n public static final java.util.List<kotlin.Pair<Kettle, java.lang.Integer>> nearKettles(java.lang.String, int, long);\n Code:\n 0: aload_0\n 1: ldc #254 // String currentRoom\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: invokestatic #256 // Method getMap:()V\n 9: new #189 // class java/util/TreeMap\n 12: dup\n 13: invokespecial #190 // Method java/util/TreeMap.\"<init>\":()V\n 16: astore 4\n 18: aload 4\n 20: checkcast #210 // class java/util/Map\n 23: aload_0\n 24: iconst_0\n 25: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 28: invokeinterface #217, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 33: pop\n 34: new #258 // class java/util/TreeSet\n 37: dup\n 38: aload 4\n 40: invokedynamic #277, 0 // InvokeDynamic #0:invoke:(Ljava/util/TreeMap;)Lkotlin/jvm/functions/Function2;\n 45: invokedynamic #288, 0 // InvokeDynamic #1:compare:(Lkotlin/jvm/functions/Function2;)Ljava/util/Comparator;\n 50: invokespecial #291 // Method java/util/TreeSet.\"<init>\":(Ljava/util/Comparator;)V\n 53: astore 5\n 55: aload 5\n 57: aload_0\n 58: invokevirtual #292 // Method java/util/TreeSet.add:(Ljava/lang/Object;)Z\n 61: pop\n 62: aload 5\n 64: checkcast #98 // class java/util/Collection\n 67: invokeinterface #295, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 72: ifne 79\n 75: iconst_1\n 76: goto 80\n 79: iconst_0\n 80: ifeq 289\n 83: aload 5\n 85: invokevirtual #297 // Method java/util/TreeSet.first:()Ljava/lang/Object;\n 88: checkcast #114 // class java/lang/String\n 91: astore 6\n 93: aload 5\n 95: aload 6\n 97: invokevirtual #300 // Method java/util/TreeSet.remove:(Ljava/lang/Object;)Z\n 100: pop\n 101: getstatic #183 // Field graph:Ljava/util/TreeMap;\n 104: dup\n 105: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 108: aload 6\n 110: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 113: checkcast #189 // class java/util/TreeMap\n 116: dup\n 117: ifnonnull 128\n 120: pop\n 121: new #189 // class java/util/TreeMap\n 124: dup\n 125: invokespecial #190 // Method java/util/TreeMap.\"<init>\":()V\n 128: checkcast #210 // class java/util/Map\n 131: invokeinterface #304, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 136: invokeinterface #307, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 141: astore 7\n 143: aload 7\n 145: invokeinterface #108, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 150: ifeq 62\n 153: aload 7\n 155: invokeinterface #112, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 160: checkcast #309 // class java/util/Map$Entry\n 163: astore 8\n 165: aload 8\n 167: invokeinterface #312, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 172: checkcast #114 // class java/lang/String\n 175: astore 9\n 177: aload 8\n 179: invokeinterface #315, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 184: checkcast #317 // class java/lang/Number\n 187: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 190: istore 10\n 192: aload 4\n 194: aload 9\n 196: ldc_w #321 // int 2147483647\n 199: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 202: invokevirtual #214 // Method java/util/TreeMap.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 205: checkcast #317 // class java/lang/Number\n 208: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 211: aload 4\n 213: aload 6\n 215: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 218: dup\n 219: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 222: checkcast #317 // class java/lang/Number\n 225: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 228: iload 10\n 230: iadd\n 231: if_icmple 143\n 234: aload 5\n 236: aload 9\n 238: invokevirtual #300 // Method java/util/TreeSet.remove:(Ljava/lang/Object;)Z\n 241: pop\n 242: aload 4\n 244: checkcast #210 // class java/util/Map\n 247: aload 9\n 249: aload 4\n 251: aload 6\n 253: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 256: dup\n 257: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 260: checkcast #317 // class java/lang/Number\n 263: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 266: iload 10\n 268: iadd\n 269: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 272: invokeinterface #217, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 277: pop\n 278: aload 5\n 280: aload 9\n 282: invokevirtual #292 // Method java/util/TreeSet.add:(Ljava/lang/Object;)Z\n 285: pop\n 286: goto 143\n 289: invokestatic #249 // Method ask:()Ljava/util/List;\n 292: checkcast #86 // class java/lang/Iterable\n 295: astore 7\n 297: iconst_0\n 298: istore 8\n 300: aload 7\n 302: astore 9\n 304: new #88 // class java/util/ArrayList\n 307: dup\n 308: invokespecial #322 // Method java/util/ArrayList.\"<init>\":()V\n 311: checkcast #98 // class java/util/Collection\n 314: astore 10\n 316: iconst_0\n 317: istore 11\n 319: aload 9\n 321: invokeinterface #102, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 326: astore 12\n 328: aload 12\n 330: invokeinterface #108, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 335: ifeq 387\n 338: aload 12\n 340: invokeinterface #112, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 345: astore 13\n 347: aload 13\n 349: checkcast #236 // class Kettle\n 352: astore 14\n 354: iconst_0\n 355: istore 15\n 357: aload 14\n 359: invokevirtual #324 // Method Kettle.getMl:()I\n 362: iload_1\n 363: if_icmplt 370\n 366: iconst_1\n 367: goto 371\n 370: iconst_0\n 371: ifeq 328\n 374: aload 10\n 376: aload 13\n 378: invokeinterface #122, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 383: pop\n 384: goto 328\n 387: aload 10\n 389: checkcast #124 // class java/util/List\n 392: nop\n 393: checkcast #86 // class java/lang/Iterable\n 396: new #326 // class LogisticsKt$nearKettles$$inlined$compareByDescending$1\n 399: dup\n 400: lload_2\n 401: invokespecial #329 // Method LogisticsKt$nearKettles$$inlined$compareByDescending$1.\"<init>\":(J)V\n 404: checkcast #331 // class java/util/Comparator\n 407: astore 7\n 409: new #333 // class LogisticsKt$nearKettles$$inlined$thenBy$1\n 412: dup\n 413: aload 7\n 415: aload 4\n 417: invokespecial #336 // Method LogisticsKt$nearKettles$$inlined$thenBy$1.\"<init>\":(Ljava/util/Comparator;Ljava/util/TreeMap;)V\n 420: checkcast #331 // class java/util/Comparator\n 423: invokestatic #340 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 426: astore 6\n 428: ldc_w #321 // int 2147483647\n 431: istore 7\n 433: new #88 // class java/util/ArrayList\n 436: dup\n 437: invokespecial #322 // Method java/util/ArrayList.\"<init>\":()V\n 440: checkcast #124 // class java/util/List\n 443: astore 8\n 445: aload 6\n 447: invokeinterface #341, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 452: astore 9\n 454: aload 9\n 456: invokeinterface #108, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 461: ifeq 555\n 464: aload 9\n 466: invokeinterface #112, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 471: checkcast #236 // class Kettle\n 474: astore 10\n 476: iload 7\n 478: aload 4\n 480: aload 10\n 482: invokevirtual #343 // Method Kettle.getRoom:()Ljava/lang/String;\n 485: ldc_w #321 // int 2147483647\n 488: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 491: invokevirtual #214 // Method java/util/TreeMap.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 494: checkcast #317 // class java/lang/Number\n 497: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 500: if_icmple 454\n 503: aload 8\n 505: aload 10\n 507: aload 4\n 509: aload 10\n 511: invokevirtual #343 // Method Kettle.getRoom:()Ljava/lang/String;\n 514: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 517: dup\n 518: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 521: invokestatic #349 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 524: invokeinterface #350, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 529: pop\n 530: aload 4\n 532: aload 10\n 534: invokevirtual #343 // Method Kettle.getRoom:()Ljava/lang/String;\n 537: invokevirtual #220 // Method java/util/TreeMap.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 540: dup\n 541: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 544: checkcast #317 // class java/lang/Number\n 547: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 550: istore 7\n 552: goto 454\n 555: aload 8\n 557: checkcast #86 // class java/lang/Iterable\n 560: astore 9\n 562: iconst_0\n 563: istore 10\n 565: aload 9\n 567: astore 11\n 569: new #88 // class java/util/ArrayList\n 572: dup\n 573: invokespecial #322 // Method java/util/ArrayList.\"<init>\":()V\n 576: checkcast #98 // class java/util/Collection\n 579: astore 12\n 581: iconst_0\n 582: istore 13\n 584: aload 11\n 586: invokeinterface #102, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 591: astore 14\n 593: aload 14\n 595: invokeinterface #108, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 600: ifeq 672\n 603: aload 14\n 605: invokeinterface #112, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 610: astore 15\n 612: aload 15\n 614: checkcast #352 // class kotlin/Pair\n 617: astore 16\n 619: iconst_0\n 620: istore 17\n 622: aload 16\n 624: invokevirtual #355 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 627: checkcast #236 // class Kettle\n 630: astore 18\n 632: aload 18\n 634: invokevirtual #359 // Method Kettle.getBoilTime:()J\n 637: invokestatic #364 // Method java/lang/System.currentTimeMillis:()J\n 640: lsub\n 641: invokestatic #370 // Method java/lang/Math.abs:(J)J\n 644: ldc2_w #371 // long 86400000l\n 647: lcmp\n 648: ifge 655\n 651: iconst_1\n 652: goto 656\n 655: iconst_0\n 656: ifeq 593\n 659: aload 12\n 661: aload 15\n 663: invokeinterface #122, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 668: pop\n 669: goto 593\n 672: aload 12\n 674: checkcast #124 // class java/util/List\n 677: nop\n 678: areturn\n\n public static final void boilKettle(int, int);\n Code:\n 0: ldc2_w #392 // long 180000l\n 3: iload_1\n 4: i2l\n 5: lmul\n 6: ldc2_w #394 // long 1000l\n 9: ldiv\n 10: lstore_2\n 11: iload_0\n 12: invokestatic #364 // Method java/lang/System.currentTimeMillis:()J\n 15: lload_2\n 16: ladd\n 17: iload_1\n 18: invokestatic #397 // Method update:(IJI)Ljava/util/List;\n 21: pop\n 22: return\n\n public static final java.util.List<java.lang.String> drink(int, int);\n Code:\n 0: iload_0\n 1: iload_0\n 2: invokestatic #404 // Method byId:(I)LKettle;\n 5: invokevirtual #359 // Method Kettle.getBoilTime:()J\n 8: iload_1\n 9: invokestatic #397 // Method update:(IJI)Ljava/util/List;\n 12: areturn\n\n private static final int nearKettles$lambda$2(java.util.TreeMap, java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: aload_1\n 2: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 5: aload_1\n 6: ldc_w #321 // int 2147483647\n 9: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 12: invokevirtual #214 // Method java/util/TreeMap.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 15: checkcast #317 // class java/lang/Number\n 18: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 21: aload_0\n 22: aload_2\n 23: invokestatic #208 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 26: aload_2\n 27: ldc_w #321 // int 2147483647\n 30: invokestatic #224 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 33: invokevirtual #214 // Method java/util/TreeMap.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 36: checkcast #317 // class java/lang/Number\n 39: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 42: isub\n 43: ireturn\n\n private static final int nearKettles$lambda$3(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #412, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: checkcast #317 // class java/lang/Number\n 11: invokevirtual #320 // Method java/lang/Number.intValue:()I\n 14: ireturn\n\n static {};\n Code:\n 0: ldc_w #419 // String 1\n 3: putstatic #11 // Field room:Ljava/lang/String;\n 6: sipush 200\n 9: putstatic #27 // Field ml:I\n 12: ldc_w #421 // String http://192.168.43.217:1000/\n 15: putstatic #43 // Field start:Ljava/lang/String;\n 18: return\n}\n", "javap_err": "" }, { "class_path": "GitProger__Alferov-Lyceum-PTHS__cb1cd6d/LogisticsKt$nearKettles$$inlined$compareByDescending$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class LogisticsKt$nearKettles$$inlined$compareByDescending$1<T> implements java.util.Comparator {\n final long $currentTime$inlined;\n\n public LogisticsKt$nearKettles$$inlined$compareByDescending$1(long);\n Code:\n 0: aload_0\n 1: lload_1\n 2: putfield #18 // Field $currentTime$inlined:J\n 5: aload_0\n 6: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 9: return\n\n public final int compare(T, T);\n Code:\n 0: aload_2\n 1: checkcast #28 // class Kettle\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #32 // Method Kettle.getBoilTime:()J\n 12: aload_0\n 13: getfield #18 // Field $currentTime$inlined:J\n 16: invokestatic #38 // Method kotlin/ranges/RangesKt.coerceAtMost:(JJ)J\n 19: invokestatic #44 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 22: checkcast #46 // class java/lang/Comparable\n 25: aload_1\n 26: checkcast #28 // class Kettle\n 29: astore_3\n 30: astore 5\n 32: iconst_0\n 33: istore 4\n 35: aload_3\n 36: invokevirtual #32 // Method Kettle.getBoilTime:()J\n 39: aload_0\n 40: getfield #18 // Field $currentTime$inlined:J\n 43: invokestatic #38 // Method kotlin/ranges/RangesKt.coerceAtMost:(JJ)J\n 46: invokestatic #44 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 49: checkcast #46 // class java/lang/Comparable\n 52: aload 5\n 54: swap\n 55: invokestatic #52 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 58: ireturn\n}\n", "javap_err": "" } ]
Flight552__codewars__b9fb937/src/main/kotlin/PrimeSteps.kt
//The prime numbers are not regularly spaced. // For example from 2 to 3 the step is 1. From 3 to 5 // the step is 2. From 7 to 11 it is 4. // Between 2 and 50 we have the following pairs of 2-steps primes: // //3, 5 - 5, 7, - 11, 13, - 17, 19, - 29, 31, - 41, 43 // //We will write a function step with parameters: // //g (integer >= 2) which indicates the step we are looking for, // //m (integer >= 2) which gives the start of the search (m inclusive), // //n (integer >= m) which gives the end of the search (n inclusive) // //In the example above step(2, 2, 50) will return [3, 5] //which is the first pair between 2 and 50 with a 2-steps. // //So this function should return the first pair of the //two prime numbers spaced with a step of g between the limits m, // n if these g-steps prime numbers exist otherwise // nil or null or None or Nothing or [] or "0, 0" or {0, 0} or 0 0 or "" (depending on the language). // //Examples: //step(2, 5, 7) --> [5, 7] or (5, 7) or {5, 7} or "5 7" // //step(2, 5, 5) --> nil or ... or [] in Ocaml or {0, 0} in C++ // //step(4, 130, 200) --> [163, 167] or (163, 167) or {163, 167} // //See more examples for your language in "TESTS" // //Remarks: //([193, 197] is also such a 4-steps primes between 130 //and 200 but it's not the first pair). // //step(6, 100, 110) --> [101, 107] though there is a //prime between 101 and 107 which is 103; the pair 101-103 is a 2-step. // //Notes: //The idea of "step" is close to that of "gap" but it is //not exactly the same. For those interested they can have //a look at http://mathworld.wolfram.com/PrimeGaps.html. // //A "gap" is more restrictive: there must be no primes in //between (101-107 is a "step" but not a "gap". Next kata will be about "gaps":-). // //For Go: nil slice is expected when there are no step between m and n. //Example: step(2,4900,4919) --> nil object PrimeSteps { // if these g-steps prime numbers don't exist return [] fun step(g: Int, m: Long, n: Long): LongArray { println("g = $g, m = $m, n = $n") if (n < m || m < 2 || g < 2) return LongArray(0) var array = LongArray(2) val listOfPrimes = mutableListOf<Long>() var stepCounter = 0 var isPrime = true if (m == 2L || m == 3L || m == 5L) { array[0] = m listOfPrimes.add(m) } for (i in m..n) { if (i % 2 == 0L) { stepCounter++ continue } for (p in 3 .. i / 2 step 2) { if (i % p == 0L) { isPrime = false break } isPrime = true } if (isPrime && i != 5L) { println(listOfPrimes) listOfPrimes.add(i) } listOfPrimes.forEachIndexed { index, l -> val differ = listOfPrimes[listOfPrimes.size - 1] - listOfPrimes[index] if(differ == g.toLong()) { array[0] = listOfPrimes[index] array[1] = listOfPrimes[listOfPrimes.size - 1] return array } } } return if (array[1] == 0L) { return LongArray(0) } else { array } } } fun main(args: Array<String>) { var array = PrimeSteps.step(2, 7, 13) println(array.asList()) }
[ { "class_path": "Flight552__codewars__b9fb937/PrimeStepsKt.class", "javap": "Compiled from \"PrimeSteps.kt\"\npublic final class PrimeStepsKt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: getstatic #21 // Field PrimeSteps.INSTANCE:LPrimeSteps;\n 9: iconst_2\n 10: ldc2_w #22 // long 7l\n 13: ldc2_w #24 // long 13l\n 16: invokevirtual #29 // Method PrimeSteps.step:(IJJ)[J\n 19: astore_1\n 20: aload_1\n 21: invokestatic #35 // Method kotlin/collections/ArraysKt.asList:([J)Ljava/util/List;\n 24: getstatic #41 // Field java/lang/System.out:Ljava/io/PrintStream;\n 27: swap\n 28: invokevirtual #47 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 31: return\n}\n", "javap_err": "" }, { "class_path": "Flight552__codewars__b9fb937/PrimeSteps.class", "javap": "Compiled from \"PrimeSteps.kt\"\npublic final class PrimeSteps {\n public static final PrimeSteps INSTANCE;\n\n private PrimeSteps();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final long[] step(int, long, long);\n Code:\n 0: new #15 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #16 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #18 // String g =\n 9: invokevirtual #22 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: iload_1\n 13: invokevirtual #25 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 16: ldc #27 // String , m =\n 18: invokevirtual #22 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 21: lload_2\n 22: invokevirtual #30 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 25: ldc #32 // String , n =\n 27: invokevirtual #22 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 30: lload 4\n 32: invokevirtual #30 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 35: invokevirtual #36 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 38: getstatic #42 // Field java/lang/System.out:Ljava/io/PrintStream;\n 41: swap\n 42: invokevirtual #48 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 45: lload 4\n 47: lload_2\n 48: lcmp\n 49: iflt 65\n 52: lload_2\n 53: ldc2_w #49 // long 2l\n 56: lcmp\n 57: iflt 65\n 60: iload_1\n 61: iconst_2\n 62: if_icmpge 69\n 65: iconst_0\n 66: newarray long\n 68: areturn\n 69: aconst_null\n 70: astore 6\n 72: iconst_2\n 73: newarray long\n 75: astore 6\n 77: new #52 // class java/util/ArrayList\n 80: dup\n 81: invokespecial #53 // Method java/util/ArrayList.\"<init>\":()V\n 84: checkcast #55 // class java/util/List\n 87: astore 7\n 89: iconst_0\n 90: istore 8\n 92: iconst_1\n 93: istore 9\n 95: lload_2\n 96: ldc2_w #49 // long 2l\n 99: lcmp\n 100: ifeq 119\n 103: lload_2\n 104: ldc2_w #56 // long 3l\n 107: lcmp\n 108: ifeq 119\n 111: lload_2\n 112: ldc2_w #58 // long 5l\n 115: lcmp\n 116: ifne 136\n 119: aload 6\n 121: iconst_0\n 122: lload_2\n 123: lastore\n 124: aload 7\n 126: lload_2\n 127: invokestatic #65 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 130: invokeinterface #69, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 135: pop\n 136: lload_2\n 137: lstore 10\n 139: lload 10\n 141: lload 4\n 143: lcmp\n 144: ifgt 461\n 147: lload 10\n 149: iconst_2\n 150: i2l\n 151: lrem\n 152: lconst_0\n 153: lcmp\n 154: ifne 163\n 157: iinc 8, 1\n 160: goto 444\n 163: lload 10\n 165: iconst_2\n 166: i2l\n 167: ldiv\n 168: lstore 12\n 170: ldc2_w #56 // long 3l\n 173: lstore 14\n 175: ldc2_w #56 // long 3l\n 178: lload 12\n 180: ldc2_w #49 // long 2l\n 183: invokestatic #75 // Method kotlin/internal/ProgressionUtilKt.getProgressionLastElement:(JJJ)J\n 186: lstore 16\n 188: lload 14\n 190: lload 16\n 192: lcmp\n 193: ifgt 234\n 196: lload 10\n 198: lload 14\n 200: lrem\n 201: lconst_0\n 202: lcmp\n 203: ifne 212\n 206: iconst_0\n 207: istore 9\n 209: goto 234\n 212: iconst_1\n 213: istore 9\n 215: lload 14\n 217: lload 16\n 219: lcmp\n 220: ifeq 234\n 223: lload 14\n 225: ldc2_w #49 // long 2l\n 228: ladd\n 229: lstore 14\n 231: goto 196\n 234: iload 9\n 236: ifeq 269\n 239: lload 10\n 241: ldc2_w #58 // long 5l\n 244: lcmp\n 245: ifeq 269\n 248: getstatic #42 // Field java/lang/System.out:Ljava/io/PrintStream;\n 251: aload 7\n 253: invokevirtual #48 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 256: aload 7\n 258: lload 10\n 260: invokestatic #65 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 263: invokeinterface #69, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 268: pop\n 269: aload 7\n 271: checkcast #77 // class java/lang/Iterable\n 274: astore 12\n 276: iconst_0\n 277: istore 13\n 279: iconst_0\n 280: istore 14\n 282: aload 12\n 284: invokeinterface #81, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 289: astore 15\n 291: aload 15\n 293: invokeinterface #87, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 298: ifeq 443\n 301: aload 15\n 303: invokeinterface #91, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 308: astore 16\n 310: iload 14\n 312: iinc 14, 1\n 315: istore 17\n 317: iload 17\n 319: ifge 325\n 322: invokestatic #96 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 325: iload 17\n 327: aload 16\n 329: checkcast #98 // class java/lang/Number\n 332: invokevirtual #102 // Method java/lang/Number.longValue:()J\n 335: lstore 18\n 337: istore 20\n 339: iconst_0\n 340: istore 21\n 342: aload 7\n 344: aload 7\n 346: invokeinterface #106, 1 // InterfaceMethod java/util/List.size:()I\n 351: iconst_1\n 352: isub\n 353: invokeinterface #110, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 358: checkcast #98 // class java/lang/Number\n 361: invokevirtual #102 // Method java/lang/Number.longValue:()J\n 364: aload 7\n 366: iload 20\n 368: invokeinterface #110, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 373: checkcast #98 // class java/lang/Number\n 376: invokevirtual #102 // Method java/lang/Number.longValue:()J\n 379: lsub\n 380: lstore 22\n 382: lload 22\n 384: iload_1\n 385: i2l\n 386: lcmp\n 387: ifne 438\n 390: aload 6\n 392: iconst_0\n 393: aload 7\n 395: iload 20\n 397: invokeinterface #110, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 402: checkcast #98 // class java/lang/Number\n 405: invokevirtual #102 // Method java/lang/Number.longValue:()J\n 408: lastore\n 409: aload 6\n 411: iconst_1\n 412: aload 7\n 414: aload 7\n 416: invokeinterface #106, 1 // InterfaceMethod java/util/List.size:()I\n 421: iconst_1\n 422: isub\n 423: invokeinterface #110, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 428: checkcast #98 // class java/lang/Number\n 431: invokevirtual #102 // Method java/lang/Number.longValue:()J\n 434: lastore\n 435: aload 6\n 437: areturn\n 438: nop\n 439: nop\n 440: goto 291\n 443: nop\n 444: lload 10\n 446: lload 4\n 448: lcmp\n 449: ifeq 461\n 452: lload 10\n 454: lconst_1\n 455: ladd\n 456: lstore 10\n 458: goto 147\n 461: aload 6\n 463: iconst_1\n 464: laload\n 465: lconst_0\n 466: lcmp\n 467: ifne 474\n 470: iconst_0\n 471: newarray long\n 473: areturn\n 474: aload 6\n 476: areturn\n\n static {};\n Code:\n 0: new #2 // class PrimeSteps\n 3: dup\n 4: invokespecial #137 // Method \"<init>\":()V\n 7: putstatic #140 // Field INSTANCE:LPrimeSteps;\n 10: return\n}\n", "javap_err": "" } ]
Flight552__codewars__b9fb937/src/main/kotlin/RangeExtraction.kt
//A format for expressing an ordered list of //integers is to use a comma separated list of either // //individual integers //or a range of integers denoted by the //starting integer separated from the end integer in //the range by a dash, '-'. The range includes all //integers in the interval including both endpoints. //It is not considered a range unless it spans at least //3 numbers. For example "12,13,15-17" //Complete the solution so that it takes a //list of integers in increasing order and returns a //correctly formatted string in the range format. // //Example: // //solution([-6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20]); // returns "-6,-3-1,3-5,7-11,14,15,17-20" object RangeExtraction { fun rangeExtraction(arr: IntArray): String { var listOfRangedNumbers = mutableListOf<Int>() var finalString = "" var rangeString = "" var isNext = false arr.forEachIndexed { index, i -> if (i <= 1) { val nextIndex: Int = try { arr[index + 1] } catch (e: Exception) { arr[index] } if (i == nextIndex - 1) { isNext = true listOfRangedNumbers.add(i) } else { if (isNext) listOfRangedNumbers.add(i) if (listOfRangedNumbers.size > 2) { rangeString = rangeString.plus("${listOfRangedNumbers[0]}-${listOfRangedNumbers[listOfRangedNumbers.size - 1]},") finalString = finalString.plus(rangeString) rangeString = "" listOfRangedNumbers = mutableListOf() } else { listOfRangedNumbers.forEach { finalString = finalString.plus("$it,") } listOfRangedNumbers = mutableListOf() } } } if (i > 1) { val nextIndex: Int = try { arr[index + 1] } catch (e: Exception) { 0 } if (i == nextIndex - 1) { isNext = true listOfRangedNumbers.add(i) } else { if (isNext) listOfRangedNumbers.add(i) if (listOfRangedNumbers.size > 2) { rangeString = rangeString.plus("${listOfRangedNumbers[0]}-${listOfRangedNumbers[listOfRangedNumbers.size - 1]},") finalString = finalString.plus(rangeString) rangeString = "" listOfRangedNumbers = mutableListOf() } else { listOfRangedNumbers.forEach { finalString = finalString.plus("$it,") } listOfRangedNumbers = mutableListOf() } } } if (!isNext) { finalString = finalString.plus("$i,") } } finalString = finalString.dropLast(1) println(finalString) return finalString } } fun main(args: Array<String>) { val array = intArrayOf(-6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20) RangeExtraction.rangeExtraction(array) } //best solution fun rangeExtraction( arr: IntArray ): String = arr.fold(emptyList<Pair<Int, Int>>()) { rs, x -> rs.lastOrNull().run { if (this != null && x - second == 1) rs.dropLast(1) + (first to x) else rs + (x to x) } }.joinToString(",") { (x, y) -> if (y - x > 1) "$x-$y" else (x..y).joinToString(",") }
[ { "class_path": "Flight552__codewars__b9fb937/RangeExtraction.class", "javap": "Compiled from \"RangeExtraction.kt\"\npublic final class RangeExtraction {\n public static final RangeExtraction INSTANCE;\n\n private RangeExtraction();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String rangeExtraction(int[]);\n Code:\n 0: aload_1\n 1: ldc #17 // String arr\n 3: invokestatic #23 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aconst_null\n 7: astore_2\n 8: new #25 // class java/util/ArrayList\n 11: dup\n 12: invokespecial #26 // Method java/util/ArrayList.\"<init>\":()V\n 15: checkcast #28 // class java/util/List\n 18: astore_2\n 19: aconst_null\n 20: astore_3\n 21: ldc #30 // String\n 23: astore_3\n 24: aconst_null\n 25: astore 4\n 27: ldc #30 // String\n 29: astore 4\n 31: iconst_0\n 32: istore 5\n 34: aload_1\n 35: astore 6\n 37: iconst_0\n 38: istore 7\n 40: iconst_0\n 41: istore 8\n 43: iconst_0\n 44: istore 9\n 46: aload 6\n 48: arraylength\n 49: istore 10\n 51: iload 9\n 53: iload 10\n 55: if_icmpge 676\n 58: aload 6\n 60: iload 9\n 62: iaload\n 63: istore 11\n 65: iload 8\n 67: iinc 8, 1\n 70: iload 11\n 72: istore 12\n 74: istore 13\n 76: iconst_0\n 77: istore 14\n 79: iload 12\n 81: iconst_1\n 82: if_icmpgt 360\n 85: nop\n 86: aload_1\n 87: iload 13\n 89: iconst_1\n 90: iadd\n 91: iaload\n 92: istore 15\n 94: goto 105\n 97: astore 16\n 99: aload_1\n 100: iload 13\n 102: iaload\n 103: istore 15\n 105: iload 15\n 107: istore 17\n 109: iload 12\n 111: iload 17\n 113: iconst_1\n 114: isub\n 115: if_icmpne 136\n 118: iconst_1\n 119: istore 5\n 121: aload_2\n 122: iload 12\n 124: invokestatic #36 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 127: invokeinterface #40, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 132: pop\n 133: goto 360\n 136: iload 5\n 138: ifeq 153\n 141: aload_2\n 142: iload 12\n 144: invokestatic #36 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 147: invokeinterface #40, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 152: pop\n 153: aload_2\n 154: invokeinterface #44, 1 // InterfaceMethod java/util/List.size:()I\n 159: iconst_2\n 160: if_icmple 268\n 163: nop\n 164: new #46 // class java/lang/StringBuilder\n 167: dup\n 168: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 171: aload 4\n 173: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 176: aload_2\n 177: iconst_0\n 178: invokeinterface #55, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 183: checkcast #57 // class java/lang/Number\n 186: invokevirtual #60 // Method java/lang/Number.intValue:()I\n 189: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 192: bipush 45\n 194: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 197: aload_2\n 198: aload_2\n 199: invokeinterface #44, 1 // InterfaceMethod java/util/List.size:()I\n 204: iconst_1\n 205: isub\n 206: invokeinterface #55, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 211: checkcast #57 // class java/lang/Number\n 214: invokevirtual #60 // Method java/lang/Number.intValue:()I\n 217: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 220: bipush 44\n 222: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 225: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 228: astore 4\n 230: new #46 // class java/lang/StringBuilder\n 233: dup\n 234: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 237: aload_3\n 238: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 241: aload 4\n 243: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 246: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 249: astore_3\n 250: ldc #30 // String\n 252: astore 4\n 254: new #25 // class java/util/ArrayList\n 257: dup\n 258: invokespecial #26 // Method java/util/ArrayList.\"<init>\":()V\n 261: checkcast #28 // class java/util/List\n 264: astore_2\n 265: goto 360\n 268: aload_2\n 269: checkcast #72 // class java/lang/Iterable\n 272: astore 15\n 274: iconst_0\n 275: istore 16\n 277: aload 15\n 279: invokeinterface #76, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 284: astore 18\n 286: aload 18\n 288: invokeinterface #82, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 293: ifeq 348\n 296: aload 18\n 298: invokeinterface #86, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 303: astore 19\n 305: aload 19\n 307: checkcast #57 // class java/lang/Number\n 310: invokevirtual #60 // Method java/lang/Number.intValue:()I\n 313: istore 20\n 315: iconst_0\n 316: istore 21\n 318: new #46 // class java/lang/StringBuilder\n 321: dup\n 322: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 325: aload_3\n 326: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 329: iload 20\n 331: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 334: bipush 44\n 336: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 339: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 342: astore_3\n 343: nop\n 344: nop\n 345: goto 286\n 348: nop\n 349: new #25 // class java/util/ArrayList\n 352: dup\n 353: invokespecial #26 // Method java/util/ArrayList.\"<init>\":()V\n 356: checkcast #28 // class java/util/List\n 359: astore_2\n 360: iload 12\n 362: iconst_1\n 363: if_icmple 638\n 366: nop\n 367: aload_1\n 368: iload 13\n 370: iconst_1\n 371: iadd\n 372: iaload\n 373: istore 15\n 375: goto 383\n 378: astore 16\n 380: iconst_0\n 381: istore 15\n 383: iload 15\n 385: istore 17\n 387: iload 12\n 389: iload 17\n 391: iconst_1\n 392: isub\n 393: if_icmpne 414\n 396: iconst_1\n 397: istore 5\n 399: aload_2\n 400: iload 12\n 402: invokestatic #36 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 405: invokeinterface #40, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 410: pop\n 411: goto 638\n 414: iload 5\n 416: ifeq 431\n 419: aload_2\n 420: iload 12\n 422: invokestatic #36 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 425: invokeinterface #40, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 430: pop\n 431: aload_2\n 432: invokeinterface #44, 1 // InterfaceMethod java/util/List.size:()I\n 437: iconst_2\n 438: if_icmple 546\n 441: nop\n 442: new #46 // class java/lang/StringBuilder\n 445: dup\n 446: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 449: aload 4\n 451: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 454: aload_2\n 455: iconst_0\n 456: invokeinterface #55, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 461: checkcast #57 // class java/lang/Number\n 464: invokevirtual #60 // Method java/lang/Number.intValue:()I\n 467: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 470: bipush 45\n 472: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 475: aload_2\n 476: aload_2\n 477: invokeinterface #44, 1 // InterfaceMethod java/util/List.size:()I\n 482: iconst_1\n 483: isub\n 484: invokeinterface #55, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 489: checkcast #57 // class java/lang/Number\n 492: invokevirtual #60 // Method java/lang/Number.intValue:()I\n 495: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 498: bipush 44\n 500: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 503: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 506: astore 4\n 508: new #46 // class java/lang/StringBuilder\n 511: dup\n 512: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 515: aload_3\n 516: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 519: aload 4\n 521: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 524: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 527: astore_3\n 528: ldc #30 // String\n 530: astore 4\n 532: new #25 // class java/util/ArrayList\n 535: dup\n 536: invokespecial #26 // Method java/util/ArrayList.\"<init>\":()V\n 539: checkcast #28 // class java/util/List\n 542: astore_2\n 543: goto 638\n 546: aload_2\n 547: checkcast #72 // class java/lang/Iterable\n 550: astore 15\n 552: iconst_0\n 553: istore 16\n 555: aload 15\n 557: invokeinterface #76, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 562: astore 18\n 564: aload 18\n 566: invokeinterface #82, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 571: ifeq 626\n 574: aload 18\n 576: invokeinterface #86, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 581: astore 19\n 583: aload 19\n 585: checkcast #57 // class java/lang/Number\n 588: invokevirtual #60 // Method java/lang/Number.intValue:()I\n 591: istore 20\n 593: iconst_0\n 594: istore 21\n 596: new #46 // class java/lang/StringBuilder\n 599: dup\n 600: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 603: aload_3\n 604: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 607: iload 20\n 609: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 612: bipush 44\n 614: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 617: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 620: astore_3\n 621: nop\n 622: nop\n 623: goto 564\n 626: nop\n 627: new #25 // class java/util/ArrayList\n 630: dup\n 631: invokespecial #26 // Method java/util/ArrayList.\"<init>\":()V\n 634: checkcast #28 // class java/util/List\n 637: astore_2\n 638: iload 5\n 640: ifne 668\n 643: new #46 // class java/lang/StringBuilder\n 646: dup\n 647: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 650: aload_3\n 651: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 654: iload 12\n 656: invokevirtual #63 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 659: bipush 44\n 661: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 664: invokevirtual #70 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 667: astore_3\n 668: nop\n 669: nop\n 670: iinc 9, 1\n 673: goto 51\n 676: nop\n 677: aload_3\n 678: iconst_1\n 679: invokestatic #92 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;\n 682: astore_3\n 683: aload_3\n 684: getstatic #98 // Field java/lang/System.out:Ljava/io/PrintStream;\n 687: swap\n 688: invokevirtual #104 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 691: aload_3\n 692: areturn\n Exception table:\n from to target type\n 85 94 97 Class java/lang/Exception\n 366 375 378 Class java/lang/Exception\n\n static {};\n Code:\n 0: new #2 // class RangeExtraction\n 3: dup\n 4: invokespecial #134 // Method \"<init>\":()V\n 7: putstatic #137 // Field INSTANCE:LRangeExtraction;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "Flight552__codewars__b9fb937/RangeExtractionKt.class", "javap": "Compiled from \"RangeExtraction.kt\"\npublic final class RangeExtractionKt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: bipush 20\n 8: newarray int\n 10: astore_2\n 11: aload_2\n 12: iconst_0\n 13: bipush -6\n 15: iastore\n 16: aload_2\n 17: iconst_1\n 18: bipush -3\n 20: iastore\n 21: aload_2\n 22: iconst_2\n 23: bipush -2\n 25: iastore\n 26: aload_2\n 27: iconst_3\n 28: iconst_m1\n 29: iastore\n 30: aload_2\n 31: iconst_4\n 32: iconst_0\n 33: iastore\n 34: aload_2\n 35: iconst_5\n 36: iconst_1\n 37: iastore\n 38: aload_2\n 39: bipush 6\n 41: iconst_3\n 42: iastore\n 43: aload_2\n 44: bipush 7\n 46: iconst_4\n 47: iastore\n 48: aload_2\n 49: bipush 8\n 51: iconst_5\n 52: iastore\n 53: aload_2\n 54: bipush 9\n 56: bipush 7\n 58: iastore\n 59: aload_2\n 60: bipush 10\n 62: bipush 8\n 64: iastore\n 65: aload_2\n 66: bipush 11\n 68: bipush 9\n 70: iastore\n 71: aload_2\n 72: bipush 12\n 74: bipush 10\n 76: iastore\n 77: aload_2\n 78: bipush 13\n 80: bipush 11\n 82: iastore\n 83: aload_2\n 84: bipush 14\n 86: bipush 14\n 88: iastore\n 89: aload_2\n 90: bipush 15\n 92: bipush 15\n 94: iastore\n 95: aload_2\n 96: bipush 16\n 98: bipush 17\n 100: iastore\n 101: aload_2\n 102: bipush 17\n 104: bipush 18\n 106: iastore\n 107: aload_2\n 108: bipush 18\n 110: bipush 19\n 112: iastore\n 113: aload_2\n 114: bipush 19\n 116: bipush 20\n 118: iastore\n 119: aload_2\n 120: astore_1\n 121: getstatic #21 // Field RangeExtraction.INSTANCE:LRangeExtraction;\n 124: aload_1\n 125: invokevirtual #25 // Method RangeExtraction.rangeExtraction:([I)Ljava/lang/String;\n 128: pop\n 129: return\n\n public static final java.lang.String rangeExtraction(int[]);\n Code:\n 0: aload_0\n 1: ldc #30 // String arr\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_1\n 8: invokestatic #36 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 11: astore_2\n 12: iconst_0\n 13: istore_3\n 14: aload_2\n 15: astore 4\n 17: iconst_0\n 18: istore 5\n 20: aload_1\n 21: arraylength\n 22: istore 6\n 24: iload 5\n 26: iload 6\n 28: if_icmpge 143\n 31: aload_1\n 32: iload 5\n 34: iaload\n 35: istore 7\n 37: aload 4\n 39: iload 7\n 41: istore 8\n 43: astore 9\n 45: iconst_0\n 46: istore 10\n 48: aload 9\n 50: invokestatic #40 // Method kotlin/collections/CollectionsKt.lastOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 53: checkcast #42 // class kotlin/Pair\n 56: astore 11\n 58: iconst_0\n 59: istore 12\n 61: aload 11\n 63: ifnull 112\n 66: iload 8\n 68: aload 11\n 70: invokevirtual #46 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 73: checkcast #48 // class java/lang/Number\n 76: invokevirtual #52 // Method java/lang/Number.intValue:()I\n 79: isub\n 80: iconst_1\n 81: if_icmpne 112\n 84: aload 9\n 86: iconst_1\n 87: invokestatic #56 // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;\n 90: checkcast #58 // class java/util/Collection\n 93: aload 11\n 95: invokevirtual #61 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 98: iload 8\n 100: invokestatic #67 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 103: invokestatic #73 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 106: invokestatic #77 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;\n 109: goto 133\n 112: aload 9\n 114: checkcast #58 // class java/util/Collection\n 117: iload 8\n 119: invokestatic #67 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 122: iload 8\n 124: invokestatic #67 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 127: invokestatic #73 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 130: invokestatic #77 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;\n 133: nop\n 134: nop\n 135: astore 4\n 137: iinc 5, 1\n 140: goto 24\n 143: aload 4\n 145: checkcast #79 // class java/lang/Iterable\n 148: ldc #81 // String ,\n 150: checkcast #83 // class java/lang/CharSequence\n 153: aconst_null\n 154: aconst_null\n 155: iconst_0\n 156: aconst_null\n 157: invokedynamic #102, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 162: bipush 30\n 164: aconst_null\n 165: invokestatic #106 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 168: areturn\n\n private static final java.lang.CharSequence rangeExtraction$lambda$2(kotlin.Pair);\n Code:\n 0: aload_0\n 1: ldc #125 // String <destruct>\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #128 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 10: checkcast #48 // class java/lang/Number\n 13: invokevirtual #52 // Method java/lang/Number.intValue:()I\n 16: istore_1\n 17: aload_0\n 18: invokevirtual #131 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 21: checkcast #48 // class java/lang/Number\n 24: invokevirtual #52 // Method java/lang/Number.intValue:()I\n 27: istore_2\n 28: iload_2\n 29: iload_1\n 30: isub\n 31: iconst_1\n 32: if_icmple 64\n 35: new #133 // class java/lang/StringBuilder\n 38: dup\n 39: invokespecial #137 // Method java/lang/StringBuilder.\"<init>\":()V\n 42: iload_1\n 43: invokevirtual #141 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 46: bipush 45\n 48: invokevirtual #144 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 51: iload_2\n 52: invokevirtual #141 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 55: invokevirtual #148 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 58: checkcast #83 // class java/lang/CharSequence\n 61: goto 95\n 64: new #150 // class kotlin/ranges/IntRange\n 67: dup\n 68: iload_1\n 69: iload_2\n 70: invokespecial #153 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 73: checkcast #79 // class java/lang/Iterable\n 76: ldc #81 // String ,\n 78: checkcast #83 // class java/lang/CharSequence\n 81: aconst_null\n 82: aconst_null\n 83: iconst_0\n 84: aconst_null\n 85: aconst_null\n 86: bipush 62\n 88: aconst_null\n 89: invokestatic #106 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 92: checkcast #83 // class java/lang/CharSequence\n 95: areturn\n}\n", "javap_err": "" } ]
ivan-moto__30-seconds-of-kotlin__772896c/src/main/List.kt
import java.util.Objects import kotlin.math.max fun <T> all(list: List<T>, predicate: (T) -> Boolean): Boolean = list.all(predicate) fun <T> allEqual(list: List<T>): Boolean = if (list.isEmpty()) false else list.all { it == list[0] } fun <T> any(list: List<T>, predicate: (T) -> Boolean): Boolean = list.any(predicate) fun <T> bifurcate(list: List<T>, filter: List<Boolean>): Pair<List<T>, List<T>> { require(list.size == filter.size) return list.zip(filter).partition { it.second } .let { (list1, list2) -> list1.map { it.first } to list2.map { it.first } } } fun <T> bifurcateBy(list: List<T>, predicate: (T) -> Boolean): Pair<List<T>, List<T>> = list.partition(predicate) fun <T> chunk(list: List<T>, size: Int): List<List<T>> = list.chunked(size) fun <T> combinations(list: List<T>): List<List<T>> = TODO() fun <T> compact(list: List<T?>): List<T> { fun isTruthy(t: T?): Boolean = when(t) { null -> false is Boolean -> t is Double -> !t.isNaN() is Number -> t.toInt() != 0 is String -> !t.isEmpty() is Array<*> -> t.size != 0 is Collection<*> -> !t.isEmpty() else -> true } @Suppress("UNCHECKED_CAST") return list.filter(::isTruthy) as List<T> } fun <T, K> countBy(list: List<T>, function: (T) -> K): Map<K, Int> = list.groupingBy(function).eachCount() fun <T> countOccurrences(list: List<T>, target: T, equals: (T, T) -> Boolean = Objects::equals): Int = list.count { equals(target, it) } fun <T> concat(first: List<T>, vararg others: List<T>): List<T> = first.asSequence().plus(others.asSequence().flatten()).toList() fun <T, U> corresponds(first: List<T>, second: List<U>, predicate: (T, U) -> Boolean): Boolean = (first.size == second.size) && (first.zip(second).all { (t, u) -> predicate(t, u) }) fun <T, U> crossProduct(first: List<T>, second: List<U>): List<Pair<T, U>> = first.flatMap { a -> second.map { b -> a to b } } fun <T> cycle(list: List<T>): Sequence<T> = generateSequence(if (list.isNotEmpty()) 0 else null) { (it + 1) % list.size } .map { list[it] } fun <T> difference(first: List<T>, second: List<T>): List<T> = (first subtract second).toList() fun <T, R> differenceBy(first: List<T>, second: List<T>, function: (T) -> R): List<T> = with(second.toSet().map(function)) { first.filterNot { contains(function(it)) } } fun <T> differenceWith(first: List<T>, second: List<T>, function: (T, T) -> Boolean): List<T> = first.filter { a -> second.none { b -> function(a, b) } } fun <T> distinct(list: List<T>): List<T> = list.distinct() fun <T> drop(list: List<T>, n: Int): List<T> = list.drop(n) fun <T> dropRight(list: List<T>, n: Int): List<T> = list.dropLast(n) fun <T> dropRightWhile(list: List<T>, predicate: (T) -> Boolean): List<T> = list.dropLastWhile(predicate) fun <T> dropWhile(list: List<T>, predicate: (T) -> Boolean): List<T> = list.dropWhile(predicate) fun <T> endsWith(list: List<T>, subList: List<T>): Boolean = list.takeLast(subList.size) == subList fun <T> everyNth(list: List<T>, nth: Int): List<T> = list.windowed(nth, nth, partialWindows = false).map { it.last() } fun <T> existsUnique(list: List<T>, predicate: (T) -> Boolean): Boolean { var exists = false for (t in list) { if (predicate(t)) { if (exists) { return false } else { exists = true } } } return exists } fun <T> filterNonUnique(list: List<T>): List<T> = list.distinct() fun <T, K> filterNonUniqueBy(list: List<T>, function: (T) -> K): List<T> = list.distinctBy(function) fun <T> findLast(list: List<T>, predicate: (T) -> Boolean): T? = list.findLast(predicate) fun <T> findLastIndex(list: List<T>, predicate: (T) -> Boolean): Int = list.indexOfLast(predicate) fun <T> forEachRight(list: List<T>, action: (T) -> Unit): Unit = list.reversed().forEach(action) fun <T, K> groupBy(list: List<T>, function: (T) -> K): Map<K, List<T>> = list.groupBy(function) fun <T> hasDuplicates(list: List<T>): Boolean = list.toSet().size != list.size tailrec fun <T> hasSubList(list: List<T>, subList: List<T>): Boolean = when { subList.isEmpty() -> true list.isEmpty() -> subList.isEmpty() list.take(subList.size) == subList -> true else -> hasSubList(list.drop(1), subList) } fun <T> head(list: List<T>): T = list.first() fun <T> indexOfAll(list: List<T>, target: T): List<Int> = list.withIndex().filter { it.value == target }.map { it.index } fun <T> initial(list: List<T>): List<T> = list.dropLast(1) fun <T> initialize2DList(width: Int, height: Int, value: T): List<List<T>> = List(height) { List(width) { value } } fun initializeListWithRange(start: Int, stop: Int, step: Int): List<Int> = (start..stop step step).toList() fun <T> initializeListWithValue(size: Int, value: T): List<T> = List(size) { value } fun <T> intersection(first: List<T>, second: List<T>): List<T> = (first intersect second).toList() fun <T, R> intersectionBy(first: List<T>, second: List<T>, function: (T) -> R): List<T> = with(second.toSet().map(function)) { first.filter { contains(function(it)) } } fun <T> intersectionWith(first: List<T>, second: List<T>, function: (T, T) -> Boolean): List<T> = first.filter { a -> second.any { b -> function(a, b) } } fun <T> intersperse(list: List<T>, element: T): List<T> = List(list.size) { index -> listOf(list[index], element) }.flatten().dropLast(1) fun <T> join(list: List<T>, separator: String = ", "): String = list.joinToString(separator) fun <T> last(list: List<T>): T = list.last() fun <T> longest(list: List<Collection<T>>): Collection<T>? = list.maxBy { it.size } fun <T, R> mapObject(list: List<T>, function: (T) -> R): Map<T, R> = list.associateWith(function) fun <T : Comparable<T>> maxN(list: List<T>, n: Int): List<T> = list.sortedDescending().take(n) fun <T : Comparable<T>> minN(list: List<T>, n: Int): List<T> = list.sorted().take(n) fun <T> none(list: List<T>, predicate: (T) -> Boolean): Boolean = list.none(predicate) fun <T> nthElement(list: List<T>, n: Int): T = list[n] fun <T> permutations(list: List<T>): List<List<T>> { fun <T> List<T>.removeAtIndex(index: Int): List<T> = take(index) + drop(index + 1) fun <T> List<T>.prepend(element: T): List<T> = listOf(element) + this return when { list.isEmpty() -> emptyList() list.size == 1 -> listOf(list) else -> list.foldIndexed(mutableListOf()) { index, acc, t -> acc.apply { addAll(permutations(list.removeAtIndex(index)).map { it.prepend(t) }) } } } } fun <T> partition(list: List<T>, predicate: (T) -> Boolean): Pair<List<T>, List<T>> = list.partition(predicate) fun <T> partitioningBy(list: List<T>, predicate: (T) -> Boolean): Map<Boolean, List<T>> = list.groupBy(predicate) fun <T, U, R> product(first: List<T>, second: List<U>, function: (T, U) -> R): List<R> = first.flatMap { t -> second.map { u -> function(t, u) } } fun <T> pull(list: List<T>, vararg elements: T): List<T> = with(elements.toSet()) { list.filterNot { contains(it) } } fun <T> pullAtIndex(list: List<T>, vararg indices: Int): List<T> = with(indices.toSet()) { list.filterIndexed { index, _ -> !contains(index) } } fun <T> pullAtValue(list: List<T>, vararg elements: T): List<T> = with(elements.toSet()) { list.filter { contains(it) } } fun <T, R> reduceSuccessive(list: List<T>, identity: R, function: (R, T) -> R): List<R> { fun <T> List<T>.lastOrElse(t: T): T = lastOrNull() ?: t return list.fold(emptyList()) { acc, t -> acc + function(acc.lastOrElse(identity), t) } } fun <T> reject(list: List<T>, predicate: (T) -> Boolean): List<T> = list.filterNot(predicate) fun <T> remove(list: List<T>, predicate: (T) -> Boolean): List<T> = list.filter(predicate) fun <T> rotateLeft(list: List<T>, n: Int): List<T> = list.drop(n % list.size) + list.take(n % list.size) fun <T> rotateRight(list: List<T>, n: Int): List<T> = list.takeLast(n % list.size) + list.dropLast(n % list.size) fun <T> sample(list: List<T>): T = list.random() fun <T> sampleSize(list: List<T>, n: Int): List<T> = list.shuffled().take(n) fun <T> segmentLength(list: List<T>, predicate: (T) -> Boolean): Int = list.fold(0 to 0) { (longest, current), t -> if (predicate(t)) longest to current + 1 else max(longest, current) to 0 }.first fun <T> shank(list: List<T>, start: Int = 0, deleteCount: Int = 0, vararg elements: T): List<T> = list.slice(0 until start) + elements + list.drop(start + deleteCount) fun <T> shuffle(list: List<T>): List<T> = list.shuffled() fun <T, R> slideBy(list: List<T>, classifier: (T) -> R): List<List<T>> { tailrec fun slideBy_(list: List<T>, acc: MutableList<List<T>>): MutableList<List<T>> = if (list.isEmpty()) acc else slideBy_(list.dropWhile { classifier(it) == classifier(list.first()) }, acc.apply { add(list.takeWhile { classifier(it) == classifier(list.first()) } )} ) return slideBy_(list, mutableListOf()) } fun <T> segmentLength1(list: List<T>, predicate: (T) -> Boolean): Int = list.windowed(max(list.size, 1), partialWindows = true) .map { it.takeWhile(predicate).size } .max() ?: 0 fun <T : Comparable<T>> sortOrder(list: List<T>): Int = with(list.sorted()) { when { this == list -> 1 this.asReversed() == list -> -1 else -> 0 } } fun <T> span(list: List<T>, predicate: (T) -> Boolean): Pair<List<T>, List<T>> = list.takeWhile(predicate) to list.dropWhile(predicate) fun <T> splitAt(list: List<T>, predicate: (T) -> Boolean): Pair<List<T>, List<T>> = list.takeWhile { !predicate(it) } to list.dropWhile { !predicate(it) } fun <T> startsWith(list: List<T>, subList: List<T>): Boolean = list.take(subList.size) == subList fun <T> symmetricDifference(first: List<T>, second: List<T>): List<T> = ((first subtract second) + (second subtract first)).toList() fun <T, R> symmetricDifferenceBy(first: List<T>, second: List<T>, function: (T) -> R): List<T> { val mapFirst = first.toSet().map(function) val mapSecond = second.toSet().map(function) return first.filterNot { mapSecond.contains(function(it)) } + second.filterNot { mapFirst.contains(function(it)) } } fun <T> symmetricDifferenceWith(first: List<T>, second: List<T>, function: (T, T) -> Boolean): List<T> = first.filter { a -> second.none { b -> function(a ,b) } } + second.filter { b -> first.none { a -> function(a, b) } } fun <T> tail(list: List<T>): List<T> = list.drop(1) fun <T> take(list: List<T>, n: Int): List<T> = list.take(n) fun <T> takeRight(list: List<T>, n: Int): List<T> = list.takeLast(n) fun <T> takeRightWhile(list: List<T>, predicate: (T) -> Boolean): List<T> = list.takeLastWhile(predicate) fun <T> takeWhile(list: List<T>, predicate: (T) -> Boolean): List<T> = list.takeWhile(predicate) fun <T> union(first: List<T>, second: List<T>): List<T> = (first union second).toList() fun <T, R> unionBy(first: List<T>, second: List<T>, function: (T) -> R): List<T> { val mapFirst = first.toSet().map(function) return (first.toSet() + second.toSet().filterNot { mapFirst.contains(function(it)) }).toList() } fun <T> unionWith(first: List<T>, second: List<T>, function: (T, T) -> Boolean): List<T> = (first.filter { a -> second.any { b -> function(a, b) } } union second.filter { b -> first.any { a -> function(a, b) } }).toList() fun <T, U> unzip(list: List<Pair<T, U>>): Pair<List<T>, List<U>> = list.unzip() fun <T, U> zip(first: List<T>, second: List<U>): List<Pair<T, U>> = first.zip(second) fun <T, U> zipAll(first: List<T>, defaultT: T, second: List<U>, defaultU: U): List<Pair<T, U>> { val firstIt = first.iterator() val secondIt = second.iterator() return object : Iterator<Pair<T, U>> { override fun hasNext(): Boolean = firstIt.hasNext() || secondIt.hasNext() override fun next(): Pair<T, U> { val t = if (firstIt.hasNext()) firstIt.next() else defaultT val u = if (secondIt.hasNext()) secondIt.next() else defaultU return t to u } }.asSequence().toList() } fun <K, V> zipKeysValues(keys: List<K>, values: List<V>): Map<K, V> = keys.zip(values).toMap() fun <T, U, R> zipWith(first: List<T>, second: List<U>, function: (T, U) -> R): List<R> = first.zip(second).map { (t, u) -> function(t, u) } fun <T> zipWithIndex(list: List<T>): List<Pair<Int, T>> = list.withIndex().map { it.index to it.value } fun <T> zipWithNext(list: List<T>): List<Pair<T, T>> = list.zipWithNext()
[ { "class_path": "ivan-moto__30-seconds-of-kotlin__772896c/ListKt$zipAll$1.class", "javap": "Compiled from \"List.kt\"\npublic final class ListKt$zipAll$1 implements java.util.Iterator<kotlin.Pair<? extends T, ? extends U>>, kotlin.jvm.internal.markers.KMappedMarker {\n final java.util.Iterator<T> $firstIt;\n\n final java.util.Iterator<U> $secondIt;\n\n final T $defaultT;\n\n final U $defaultU;\n\n ListKt$zipAll$1(java.util.Iterator<? extends T>, java.util.Iterator<? extends U>, T, U);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #16 // Field $firstIt:Ljava/util/Iterator;\n 5: aload_0\n 6: aload_2\n 7: putfield #19 // Field $secondIt:Ljava/util/Iterator;\n 10: aload_0\n 11: aload_3\n 12: putfield #23 // Field $defaultT:Ljava/lang/Object;\n 15: aload_0\n 16: aload 4\n 18: putfield #26 // Field $defaultU:Ljava/lang/Object;\n 21: aload_0\n 22: invokespecial #29 // Method java/lang/Object.\"<init>\":()V\n 25: return\n\n public boolean hasNext();\n Code:\n 0: aload_0\n 1: getfield #16 // Field $firstIt:Ljava/util/Iterator;\n 4: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 9: ifne 24\n 12: aload_0\n 13: getfield #19 // Field $secondIt:Ljava/util/Iterator;\n 16: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 21: ifeq 28\n 24: iconst_1\n 25: goto 29\n 28: iconst_0\n 29: ireturn\n\n public kotlin.Pair<T, U> next();\n Code:\n 0: aload_0\n 1: getfield #16 // Field $firstIt:Ljava/util/Iterator;\n 4: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 9: ifeq 24\n 12: aload_0\n 13: getfield #16 // Field $firstIt:Ljava/util/Iterator;\n 16: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 21: goto 28\n 24: aload_0\n 25: getfield #23 // Field $defaultT:Ljava/lang/Object;\n 28: astore_1\n 29: aload_0\n 30: getfield #19 // Field $secondIt:Ljava/util/Iterator;\n 33: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 38: ifeq 53\n 41: aload_0\n 42: getfield #19 // Field $secondIt:Ljava/util/Iterator;\n 45: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 50: goto 57\n 53: aload_0\n 54: getfield #26 // Field $defaultU:Ljava/lang/Object;\n 57: astore_2\n 58: aload_1\n 59: aload_2\n 60: invokestatic #47 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 63: areturn\n\n public void remove();\n Code:\n 0: new #52 // class java/lang/UnsupportedOperationException\n 3: dup\n 4: ldc #54 // String Operation is not supported for read-only collection\n 6: invokespecial #57 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 9: athrow\n\n public java.lang.Object next();\n Code:\n 0: aload_0\n 1: invokevirtual #59 // Method next:()Lkotlin/Pair;\n 4: areturn\n}\n", "javap_err": "" }, { "class_path": "ivan-moto__30-seconds-of-kotlin__772896c/ListKt$countOccurrences$1.class", "javap": "Compiled from \"List.kt\"\nfinal class ListKt$countOccurrences$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.Object, java.lang.Object, java.lang.Boolean> {\n public static final ListKt$countOccurrences$1 INSTANCE;\n\n ListKt$countOccurrences$1();\n Code:\n 0: aload_0\n 1: iconst_2\n 2: ldc #11 // class java/util/Objects\n 4: ldc #13 // String equals\n 6: ldc #15 // String equals(Ljava/lang/Object;Ljava/lang/Object;)Z\n 8: iconst_0\n 9: invokespecial #18 // Method kotlin/jvm/internal/FunctionReferenceImpl.\"<init>\":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V\n 12: return\n\n public final java.lang.Boolean invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_1\n 1: aload_2\n 2: invokestatic #25 // Method java/util/Objects.equals:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 5: invokestatic #31 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;\n 8: areturn\n\n public java.lang.Object invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokevirtual #37 // Method invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Boolean;\n 6: areturn\n\n static {};\n Code:\n 0: new #2 // class ListKt$countOccurrences$1\n 3: dup\n 4: invokespecial #41 // Method \"<init>\":()V\n 7: putstatic #44 // Field INSTANCE:LListKt$countOccurrences$1;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "ivan-moto__30-seconds-of-kotlin__772896c/ListKt$countBy$$inlined$groupingBy$1.class", "javap": "Compiled from \"_Collections.kt\"\npublic final class ListKt$countBy$$inlined$groupingBy$1 implements kotlin.collections.Grouping<T, K> {\n final java.lang.Iterable $this_groupingBy;\n\n final kotlin.jvm.functions.Function1 $keySelector;\n\n public ListKt$countBy$$inlined$groupingBy$1(java.lang.Iterable, kotlin.jvm.functions.Function1);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #20 // Field $this_groupingBy:Ljava/lang/Iterable;\n 5: aload_0\n 6: aload_2\n 7: putfield #22 // Field $keySelector:Lkotlin/jvm/functions/Function1;\n 10: aload_0\n 11: invokespecial #25 // Method java/lang/Object.\"<init>\":()V\n 14: return\n\n public java.util.Iterator<T> sourceIterator();\n Code:\n 0: aload_0\n 1: getfield #20 // Field $this_groupingBy:Ljava/lang/Iterable;\n 4: invokeinterface #36, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 9: areturn\n\n public K keyOf(T);\n Code:\n 0: aload_0\n 1: getfield #22 // Field $keySelector:Lkotlin/jvm/functions/Function1;\n 4: aload_1\n 5: invokeinterface #44, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 10: areturn\n}\n", "javap_err": "" }, { "class_path": "ivan-moto__30-seconds-of-kotlin__772896c/ListKt.class", "javap": "Compiled from \"List.kt\"\npublic final class ListKt {\n public static final <T> boolean all(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: instanceof #22 // class java/util/Collection\n 23: ifeq 42\n 26: aload_2\n 27: checkcast #22 // class java/util/Collection\n 30: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 35: ifeq 42\n 38: iconst_1\n 39: goto 91\n 42: aload_2\n 43: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 4\n 50: aload 4\n 52: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 90\n 60: aload 4\n 62: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 5\n 69: aload_1\n 70: aload 5\n 72: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 77: checkcast #47 // class java/lang/Boolean\n 80: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 83: ifne 50\n 86: iconst_0\n 87: goto 91\n 90: iconst_1\n 91: ireturn\n\n public static final <T> boolean allEqual(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 12: ifeq 19\n 15: iconst_0\n 16: goto 100\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_1\n 24: iconst_0\n 25: istore_2\n 26: aload_1\n 27: instanceof #22 // class java/util/Collection\n 30: ifeq 49\n 33: aload_1\n 34: checkcast #22 // class java/util/Collection\n 37: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 42: ifeq 49\n 45: iconst_1\n 46: goto 100\n 49: aload_1\n 50: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 55: astore_3\n 56: aload_3\n 57: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 62: ifeq 99\n 65: aload_3\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 4\n 73: aload 4\n 75: astore 5\n 77: iconst_0\n 78: istore 6\n 80: aload 5\n 82: aload_0\n 83: iconst_0\n 84: invokeinterface #68, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 89: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 92: ifne 56\n 95: iconst_0\n 96: goto 100\n 99: iconst_1\n 100: ireturn\n\n public static final <T> boolean any(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: instanceof #22 // class java/util/Collection\n 23: ifeq 42\n 26: aload_2\n 27: checkcast #22 // class java/util/Collection\n 30: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 35: ifeq 42\n 38: iconst_0\n 39: goto 91\n 42: aload_2\n 43: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 4\n 50: aload 4\n 52: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 90\n 60: aload 4\n 62: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 5\n 69: aload_1\n 70: aload 5\n 72: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 77: checkcast #47 // class java/lang/Boolean\n 80: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 83: ifeq 50\n 86: iconst_1\n 87: goto 91\n 90: iconst_0\n 91: ireturn\n\n public static final <T> kotlin.Pair<java.util.List<T>, java.util.List<T>> bifurcate(java.util.List<? extends T>, java.util.List<java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #82 // String filter\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 18: aload_1\n 19: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 24: if_icmpne 31\n 27: iconst_1\n 28: goto 32\n 31: iconst_0\n 32: ifne 50\n 35: ldc #88 // String Failed requirement.\n 37: astore_3\n 38: new #90 // class java/lang/IllegalArgumentException\n 41: dup\n 42: aload_3\n 43: invokevirtual #94 // Method java/lang/Object.toString:()Ljava/lang/String;\n 46: invokespecial #98 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 49: athrow\n 50: aload_0\n 51: checkcast #20 // class java/lang/Iterable\n 54: aload_1\n 55: checkcast #20 // class java/lang/Iterable\n 58: invokestatic #104 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 61: checkcast #20 // class java/lang/Iterable\n 64: astore_2\n 65: iconst_0\n 66: istore_3\n 67: new #106 // class java/util/ArrayList\n 70: dup\n 71: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 74: astore 4\n 76: new #106 // class java/util/ArrayList\n 79: dup\n 80: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 83: astore 5\n 85: aload_2\n 86: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 91: astore 6\n 93: aload 6\n 95: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 100: ifeq 157\n 103: aload 6\n 105: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 110: astore 7\n 112: aload 7\n 114: checkcast #111 // class kotlin/Pair\n 117: astore 8\n 119: iconst_0\n 120: istore 9\n 122: aload 8\n 124: invokevirtual #114 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 127: checkcast #47 // class java/lang/Boolean\n 130: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 133: ifeq 146\n 136: aload 4\n 138: aload 7\n 140: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 143: goto 153\n 146: aload 5\n 148: aload 7\n 150: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 153: pop\n 154: goto 93\n 157: new #111 // class kotlin/Pair\n 160: dup\n 161: aload 4\n 163: aload 5\n 165: invokespecial #121 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 168: astore_3\n 169: iconst_0\n 170: istore 4\n 172: aload_3\n 173: invokevirtual #124 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 176: checkcast #60 // class java/util/List\n 179: astore 5\n 181: aload_3\n 182: invokevirtual #127 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 185: checkcast #60 // class java/util/List\n 188: astore 6\n 190: aload 5\n 192: checkcast #20 // class java/lang/Iterable\n 195: astore 7\n 197: iconst_0\n 198: istore 8\n 200: aload 7\n 202: astore 9\n 204: new #106 // class java/util/ArrayList\n 207: dup\n 208: aload 7\n 210: bipush 10\n 212: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 215: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 218: checkcast #22 // class java/util/Collection\n 221: astore 10\n 223: iconst_0\n 224: istore 11\n 226: aload 9\n 228: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 233: astore 12\n 235: aload 12\n 237: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 242: ifeq 285\n 245: aload 12\n 247: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 252: astore 13\n 254: aload 10\n 256: aload 13\n 258: checkcast #111 // class kotlin/Pair\n 261: astore 14\n 263: astore 15\n 265: iconst_0\n 266: istore 16\n 268: aload 14\n 270: invokevirtual #137 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 273: aload 15\n 275: swap\n 276: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 281: pop\n 282: goto 235\n 285: aload 10\n 287: checkcast #60 // class java/util/List\n 290: nop\n 291: aload 6\n 293: checkcast #20 // class java/lang/Iterable\n 296: astore 7\n 298: astore 15\n 300: iconst_0\n 301: istore 8\n 303: aload 7\n 305: astore 9\n 307: new #106 // class java/util/ArrayList\n 310: dup\n 311: aload 7\n 313: bipush 10\n 315: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 318: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 321: checkcast #22 // class java/util/Collection\n 324: astore 10\n 326: iconst_0\n 327: istore 11\n 329: aload 9\n 331: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 336: astore 12\n 338: aload 12\n 340: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 345: ifeq 388\n 348: aload 12\n 350: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 355: astore 13\n 357: aload 10\n 359: aload 13\n 361: checkcast #111 // class kotlin/Pair\n 364: astore 14\n 366: astore 17\n 368: iconst_0\n 369: istore 16\n 371: aload 14\n 373: invokevirtual #137 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 376: aload 17\n 378: swap\n 379: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 384: pop\n 385: goto 338\n 388: aload 10\n 390: checkcast #60 // class java/util/List\n 393: nop\n 394: aload 15\n 396: swap\n 397: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 400: nop\n 401: areturn\n\n public static final <T> kotlin.Pair<java.util.List<T>, java.util.List<T>> bifurcateBy(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #106 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 26: astore 4\n 28: new #106 // class java/util/ArrayList\n 31: dup\n 32: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 35: astore 5\n 37: aload_2\n 38: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 6\n 45: aload 6\n 47: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 102\n 55: aload 6\n 57: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 7\n 64: aload_1\n 65: aload 7\n 67: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 72: checkcast #47 // class java/lang/Boolean\n 75: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 78: ifeq 91\n 81: aload 4\n 83: aload 7\n 85: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 88: goto 98\n 91: aload 5\n 93: aload 7\n 95: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 98: pop\n 99: goto 45\n 102: new #111 // class kotlin/Pair\n 105: dup\n 106: aload 4\n 108: aload 5\n 110: invokespecial #121 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 113: areturn\n\n public static final <T> java.util.List<java.util.List<T>> chunk(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: iload_1\n 11: invokestatic #173 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 14: areturn\n\n public static final <T> java.util.List<java.util.List<T>> combinations(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #178 // class kotlin/NotImplementedError\n 9: dup\n 10: aconst_null\n 11: iconst_1\n 12: aconst_null\n 13: invokespecial #181 // Method kotlin/NotImplementedError.\"<init>\":(Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 16: athrow\n\n public static final <T> java.util.List<T> compact(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: astore_3\n 15: new #106 // class java/util/ArrayList\n 18: dup\n 19: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 22: checkcast #22 // class java/util/Collection\n 25: astore 4\n 27: iconst_0\n 28: istore 5\n 30: aload_3\n 31: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 36: astore 6\n 38: aload 6\n 40: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 45: ifeq 85\n 48: aload 6\n 50: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 55: astore 7\n 57: aload 7\n 59: astore 8\n 61: iconst_0\n 62: istore 9\n 64: aload 8\n 66: invokestatic #186 // Method compact$isTruthy:(Ljava/lang/Object;)Z\n 69: ifeq 38\n 72: aload 4\n 74: aload 7\n 76: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 81: pop\n 82: goto 38\n 85: aload 4\n 87: checkcast #60 // class java/util/List\n 90: nop\n 91: areturn\n\n public static final <T, K> java.util.Map<K, java.lang.Integer> countBy(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends K>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #198 // String function\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #200 // class ListKt$countBy$$inlined$groupingBy$1\n 22: dup\n 23: aload_2\n 24: aload_1\n 25: invokespecial #203 // Method ListKt$countBy$$inlined$groupingBy$1.\"<init>\":(Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)V\n 28: checkcast #205 // class kotlin/collections/Grouping\n 31: invokestatic #211 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;\n 34: areturn\n\n public static final <T> int countOccurrences(java.util.List<? extends T>, T, kotlin.jvm.functions.Function2<? super T, ? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #218 // String equals\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_3\n 17: iconst_0\n 18: istore 4\n 20: aload_3\n 21: instanceof #22 // class java/util/Collection\n 24: ifeq 43\n 27: aload_3\n 28: checkcast #22 // class java/util/Collection\n 31: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 36: ifeq 43\n 39: iconst_0\n 40: goto 114\n 43: iconst_0\n 44: istore 5\n 46: aload_3\n 47: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 6\n 54: aload 6\n 56: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 112\n 64: aload 6\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 7\n 73: aload 7\n 75: astore 8\n 77: iconst_0\n 78: istore 9\n 80: aload_2\n 81: aload_1\n 82: aload 8\n 84: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 89: checkcast #47 // class java/lang/Boolean\n 92: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 95: ifeq 54\n 98: iinc 5, 1\n 101: iload 5\n 103: ifge 54\n 106: invokestatic #226 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 109: goto 54\n 112: iload 5\n 114: ireturn\n\n public static int countOccurrences$default(java.util.List, java.lang.Object, kotlin.jvm.functions.Function2, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_4\n 2: iand\n 3: ifeq 13\n 6: getstatic #240 // Field ListKt$countOccurrences$1.INSTANCE:LListKt$countOccurrences$1;\n 9: checkcast #220 // class kotlin/jvm/functions/Function2\n 12: astore_2\n 13: aload_0\n 14: aload_1\n 15: aload_2\n 16: invokestatic #242 // Method countOccurrences:(Ljava/util/List;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)I\n 19: ireturn\n\n public static final <T> java.util.List<T> concat(java.util.List<? extends T>, java.util.List<? extends T>...);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #249 // String others\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: invokestatic #253 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;\n 19: aload_1\n 20: invokestatic #258 // Method kotlin/collections/ArraysKt.asSequence:([Ljava/lang/Object;)Lkotlin/sequences/Sequence;\n 23: invokestatic #264 // Method kotlin/sequences/SequencesKt.flattenSequenceOfIterable:(Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;\n 26: invokestatic #268 // Method kotlin/sequences/SequencesKt.plus:(Lkotlin/sequences/Sequence;Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;\n 29: invokestatic #272 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;\n 32: areturn\n\n public static final <T, U> boolean corresponds(java.util.List<? extends T>, java.util.List<? extends U>, kotlin.jvm.functions.Function2<? super T, ? super U, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #18 // String predicate\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 25: aload_1\n 26: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 31: if_icmpne 157\n 34: aload_0\n 35: checkcast #20 // class java/lang/Iterable\n 38: aload_1\n 39: checkcast #20 // class java/lang/Iterable\n 42: invokestatic #104 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 45: checkcast #20 // class java/lang/Iterable\n 48: astore_3\n 49: iconst_0\n 50: istore 4\n 52: aload_3\n 53: instanceof #22 // class java/util/Collection\n 56: ifeq 75\n 59: aload_3\n 60: checkcast #22 // class java/util/Collection\n 63: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 68: ifeq 75\n 71: iconst_1\n 72: goto 150\n 75: aload_3\n 76: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 81: astore 5\n 83: aload 5\n 85: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 90: ifeq 149\n 93: aload 5\n 95: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 100: astore 6\n 102: aload 6\n 104: checkcast #111 // class kotlin/Pair\n 107: astore 7\n 109: iconst_0\n 110: istore 8\n 112: aload 7\n 114: invokevirtual #124 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 117: astore 9\n 119: aload 7\n 121: invokevirtual #127 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 124: astore 10\n 126: aload_2\n 127: aload 9\n 129: aload 10\n 131: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 136: checkcast #47 // class java/lang/Boolean\n 139: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 142: ifne 83\n 145: iconst_0\n 146: goto 150\n 149: iconst_1\n 150: ifeq 157\n 153: iconst_1\n 154: goto 158\n 157: iconst_0\n 158: ireturn\n\n public static final <T, U> java.util.List<kotlin.Pair<T, U>> crossProduct(java.util.List<? extends T>, java.util.List<? extends U>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: astore_2\n 18: iconst_0\n 19: istore_3\n 20: aload_2\n 21: astore 4\n 23: new #106 // class java/util/ArrayList\n 26: dup\n 27: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 30: checkcast #22 // class java/util/Collection\n 33: astore 5\n 35: iconst_0\n 36: istore 6\n 38: aload 4\n 40: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 7\n 47: aload 7\n 49: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 189\n 57: aload 7\n 59: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 8\n 66: aload 8\n 68: astore 9\n 70: iconst_0\n 71: istore 10\n 73: aload_1\n 74: checkcast #20 // class java/lang/Iterable\n 77: astore 11\n 79: iconst_0\n 80: istore 12\n 82: aload 11\n 84: astore 13\n 86: new #106 // class java/util/ArrayList\n 89: dup\n 90: aload 11\n 92: bipush 10\n 94: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 97: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 100: checkcast #22 // class java/util/Collection\n 103: astore 14\n 105: iconst_0\n 106: istore 15\n 108: aload 13\n 110: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 115: astore 16\n 117: aload 16\n 119: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 124: ifeq 166\n 127: aload 16\n 129: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 134: astore 17\n 136: aload 14\n 138: aload 17\n 140: astore 18\n 142: astore 19\n 144: iconst_0\n 145: istore 20\n 147: aload 9\n 149: aload 18\n 151: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 154: aload 19\n 156: swap\n 157: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 162: pop\n 163: goto 117\n 166: aload 14\n 168: checkcast #60 // class java/util/List\n 171: nop\n 172: checkcast #20 // class java/lang/Iterable\n 175: nop\n 176: astore 9\n 178: aload 5\n 180: aload 9\n 182: invokestatic #288 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 185: pop\n 186: goto 47\n 189: aload 5\n 191: checkcast #60 // class java/util/List\n 194: nop\n 195: areturn\n\n public static final <T> kotlin.sequences.Sequence<T> cycle(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #22 // class java/util/Collection\n 10: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 15: ifne 22\n 18: iconst_1\n 19: goto 23\n 22: iconst_0\n 23: ifeq 33\n 26: iconst_0\n 27: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 30: goto 34\n 33: aconst_null\n 34: aload_0\n 35: invokedynamic #324, 0 // InvokeDynamic #0:invoke:(Ljava/util/List;)Lkotlin/jvm/functions/Function1;\n 40: invokestatic #328 // Method kotlin/sequences/SequencesKt.generateSequence:(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 43: aload_0\n 44: invokedynamic #336, 0 // InvokeDynamic #1:invoke:(Ljava/util/List;)Lkotlin/jvm/functions/Function1;\n 49: invokestatic #340 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 52: areturn\n\n public static final <T> java.util.List<T> difference(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: checkcast #20 // class java/lang/Iterable\n 21: invokestatic #346 // Method kotlin/collections/CollectionsKt.subtract:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 24: checkcast #20 // class java/lang/Iterable\n 27: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 30: areturn\n\n public static final <T, R> java.util.List<T> differenceBy(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_1\n 20: checkcast #20 // class java/lang/Iterable\n 23: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 26: checkcast #20 // class java/lang/Iterable\n 29: astore_3\n 30: iconst_0\n 31: istore 4\n 33: aload_3\n 34: astore 5\n 36: new #106 // class java/util/ArrayList\n 39: dup\n 40: aload_3\n 41: bipush 10\n 43: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 46: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 49: checkcast #22 // class java/util/Collection\n 52: astore 6\n 54: iconst_0\n 55: istore 7\n 57: aload 5\n 59: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 64: astore 8\n 66: aload 8\n 68: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 73: ifeq 104\n 76: aload 8\n 78: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 83: astore 9\n 85: aload 6\n 87: aload_2\n 88: aload 9\n 90: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 95: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 100: pop\n 101: goto 66\n 104: aload 6\n 106: checkcast #60 // class java/util/List\n 109: nop\n 110: astore 4\n 112: iconst_0\n 113: istore 5\n 115: aload_0\n 116: checkcast #20 // class java/lang/Iterable\n 119: astore 6\n 121: iconst_0\n 122: istore 7\n 124: aload 6\n 126: astore 8\n 128: new #106 // class java/util/ArrayList\n 131: dup\n 132: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 135: checkcast #22 // class java/util/Collection\n 138: astore 9\n 140: iconst_0\n 141: istore 10\n 143: aload 8\n 145: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 150: astore 11\n 152: aload 11\n 154: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 159: ifeq 209\n 162: aload 11\n 164: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 169: astore 12\n 171: aload 12\n 173: astore 13\n 175: iconst_0\n 176: istore 14\n 178: aload 4\n 180: aload_2\n 181: aload 13\n 183: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 188: invokeinterface #359, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 193: ifne 152\n 196: aload 9\n 198: aload 12\n 200: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 205: pop\n 206: goto 152\n 209: aload 9\n 211: checkcast #60 // class java/util/List\n 214: nop\n 215: nop\n 216: nop\n 217: areturn\n\n public static final <T> java.util.List<T> differenceWith(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function2<? super T, ? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_3\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #106 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #22 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 190\n 64: aload 8\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 9\n 75: astore 10\n 77: iconst_0\n 78: istore 11\n 80: aload_1\n 81: checkcast #20 // class java/lang/Iterable\n 84: astore 12\n 86: iconst_0\n 87: istore 13\n 89: aload 12\n 91: instanceof #22 // class java/util/Collection\n 94: ifeq 114\n 97: aload 12\n 99: checkcast #22 // class java/util/Collection\n 102: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 107: ifeq 114\n 110: iconst_1\n 111: goto 173\n 114: aload 12\n 116: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 14\n 123: aload 14\n 125: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifeq 172\n 133: aload 14\n 135: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 140: astore 15\n 142: aload 15\n 144: astore 16\n 146: iconst_0\n 147: istore 17\n 149: aload_2\n 150: aload 10\n 152: aload 16\n 154: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 159: checkcast #47 // class java/lang/Boolean\n 162: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 165: ifeq 123\n 168: iconst_0\n 169: goto 173\n 172: iconst_1\n 173: nop\n 174: ifeq 54\n 177: aload 6\n 179: aload 9\n 181: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 186: pop\n 187: goto 54\n 190: aload 6\n 192: checkcast #60 // class java/util/List\n 195: nop\n 196: areturn\n\n public static final <T> java.util.List<T> distinct(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #376 // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: areturn\n\n public static final <T> java.util.List<T> drop(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: iload_1\n 11: invokestatic #380 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 14: areturn\n\n public static final <T> java.util.List<T> dropRight(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_1\n 8: invokestatic #385 // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;\n 11: areturn\n\n public static final <T> java.util.List<T> dropRightWhile(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 22: ifne 90\n 25: aload_2\n 26: aload_2\n 27: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 32: invokeinterface #392, 2 // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;\n 37: astore 4\n 39: aload 4\n 41: invokeinterface #397, 1 // InterfaceMethod java/util/ListIterator.hasPrevious:()Z\n 46: ifeq 90\n 49: aload_1\n 50: aload 4\n 52: invokeinterface #400, 1 // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;\n 57: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 62: checkcast #47 // class java/lang/Boolean\n 65: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 68: ifne 39\n 71: aload_2\n 72: checkcast #20 // class java/lang/Iterable\n 75: aload 4\n 77: invokeinterface #403, 1 // InterfaceMethod java/util/ListIterator.nextIndex:()I\n 82: iconst_1\n 83: iadd\n 84: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 87: goto 93\n 90: invokestatic #410 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 93: areturn\n\n public static final <T> java.util.List<T> dropWhile(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: iconst_0\n 20: istore 4\n 22: new #106 // class java/util/ArrayList\n 25: dup\n 26: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 29: astore 5\n 31: aload_2\n 32: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 37: astore 6\n 39: aload 6\n 41: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 46: ifeq 105\n 49: aload 6\n 51: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 56: astore 7\n 58: iload 4\n 60: ifeq 74\n 63: aload 5\n 65: aload 7\n 67: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 70: pop\n 71: goto 39\n 74: aload_1\n 75: aload 7\n 77: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 82: checkcast #47 // class java/lang/Boolean\n 85: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 88: ifne 39\n 91: aload 5\n 93: aload 7\n 95: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 98: pop\n 99: iconst_1\n 100: istore 4\n 102: goto 39\n 105: aload 5\n 107: checkcast #60 // class java/util/List\n 110: areturn\n\n public static final <T> boolean endsWith(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #426 // String subList\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: aload_1\n 15: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 20: invokestatic #429 // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;\n 23: aload_1\n 24: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 27: ireturn\n\n public static final <T> java.util.List<T> everyNth(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: iload_1\n 11: iload_1\n 12: iconst_0\n 13: invokestatic #434 // Method kotlin/collections/CollectionsKt.windowed:(Ljava/lang/Iterable;IIZ)Ljava/util/List;\n 16: checkcast #20 // class java/lang/Iterable\n 19: astore_2\n 20: iconst_0\n 21: istore_3\n 22: aload_2\n 23: astore 4\n 25: new #106 // class java/util/ArrayList\n 28: dup\n 29: aload_2\n 30: bipush 10\n 32: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 35: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 38: checkcast #22 // class java/util/Collection\n 41: astore 5\n 43: iconst_0\n 44: istore 6\n 46: aload 4\n 48: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 53: astore 7\n 55: aload 7\n 57: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 62: ifeq 105\n 65: aload 7\n 67: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 72: astore 8\n 74: aload 5\n 76: aload 8\n 78: checkcast #60 // class java/util/List\n 81: astore 9\n 83: astore 11\n 85: iconst_0\n 86: istore 10\n 88: aload 9\n 90: invokestatic #438 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 93: aload 11\n 95: swap\n 96: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 101: pop\n 102: goto 55\n 105: aload 5\n 107: checkcast #60 // class java/util/List\n 110: nop\n 111: areturn\n\n public static final <T> boolean existsUnique(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: iconst_0\n 13: istore_2\n 14: aload_0\n 15: invokeinterface #442, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 20: astore_3\n 21: aload_3\n 22: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 27: ifeq 66\n 30: aload_3\n 31: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 36: astore 4\n 38: aload_1\n 39: aload 4\n 41: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 46: checkcast #47 // class java/lang/Boolean\n 49: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 52: ifeq 21\n 55: iload_2\n 56: ifeq 61\n 59: iconst_0\n 60: ireturn\n 61: iconst_1\n 62: istore_2\n 63: goto 21\n 66: iload_2\n 67: ireturn\n\n public static final <T> java.util.List<T> filterNonUnique(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #376 // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: areturn\n\n public static final <T, K> java.util.List<T> filterNonUniqueBy(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends K>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #198 // String function\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #448 // class java/util/HashSet\n 22: dup\n 23: invokespecial #449 // Method java/util/HashSet.\"<init>\":()V\n 26: astore 4\n 28: new #106 // class java/util/ArrayList\n 31: dup\n 32: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 35: astore 5\n 37: aload_2\n 38: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 6\n 45: aload 6\n 47: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 95\n 55: aload 6\n 57: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 7\n 64: aload_1\n 65: aload 7\n 67: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 72: astore 8\n 74: aload 4\n 76: aload 8\n 78: invokevirtual #450 // Method java/util/HashSet.add:(Ljava/lang/Object;)Z\n 81: ifeq 45\n 84: aload 5\n 86: aload 7\n 88: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 91: pop\n 92: goto 45\n 95: aload 5\n 97: checkcast #60 // class java/util/List\n 100: areturn\n\n public static final <T> T findLast(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: astore_2\n 14: aload_2\n 15: aload_2\n 16: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 21: invokeinterface #392, 2 // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;\n 26: astore_3\n 27: aload_3\n 28: invokeinterface #397, 1 // InterfaceMethod java/util/ListIterator.hasPrevious:()Z\n 33: ifeq 66\n 36: aload_3\n 37: invokeinterface #400, 1 // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;\n 42: astore 4\n 44: aload_1\n 45: aload 4\n 47: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 52: checkcast #47 // class java/lang/Boolean\n 55: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 58: ifeq 27\n 61: aload 4\n 63: goto 67\n 66: aconst_null\n 67: areturn\n\n public static final <T> int findLastIndex(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: aload_2\n 18: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 23: invokeinterface #392, 2 // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;\n 28: astore 4\n 30: aload 4\n 32: invokeinterface #397, 1 // InterfaceMethod java/util/ListIterator.hasPrevious:()Z\n 37: ifeq 72\n 40: aload_1\n 41: aload 4\n 43: invokeinterface #400, 1 // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;\n 48: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 53: checkcast #47 // class java/lang/Boolean\n 56: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 59: ifeq 30\n 62: aload 4\n 64: invokeinterface #403, 1 // InterfaceMethod java/util/ListIterator.nextIndex:()I\n 69: goto 73\n 72: iconst_m1\n 73: ireturn\n\n public static final <T> void forEachRight(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, kotlin.Unit>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #470 // String action\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: invokestatic #473 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_2\n 24: iconst_0\n 25: istore_3\n 26: aload_2\n 27: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 32: astore 4\n 34: aload 4\n 36: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 41: ifeq 65\n 44: aload 4\n 46: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 51: astore 5\n 53: aload_1\n 54: aload 5\n 56: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 61: pop\n 62: goto 34\n 65: nop\n 66: return\n\n public static final <T, K> java.util.Map<K, java.util.List<T>> groupBy(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends K>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #198 // String function\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: astore 4\n 22: new #479 // class java/util/LinkedHashMap\n 25: dup\n 26: invokespecial #480 // Method java/util/LinkedHashMap.\"<init>\":()V\n 29: checkcast #482 // class java/util/Map\n 32: astore 5\n 34: iconst_0\n 35: istore 6\n 37: aload 4\n 39: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 7\n 46: aload 7\n 48: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 151\n 56: aload 7\n 58: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 8\n 65: aload_1\n 66: aload 8\n 68: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 73: astore 9\n 75: aload 5\n 77: astore 10\n 79: iconst_0\n 80: istore 11\n 82: aload 10\n 84: aload 9\n 86: invokeinterface #484, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 91: astore 12\n 93: aload 12\n 95: ifnonnull 130\n 98: iconst_0\n 99: istore 13\n 101: new #106 // class java/util/ArrayList\n 104: dup\n 105: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 108: checkcast #60 // class java/util/List\n 111: astore 13\n 113: aload 10\n 115: aload 9\n 117: aload 13\n 119: invokeinterface #487, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 124: pop\n 125: aload 13\n 127: goto 132\n 130: aload 12\n 132: nop\n 133: checkcast #60 // class java/util/List\n 136: astore 14\n 138: aload 14\n 140: aload 8\n 142: invokeinterface #488, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 147: pop\n 148: goto 46\n 151: aload 5\n 153: nop\n 154: areturn\n\n public static final <T> boolean hasDuplicates(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 13: invokeinterface #503, 1 // InterfaceMethod java/util/Set.size:()I\n 18: aload_0\n 19: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 24: if_icmpeq 31\n 27: iconst_1\n 28: goto 32\n 31: iconst_0\n 32: ireturn\n\n public static final <T> boolean hasSubList(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #426 // String subList\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: nop\n 14: aload_1\n 15: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 20: ifeq 27\n 23: iconst_1\n 24: goto 87\n 27: aload_0\n 28: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 33: ifeq 45\n 36: aload_1\n 37: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 42: goto 87\n 45: aload_0\n 46: checkcast #20 // class java/lang/Iterable\n 49: aload_1\n 50: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 55: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 58: aload_1\n 59: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 62: ifeq 69\n 65: iconst_1\n 66: goto 87\n 69: aload_0\n 70: checkcast #20 // class java/lang/Iterable\n 73: iconst_1\n 74: invokestatic #380 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 77: astore_2\n 78: aload_1\n 79: astore_3\n 80: aload_2\n 81: astore_0\n 82: aload_3\n 83: astore_1\n 84: goto 13\n 87: ireturn\n\n public static final <T> T head(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #508 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: areturn\n\n public static final <T> java.util.List<java.lang.Integer> indexOfAll(java.util.List<? extends T>, T);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #515 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: astore 4\n 19: new #106 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 26: checkcast #22 // class java/util/Collection\n 29: astore 5\n 31: iconst_0\n 32: istore 6\n 34: aload 4\n 36: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 7\n 43: aload 7\n 45: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 97\n 53: aload 7\n 55: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 8\n 62: aload 8\n 64: checkcast #517 // class kotlin/collections/IndexedValue\n 67: astore 9\n 69: iconst_0\n 70: istore 10\n 72: aload 9\n 74: invokevirtual #520 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 77: aload_1\n 78: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 81: ifeq 43\n 84: aload 5\n 86: aload 8\n 88: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 93: pop\n 94: goto 43\n 97: aload 5\n 99: checkcast #60 // class java/util/List\n 102: nop\n 103: checkcast #20 // class java/lang/Iterable\n 106: astore_2\n 107: nop\n 108: iconst_0\n 109: istore_3\n 110: aload_2\n 111: astore 4\n 113: new #106 // class java/util/ArrayList\n 116: dup\n 117: aload_2\n 118: bipush 10\n 120: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 123: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 126: checkcast #22 // class java/util/Collection\n 129: astore 5\n 131: iconst_0\n 132: istore 6\n 134: aload 4\n 136: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 141: astore 7\n 143: aload 7\n 145: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 150: ifeq 196\n 153: aload 7\n 155: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 160: astore 8\n 162: aload 5\n 164: aload 8\n 166: checkcast #517 // class kotlin/collections/IndexedValue\n 169: astore 9\n 171: astore 11\n 173: iconst_0\n 174: istore 10\n 176: aload 9\n 178: invokevirtual #523 // Method kotlin/collections/IndexedValue.getIndex:()I\n 181: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 184: aload 11\n 186: swap\n 187: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 192: pop\n 193: goto 143\n 196: aload 5\n 198: checkcast #60 // class java/util/List\n 201: nop\n 202: areturn\n\n public static final <T> java.util.List<T> initial(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iconst_1\n 8: invokestatic #385 // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;\n 11: areturn\n\n public static final <T> java.util.List<java.util.List<T>> initialize2DList(int, int, T);\n Code:\n 0: new #106 // class java/util/ArrayList\n 3: dup\n 4: iload_1\n 5: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 8: astore_3\n 9: iconst_0\n 10: istore 4\n 12: iload 4\n 14: iload_1\n 15: if_icmpge 99\n 18: iload 4\n 20: istore 5\n 22: aload_3\n 23: iload 5\n 25: istore 6\n 27: astore 14\n 29: iconst_0\n 30: istore 7\n 32: new #106 // class java/util/ArrayList\n 35: dup\n 36: iload_0\n 37: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 40: astore 8\n 42: iconst_0\n 43: istore 9\n 45: iload 9\n 47: iload_0\n 48: if_icmpge 80\n 51: iload 9\n 53: istore 10\n 55: aload 8\n 57: iload 10\n 59: istore 11\n 61: astore 12\n 63: iconst_0\n 64: istore 13\n 66: aload_2\n 67: aload 12\n 69: swap\n 70: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 73: pop\n 74: iinc 9, 1\n 77: goto 45\n 80: aload 8\n 82: checkcast #60 // class java/util/List\n 85: nop\n 86: aload 14\n 88: swap\n 89: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 92: pop\n 93: iinc 4, 1\n 96: goto 12\n 99: aload_3\n 100: checkcast #60 // class java/util/List\n 103: areturn\n\n public static final java.util.List<java.lang.Integer> initializeListWithRange(int, int, int);\n Code:\n 0: new #540 // class kotlin/ranges/IntRange\n 3: dup\n 4: iload_0\n 5: iload_1\n 6: invokespecial #543 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 9: checkcast #545 // class kotlin/ranges/IntProgression\n 12: iload_2\n 13: invokestatic #551 // Method kotlin/ranges/RangesKt.step:(Lkotlin/ranges/IntProgression;I)Lkotlin/ranges/IntProgression;\n 16: checkcast #20 // class java/lang/Iterable\n 19: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 22: areturn\n\n public static final <T> java.util.List<T> initializeListWithValue(int, T);\n Code:\n 0: new #106 // class java/util/ArrayList\n 3: dup\n 4: iload_0\n 5: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 8: astore_2\n 9: iconst_0\n 10: istore_3\n 11: iload_3\n 12: iload_0\n 13: if_icmpge 43\n 16: iload_3\n 17: istore 4\n 19: aload_2\n 20: iload 4\n 22: istore 5\n 24: astore 7\n 26: iconst_0\n 27: istore 6\n 29: aload_1\n 30: aload 7\n 32: swap\n 33: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 36: pop\n 37: iinc 3, 1\n 40: goto 11\n 43: aload_2\n 44: checkcast #60 // class java/util/List\n 47: areturn\n\n public static final <T> java.util.List<T> intersection(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: checkcast #20 // class java/lang/Iterable\n 21: invokestatic #561 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 24: checkcast #20 // class java/lang/Iterable\n 27: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 30: areturn\n\n public static final <T, R> java.util.List<T> intersectionBy(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_1\n 20: checkcast #20 // class java/lang/Iterable\n 23: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 26: checkcast #20 // class java/lang/Iterable\n 29: astore_3\n 30: iconst_0\n 31: istore 4\n 33: aload_3\n 34: astore 5\n 36: new #106 // class java/util/ArrayList\n 39: dup\n 40: aload_3\n 41: bipush 10\n 43: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 46: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 49: checkcast #22 // class java/util/Collection\n 52: astore 6\n 54: iconst_0\n 55: istore 7\n 57: aload 5\n 59: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 64: astore 8\n 66: aload 8\n 68: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 73: ifeq 104\n 76: aload 8\n 78: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 83: astore 9\n 85: aload 6\n 87: aload_2\n 88: aload 9\n 90: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 95: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 100: pop\n 101: goto 66\n 104: aload 6\n 106: checkcast #60 // class java/util/List\n 109: nop\n 110: astore 4\n 112: iconst_0\n 113: istore 5\n 115: aload_0\n 116: checkcast #20 // class java/lang/Iterable\n 119: astore 6\n 121: iconst_0\n 122: istore 7\n 124: aload 6\n 126: astore 8\n 128: new #106 // class java/util/ArrayList\n 131: dup\n 132: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 135: checkcast #22 // class java/util/Collection\n 138: astore 9\n 140: iconst_0\n 141: istore 10\n 143: aload 8\n 145: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 150: astore 11\n 152: aload 11\n 154: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 159: ifeq 209\n 162: aload 11\n 164: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 169: astore 12\n 171: aload 12\n 173: astore 13\n 175: iconst_0\n 176: istore 14\n 178: aload 4\n 180: aload_2\n 181: aload 13\n 183: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 188: invokeinterface #359, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 193: ifeq 152\n 196: aload 9\n 198: aload 12\n 200: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 205: pop\n 206: goto 152\n 209: aload 9\n 211: checkcast #60 // class java/util/List\n 214: nop\n 215: nop\n 216: nop\n 217: areturn\n\n public static final <T> java.util.List<T> intersectionWith(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function2<? super T, ? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_3\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #106 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #22 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 190\n 64: aload 8\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 9\n 75: astore 10\n 77: iconst_0\n 78: istore 11\n 80: aload_1\n 81: checkcast #20 // class java/lang/Iterable\n 84: astore 12\n 86: iconst_0\n 87: istore 13\n 89: aload 12\n 91: instanceof #22 // class java/util/Collection\n 94: ifeq 114\n 97: aload 12\n 99: checkcast #22 // class java/util/Collection\n 102: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 107: ifeq 114\n 110: iconst_0\n 111: goto 173\n 114: aload 12\n 116: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 14\n 123: aload 14\n 125: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifeq 172\n 133: aload 14\n 135: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 140: astore 15\n 142: aload 15\n 144: astore 16\n 146: iconst_0\n 147: istore 17\n 149: aload_2\n 150: aload 10\n 152: aload 16\n 154: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 159: checkcast #47 // class java/lang/Boolean\n 162: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 165: ifeq 123\n 168: iconst_1\n 169: goto 173\n 172: iconst_0\n 173: nop\n 174: ifeq 54\n 177: aload 6\n 179: aload 9\n 181: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 186: pop\n 187: goto 54\n 190: aload 6\n 192: checkcast #60 // class java/util/List\n 195: nop\n 196: areturn\n\n public static final <T> java.util.List<T> intersperse(java.util.List<? extends T>, T);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 12: istore_2\n 13: new #106 // class java/util/ArrayList\n 16: dup\n 17: iload_2\n 18: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 21: astore_3\n 22: iconst_0\n 23: istore 4\n 25: iload 4\n 27: iload_2\n 28: if_icmpge 86\n 31: iload 4\n 33: istore 5\n 35: aload_3\n 36: iload 5\n 38: istore 6\n 40: astore 9\n 42: iconst_0\n 43: istore 7\n 45: iconst_2\n 46: anewarray #4 // class java/lang/Object\n 49: astore 8\n 51: aload 8\n 53: iconst_0\n 54: aload_0\n 55: iload 6\n 57: invokeinterface #68, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 62: aastore\n 63: aload 8\n 65: iconst_1\n 66: aload_1\n 67: aastore\n 68: aload 8\n 70: invokestatic #574 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 73: aload 9\n 75: swap\n 76: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 79: pop\n 80: iinc 4, 1\n 83: goto 25\n 86: aload_3\n 87: checkcast #60 // class java/util/List\n 90: checkcast #20 // class java/lang/Iterable\n 93: invokestatic #577 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;\n 96: iconst_1\n 97: invokestatic #385 // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;\n 100: areturn\n\n public static final <T> java.lang.String join(java.util.List<? extends T>, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #585 // String separator\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: checkcast #587 // class java/lang/CharSequence\n 21: aconst_null\n 22: aconst_null\n 23: iconst_0\n 24: aconst_null\n 25: aconst_null\n 26: bipush 62\n 28: aconst_null\n 29: invokestatic #591 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 32: areturn\n\n public static java.lang.String join$default(java.util.List, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_2\n 2: iand\n 3: ifeq 10\n 6: ldc_w #596 // String ,\n 9: astore_1\n 10: aload_0\n 11: aload_1\n 12: invokestatic #598 // Method join:(Ljava/util/List;Ljava/lang/String;)Ljava/lang/String;\n 15: areturn\n\n public static final <T> T last(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #438 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 10: areturn\n\n public static final <T> java.util.Collection<T> longest(java.util.List<? extends java.util.Collection<? extends T>>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 19: astore_3\n 20: aload_3\n 21: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 26: ifne 37\n 29: new #603 // class java/util/NoSuchElementException\n 32: dup\n 33: invokespecial #604 // Method java/util/NoSuchElementException.\"<init>\":()V\n 36: athrow\n 37: aload_3\n 38: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 43: astore 4\n 45: aload_3\n 46: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 51: ifne 59\n 54: aload 4\n 56: goto 131\n 59: aload 4\n 61: checkcast #22 // class java/util/Collection\n 64: astore 5\n 66: iconst_0\n 67: istore 6\n 69: aload 5\n 71: invokeinterface #605, 1 // InterfaceMethod java/util/Collection.size:()I\n 76: istore 5\n 78: aload_3\n 79: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 6\n 86: aload 6\n 88: checkcast #22 // class java/util/Collection\n 91: astore 7\n 93: iconst_0\n 94: istore 8\n 96: aload 7\n 98: invokeinterface #605, 1 // InterfaceMethod java/util/Collection.size:()I\n 103: istore 7\n 105: iload 5\n 107: iload 7\n 109: if_icmpge 120\n 112: aload 6\n 114: astore 4\n 116: iload 7\n 118: istore 5\n 120: aload_3\n 121: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 126: ifne 78\n 129: aload 4\n 131: checkcast #22 // class java/util/Collection\n 134: areturn\n\n public static final <T, R> java.util.Map<T, R> mapObject(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #198 // String function\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #479 // class java/util/LinkedHashMap\n 22: dup\n 23: aload_2\n 24: bipush 10\n 26: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 29: invokestatic #620 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 32: bipush 16\n 34: invokestatic #624 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 37: invokespecial #625 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 40: astore 4\n 42: aload_2\n 43: astore 5\n 45: iconst_0\n 46: istore 6\n 48: aload 5\n 50: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 55: astore 7\n 57: aload 7\n 59: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 64: ifeq 100\n 67: aload 7\n 69: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 74: astore 8\n 76: aload 4\n 78: checkcast #482 // class java/util/Map\n 81: aload 8\n 83: aload_1\n 84: aload 8\n 86: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 91: invokeinterface #487, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 96: pop\n 97: goto 57\n 100: aload 4\n 102: checkcast #482 // class java/util/Map\n 105: nop\n 106: areturn\n\n public static final <T extends java.lang.Comparable<? super T>> java.util.List<T> maxN(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #636 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: checkcast #20 // class java/lang/Iterable\n 16: iload_1\n 17: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 20: areturn\n\n public static final <T extends java.lang.Comparable<? super T>> java.util.List<T> minN(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #640 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: checkcast #20 // class java/lang/Iterable\n 16: iload_1\n 17: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 20: areturn\n\n public static final <T> boolean none(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: instanceof #22 // class java/util/Collection\n 23: ifeq 42\n 26: aload_2\n 27: checkcast #22 // class java/util/Collection\n 30: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 35: ifeq 42\n 38: iconst_1\n 39: goto 91\n 42: aload_2\n 43: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 4\n 50: aload 4\n 52: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 90\n 60: aload 4\n 62: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 5\n 69: aload_1\n 70: aload 5\n 72: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 77: checkcast #47 // class java/lang/Boolean\n 80: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 83: ifeq 50\n 86: iconst_0\n 87: goto 91\n 90: iconst_1\n 91: ireturn\n\n public static final <T> T nthElement(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_1\n 8: invokeinterface #68, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: areturn\n\n public static final <T> java.util.List<java.util.List<T>> permutations(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: nop\n 7: aload_0\n 8: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 13: ifeq 22\n 16: invokestatic #410 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 19: goto 269\n 22: aload_0\n 23: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 28: iconst_1\n 29: if_icmpne 39\n 32: aload_0\n 33: invokestatic #647 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 36: goto 269\n 39: aload_0\n 40: checkcast #20 // class java/lang/Iterable\n 43: astore_1\n 44: new #106 // class java/util/ArrayList\n 47: dup\n 48: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 51: checkcast #60 // class java/util/List\n 54: astore_2\n 55: nop\n 56: iconst_0\n 57: istore_3\n 58: iconst_0\n 59: istore 4\n 61: aload_2\n 62: astore 5\n 64: aload_1\n 65: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 70: astore 6\n 72: aload 6\n 74: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 79: ifeq 267\n 82: aload 6\n 84: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 89: astore 7\n 91: iload 4\n 93: iinc 4, 1\n 96: istore 8\n 98: iload 8\n 100: ifge 106\n 103: invokestatic #650 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 106: iload 8\n 108: aload 5\n 110: aload 7\n 112: astore 9\n 114: astore 10\n 116: istore 11\n 118: iconst_0\n 119: istore 12\n 121: aload 10\n 123: astore 13\n 125: aload 13\n 127: astore 14\n 129: iconst_0\n 130: istore 15\n 132: aload 14\n 134: aload_0\n 135: iload 11\n 137: invokestatic #653 // Method permutations$removeAtIndex:(Ljava/util/List;I)Ljava/util/List;\n 140: invokestatic #655 // Method permutations:(Ljava/util/List;)Ljava/util/List;\n 143: checkcast #20 // class java/lang/Iterable\n 146: astore 16\n 148: astore 17\n 150: iconst_0\n 151: istore 18\n 153: aload 16\n 155: astore 19\n 157: new #106 // class java/util/ArrayList\n 160: dup\n 161: aload 16\n 163: bipush 10\n 165: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 168: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 171: checkcast #22 // class java/util/Collection\n 174: astore 20\n 176: iconst_0\n 177: istore 21\n 179: aload 19\n 181: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 186: astore 22\n 188: aload 22\n 190: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 195: ifeq 240\n 198: aload 22\n 200: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 205: astore 23\n 207: aload 20\n 209: aload 23\n 211: checkcast #60 // class java/util/List\n 214: astore 24\n 216: astore 25\n 218: iconst_0\n 219: istore 26\n 221: aload 24\n 223: aload 9\n 225: invokestatic #658 // Method permutations$prepend:(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;\n 228: aload 25\n 230: swap\n 231: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 236: pop\n 237: goto 188\n 240: aload 20\n 242: checkcast #60 // class java/util/List\n 245: nop\n 246: aload 17\n 248: swap\n 249: checkcast #22 // class java/util/Collection\n 252: invokeinterface #661, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 257: pop\n 258: nop\n 259: aload 13\n 261: nop\n 262: astore 5\n 264: goto 72\n 267: aload 5\n 269: areturn\n\n public static final <T> kotlin.Pair<java.util.List<T>, java.util.List<T>> partition(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #106 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 26: astore 4\n 28: new #106 // class java/util/ArrayList\n 31: dup\n 32: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 35: astore 5\n 37: aload_2\n 38: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 6\n 45: aload 6\n 47: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 102\n 55: aload 6\n 57: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 7\n 64: aload_1\n 65: aload 7\n 67: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 72: checkcast #47 // class java/lang/Boolean\n 75: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 78: ifeq 91\n 81: aload 4\n 83: aload 7\n 85: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 88: goto 98\n 91: aload 5\n 93: aload 7\n 95: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 98: pop\n 99: goto 45\n 102: new #111 // class kotlin/Pair\n 105: dup\n 106: aload 4\n 108: aload 5\n 110: invokespecial #121 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 113: areturn\n\n public static final <T> java.util.Map<java.lang.Boolean, java.util.List<T>> partitioningBy(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: astore 4\n 22: new #479 // class java/util/LinkedHashMap\n 25: dup\n 26: invokespecial #480 // Method java/util/LinkedHashMap.\"<init>\":()V\n 29: checkcast #482 // class java/util/Map\n 32: astore 5\n 34: iconst_0\n 35: istore 6\n 37: aload 4\n 39: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 7\n 46: aload 7\n 48: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 151\n 56: aload 7\n 58: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 8\n 65: aload_1\n 66: aload 8\n 68: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 73: astore 9\n 75: aload 5\n 77: astore 10\n 79: iconst_0\n 80: istore 11\n 82: aload 10\n 84: aload 9\n 86: invokeinterface #484, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 91: astore 12\n 93: aload 12\n 95: ifnonnull 130\n 98: iconst_0\n 99: istore 13\n 101: new #106 // class java/util/ArrayList\n 104: dup\n 105: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 108: checkcast #60 // class java/util/List\n 111: astore 13\n 113: aload 10\n 115: aload 9\n 117: aload 13\n 119: invokeinterface #487, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 124: pop\n 125: aload 13\n 127: goto 132\n 130: aload 12\n 132: nop\n 133: checkcast #60 // class java/util/List\n 136: astore 14\n 138: aload 14\n 140: aload 8\n 142: invokeinterface #488, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 147: pop\n 148: goto 46\n 151: aload 5\n 153: nop\n 154: areturn\n\n public static final <T, U, R> java.util.List<R> product(java.util.List<? extends T>, java.util.List<? extends U>, kotlin.jvm.functions.Function2<? super T, ? super U, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_3\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #106 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #22 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 199\n 64: aload 8\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 9\n 75: astore 10\n 77: iconst_0\n 78: istore 11\n 80: aload_1\n 81: checkcast #20 // class java/lang/Iterable\n 84: astore 12\n 86: iconst_0\n 87: istore 13\n 89: aload 12\n 91: astore 14\n 93: new #106 // class java/util/ArrayList\n 96: dup\n 97: aload 12\n 99: bipush 10\n 101: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 104: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 107: checkcast #22 // class java/util/Collection\n 110: astore 15\n 112: iconst_0\n 113: istore 16\n 115: aload 14\n 117: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 122: astore 17\n 124: aload 17\n 126: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 131: ifeq 176\n 134: aload 17\n 136: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 141: astore 18\n 143: aload 15\n 145: aload 18\n 147: astore 19\n 149: astore 20\n 151: iconst_0\n 152: istore 21\n 154: aload_2\n 155: aload 10\n 157: aload 19\n 159: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 164: aload 20\n 166: swap\n 167: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 172: pop\n 173: goto 124\n 176: aload 15\n 178: checkcast #60 // class java/util/List\n 181: nop\n 182: checkcast #20 // class java/lang/Iterable\n 185: nop\n 186: astore 10\n 188: aload 6\n 190: aload 10\n 192: invokestatic #288 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 195: pop\n 196: goto 54\n 199: aload 6\n 201: checkcast #60 // class java/util/List\n 204: nop\n 205: areturn\n\n public static final <T> java.util.List<T> pull(java.util.List<? extends T>, T...);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #683 // String elements\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_1\n 14: invokestatic #686 // Method kotlin/collections/ArraysKt.toSet:([Ljava/lang/Object;)Ljava/util/Set;\n 17: astore_2\n 18: iconst_0\n 19: istore_3\n 20: aload_0\n 21: checkcast #20 // class java/lang/Iterable\n 24: astore 4\n 26: iconst_0\n 27: istore 5\n 29: aload 4\n 31: astore 6\n 33: new #106 // class java/util/ArrayList\n 36: dup\n 37: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 40: checkcast #22 // class java/util/Collection\n 43: astore 7\n 45: iconst_0\n 46: istore 8\n 48: aload 6\n 50: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 55: astore 9\n 57: aload 9\n 59: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 64: ifeq 107\n 67: aload 9\n 69: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 74: astore 10\n 76: aload 10\n 78: astore 11\n 80: iconst_0\n 81: istore 12\n 83: aload_2\n 84: aload 11\n 86: invokeinterface #687, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 91: ifne 57\n 94: aload 7\n 96: aload 10\n 98: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 103: pop\n 104: goto 57\n 107: aload 7\n 109: checkcast #60 // class java/util/List\n 112: nop\n 113: nop\n 114: nop\n 115: areturn\n\n public static final <T> java.util.List<T> pullAtIndex(java.util.List<? extends T>, int...);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #698 // String indices\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_1\n 14: invokestatic #701 // Method kotlin/collections/ArraysKt.toSet:([I)Ljava/util/Set;\n 17: astore_2\n 18: iconst_0\n 19: istore_3\n 20: aload_0\n 21: checkcast #20 // class java/lang/Iterable\n 24: astore 4\n 26: iconst_0\n 27: istore 5\n 29: aload 4\n 31: astore 6\n 33: new #106 // class java/util/ArrayList\n 36: dup\n 37: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 40: checkcast #22 // class java/util/Collection\n 43: astore 7\n 45: iconst_0\n 46: istore 8\n 48: aload 6\n 50: astore 9\n 52: iconst_0\n 53: istore 10\n 55: iconst_0\n 56: istore 11\n 58: aload 9\n 60: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 65: astore 12\n 67: aload 12\n 69: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 74: ifeq 156\n 77: aload 12\n 79: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 13\n 86: iload 11\n 88: iinc 11, 1\n 91: istore 14\n 93: iload 14\n 95: ifge 101\n 98: invokestatic #650 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 101: iload 14\n 103: aload 13\n 105: astore 15\n 107: istore 16\n 109: iconst_0\n 110: istore 17\n 112: iload 16\n 114: istore 18\n 116: iconst_0\n 117: istore 19\n 119: aload_2\n 120: iload 18\n 122: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 125: invokeinterface #687, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 130: ifne 137\n 133: iconst_1\n 134: goto 138\n 137: iconst_0\n 138: ifeq 151\n 141: aload 7\n 143: aload 15\n 145: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 150: pop\n 151: nop\n 152: nop\n 153: goto 67\n 156: nop\n 157: aload 7\n 159: checkcast #60 // class java/util/List\n 162: nop\n 163: nop\n 164: nop\n 165: areturn\n\n public static final <T> java.util.List<T> pullAtValue(java.util.List<? extends T>, T...);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #683 // String elements\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_1\n 14: invokestatic #686 // Method kotlin/collections/ArraysKt.toSet:([Ljava/lang/Object;)Ljava/util/Set;\n 17: astore_2\n 18: iconst_0\n 19: istore_3\n 20: aload_0\n 21: checkcast #20 // class java/lang/Iterable\n 24: astore 4\n 26: iconst_0\n 27: istore 5\n 29: aload 4\n 31: astore 6\n 33: new #106 // class java/util/ArrayList\n 36: dup\n 37: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 40: checkcast #22 // class java/util/Collection\n 43: astore 7\n 45: iconst_0\n 46: istore 8\n 48: aload 6\n 50: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 55: astore 9\n 57: aload 9\n 59: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 64: ifeq 107\n 67: aload 9\n 69: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 74: astore 10\n 76: aload 10\n 78: astore 11\n 80: iconst_0\n 81: istore 12\n 83: aload_2\n 84: aload 11\n 86: invokeinterface #687, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 91: ifeq 57\n 94: aload 7\n 96: aload 10\n 98: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 103: pop\n 104: goto 57\n 107: aload 7\n 109: checkcast #60 // class java/util/List\n 112: nop\n 113: nop\n 114: nop\n 115: areturn\n\n public static final <T, R> java.util.List<R> reduceSuccessive(java.util.List<? extends T>, R, kotlin.jvm.functions.Function2<? super R, ? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #198 // String function\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_3\n 17: invokestatic #410 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 20: astore 4\n 22: iconst_0\n 23: istore 5\n 25: aload 4\n 27: astore 6\n 29: aload_3\n 30: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 35: astore 7\n 37: aload 7\n 39: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 44: ifeq 94\n 47: aload 7\n 49: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 54: astore 8\n 56: aload 6\n 58: aload 8\n 60: astore 9\n 62: astore 10\n 64: iconst_0\n 65: istore 11\n 67: aload 10\n 69: checkcast #22 // class java/util/Collection\n 72: aload_2\n 73: aload 10\n 75: aload_1\n 76: invokestatic #727 // Method reduceSuccessive$lastOrElse:(Ljava/util/List;Ljava/lang/Object;)Ljava/lang/Object;\n 79: aload 9\n 81: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 86: invokestatic #730 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;\n 89: astore 6\n 91: goto 37\n 94: aload 6\n 96: areturn\n\n public static final <T> java.util.List<T> reject(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: astore 4\n 22: new #106 // class java/util/ArrayList\n 25: dup\n 26: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 29: checkcast #22 // class java/util/Collection\n 32: astore 5\n 34: iconst_0\n 35: istore 6\n 37: aload 4\n 39: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 7\n 46: aload 7\n 48: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 95\n 56: aload 7\n 58: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 8\n 65: aload_1\n 66: aload 8\n 68: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 73: checkcast #47 // class java/lang/Boolean\n 76: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 79: ifne 46\n 82: aload 5\n 84: aload 8\n 86: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 91: pop\n 92: goto 46\n 95: aload 5\n 97: checkcast #60 // class java/util/List\n 100: nop\n 101: areturn\n\n public static final <T> java.util.List<T> remove(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: aload_2\n 20: astore 4\n 22: new #106 // class java/util/ArrayList\n 25: dup\n 26: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 29: checkcast #22 // class java/util/Collection\n 32: astore 5\n 34: iconst_0\n 35: istore 6\n 37: aload 4\n 39: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 7\n 46: aload 7\n 48: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 95\n 56: aload 7\n 58: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 8\n 65: aload_1\n 66: aload 8\n 68: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 73: checkcast #47 // class java/lang/Boolean\n 76: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 79: ifeq 46\n 82: aload 5\n 84: aload 8\n 86: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 91: pop\n 92: goto 46\n 95: aload 5\n 97: checkcast #60 // class java/util/List\n 100: nop\n 101: areturn\n\n public static final <T> java.util.List<T> rotateLeft(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: iload_1\n 11: aload_0\n 12: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 17: irem\n 18: invokestatic #380 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 21: checkcast #22 // class java/util/Collection\n 24: aload_0\n 25: checkcast #20 // class java/lang/Iterable\n 28: iload_1\n 29: aload_0\n 30: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 35: irem\n 36: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 39: checkcast #20 // class java/lang/Iterable\n 42: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 45: areturn\n\n public static final <T> java.util.List<T> rotateRight(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_1\n 8: aload_0\n 9: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 14: irem\n 15: invokestatic #429 // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;\n 18: checkcast #22 // class java/util/Collection\n 21: aload_0\n 22: iload_1\n 23: aload_0\n 24: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 29: irem\n 30: invokestatic #385 // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;\n 33: checkcast #20 // class java/lang/Iterable\n 36: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 39: areturn\n\n public static final <T> T sample(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #22 // class java/util/Collection\n 10: getstatic #748 // Field kotlin/random/Random.Default:Lkotlin/random/Random$Default;\n 13: checkcast #744 // class kotlin/random/Random\n 16: invokestatic #752 // Method kotlin/collections/CollectionsKt.random:(Ljava/util/Collection;Lkotlin/random/Random;)Ljava/lang/Object;\n 19: areturn\n\n public static final <T> java.util.List<T> sampleSize(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #756 // Method kotlin/collections/CollectionsKt.shuffled:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: checkcast #20 // class java/lang/Iterable\n 16: iload_1\n 17: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 20: areturn\n\n public static final <T> int segmentLength(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 21: iconst_0\n 22: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 25: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 28: astore_3\n 29: iconst_0\n 30: istore 4\n 32: aload_3\n 33: astore 5\n 35: aload_2\n 36: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 6\n 43: aload 6\n 45: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 156\n 53: aload 6\n 55: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 7\n 62: aload 5\n 64: aload 7\n 66: astore 8\n 68: astore 9\n 70: iconst_0\n 71: istore 10\n 73: aload 9\n 75: invokevirtual #124 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 78: checkcast #759 // class java/lang/Number\n 81: invokevirtual #762 // Method java/lang/Number.intValue:()I\n 84: istore 11\n 86: aload 9\n 88: invokevirtual #127 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 91: checkcast #759 // class java/lang/Number\n 94: invokevirtual #762 // Method java/lang/Number.intValue:()I\n 97: istore 12\n 99: aload_1\n 100: aload 8\n 102: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 107: checkcast #47 // class java/lang/Boolean\n 110: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 113: ifeq 134\n 116: iload 11\n 118: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 121: iload 12\n 123: iconst_1\n 124: iadd\n 125: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 128: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 131: goto 151\n 134: iload 11\n 136: iload 12\n 138: invokestatic #767 // Method java/lang/Math.max:(II)I\n 141: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 144: iconst_0\n 145: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 148: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 151: astore 5\n 153: goto 43\n 156: aload 5\n 158: invokevirtual #137 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 161: checkcast #759 // class java/lang/Number\n 164: invokevirtual #762 // Method java/lang/Number.intValue:()I\n 167: ireturn\n\n public static final <T> java.util.List<T> shank(java.util.List<? extends T>, int, int, T...);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: ldc_w #683 // String elements\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: iconst_0\n 15: iload_1\n 16: invokestatic #776 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 19: invokestatic #780 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;\n 22: checkcast #22 // class java/util/Collection\n 25: aload_3\n 26: invokestatic #783 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;[Ljava/lang/Object;)Ljava/util/List;\n 29: checkcast #22 // class java/util/Collection\n 32: aload_0\n 33: checkcast #20 // class java/lang/Iterable\n 36: iload_1\n 37: iload_2\n 38: iadd\n 39: invokestatic #380 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 42: checkcast #20 // class java/lang/Iterable\n 45: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 48: areturn\n\n public static java.util.List shank$default(java.util.List, int, int, java.lang.Object[], int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_2\n 3: iand\n 4: ifeq 9\n 7: iconst_0\n 8: istore_1\n 9: iload 4\n 11: iconst_4\n 12: iand\n 13: ifeq 18\n 16: iconst_0\n 17: istore_2\n 18: aload_0\n 19: iload_1\n 20: iload_2\n 21: aload_3\n 22: invokestatic #788 // Method shank:(Ljava/util/List;II[Ljava/lang/Object;)Ljava/util/List;\n 25: areturn\n\n public static final <T> java.util.List<T> shuffle(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #756 // Method kotlin/collections/CollectionsKt.shuffled:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: areturn\n\n public static final <T, R> java.util.List<java.util.List<T>> slideBy(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #793 // String classifier\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_1\n 14: aload_0\n 15: new #106 // class java/util/ArrayList\n 18: dup\n 19: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 22: checkcast #60 // class java/util/List\n 25: invokestatic #797 // Method slideBy$slideBy_:(Lkotlin/jvm/functions/Function1;Ljava/util/List;Ljava/util/List;)Ljava/util/List;\n 28: areturn\n\n public static final <T> int segmentLength1(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: aload_0\n 17: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 22: iconst_1\n 23: invokestatic #767 // Method java/lang/Math.max:(II)I\n 26: iconst_0\n 27: iconst_1\n 28: iconst_2\n 29: aconst_null\n 30: invokestatic #802 // Method kotlin/collections/CollectionsKt.windowed$default:(Ljava/lang/Iterable;IIZILjava/lang/Object;)Ljava/util/List;\n 33: checkcast #20 // class java/lang/Iterable\n 36: astore_2\n 37: nop\n 38: iconst_0\n 39: istore_3\n 40: aload_2\n 41: astore 4\n 43: new #106 // class java/util/ArrayList\n 46: dup\n 47: aload_2\n 48: bipush 10\n 50: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 53: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 56: checkcast #22 // class java/util/Collection\n 59: astore 5\n 61: iconst_0\n 62: istore 6\n 64: aload 4\n 66: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 71: astore 7\n 73: aload 7\n 75: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 80: ifeq 209\n 83: aload 7\n 85: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 90: astore 8\n 92: aload 5\n 94: aload 8\n 96: checkcast #60 // class java/util/List\n 99: astore 9\n 101: astore 16\n 103: iconst_0\n 104: istore 10\n 106: aload 9\n 108: checkcast #20 // class java/lang/Iterable\n 111: astore 11\n 113: iconst_0\n 114: istore 12\n 116: new #106 // class java/util/ArrayList\n 119: dup\n 120: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 123: astore 13\n 125: aload 11\n 127: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 132: astore 14\n 134: aload 14\n 136: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 141: ifeq 184\n 144: aload 14\n 146: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 151: astore 15\n 153: aload_1\n 154: aload 15\n 156: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 161: checkcast #47 // class java/lang/Boolean\n 164: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 167: ifne 173\n 170: goto 184\n 173: aload 13\n 175: aload 15\n 177: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 180: pop\n 181: goto 134\n 184: aload 13\n 186: checkcast #60 // class java/util/List\n 189: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 194: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 197: aload 16\n 199: swap\n 200: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 205: pop\n 206: goto 73\n 209: aload 5\n 211: checkcast #60 // class java/util/List\n 214: nop\n 215: checkcast #20 // class java/lang/Iterable\n 218: invokestatic #806 // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 221: checkcast #759 // class java/lang/Number\n 224: invokevirtual #762 // Method java/lang/Number.intValue:()I\n 227: ireturn\n\n public static final <T extends java.lang.Comparable<? super T>> int sortOrder(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #640 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: astore_1\n 14: iconst_0\n 15: istore_2\n 16: nop\n 17: aload_1\n 18: aload_0\n 19: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 22: ifeq 29\n 25: iconst_1\n 26: goto 45\n 29: aload_1\n 30: invokestatic #815 // Method kotlin/collections/CollectionsKt.asReversed:(Ljava/util/List;)Ljava/util/List;\n 33: aload_0\n 34: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 37: ifeq 44\n 40: iconst_m1\n 41: goto 45\n 44: iconst_0\n 45: nop\n 46: nop\n 47: ireturn\n\n public static final <T> kotlin.Pair<java.util.List<T>, java.util.List<T>> span(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #106 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 26: astore 4\n 28: aload_2\n 29: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 34: astore 5\n 36: aload 5\n 38: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 43: ifeq 86\n 46: aload 5\n 48: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 53: astore 6\n 55: aload_1\n 56: aload 6\n 58: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 63: checkcast #47 // class java/lang/Boolean\n 66: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 69: ifne 75\n 72: goto 86\n 75: aload 4\n 77: aload 6\n 79: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 82: pop\n 83: goto 36\n 86: aload 4\n 88: checkcast #60 // class java/util/List\n 91: aload_0\n 92: checkcast #20 // class java/lang/Iterable\n 95: astore_2\n 96: astore 8\n 98: iconst_0\n 99: istore_3\n 100: iconst_0\n 101: istore 4\n 103: new #106 // class java/util/ArrayList\n 106: dup\n 107: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 110: astore 5\n 112: aload_2\n 113: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 118: astore 6\n 120: aload 6\n 122: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 127: ifeq 186\n 130: aload 6\n 132: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 137: astore 7\n 139: iload 4\n 141: ifeq 155\n 144: aload 5\n 146: aload 7\n 148: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 151: pop\n 152: goto 120\n 155: aload_1\n 156: aload 7\n 158: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 163: checkcast #47 // class java/lang/Boolean\n 166: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 169: ifne 120\n 172: aload 5\n 174: aload 7\n 176: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 179: pop\n 180: iconst_1\n 181: istore 4\n 183: goto 120\n 186: aload 5\n 188: checkcast #60 // class java/util/List\n 191: aload 8\n 193: swap\n 194: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 197: areturn\n\n public static final <T> kotlin.Pair<java.util.List<T>, java.util.List<T>> splitAt(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #106 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 26: astore 4\n 28: aload_2\n 29: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 34: astore 5\n 36: aload 5\n 38: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 43: ifeq 101\n 46: aload 5\n 48: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 53: astore 6\n 55: aload 6\n 57: astore 7\n 59: iconst_0\n 60: istore 8\n 62: aload_1\n 63: aload 7\n 65: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 70: checkcast #47 // class java/lang/Boolean\n 73: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 76: ifne 83\n 79: iconst_1\n 80: goto 84\n 83: iconst_0\n 84: ifne 90\n 87: goto 101\n 90: aload 4\n 92: aload 6\n 94: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 97: pop\n 98: goto 36\n 101: aload 4\n 103: checkcast #60 // class java/util/List\n 106: aload_0\n 107: checkcast #20 // class java/lang/Iterable\n 110: astore_2\n 111: astore 10\n 113: iconst_0\n 114: istore_3\n 115: iconst_0\n 116: istore 4\n 118: new #106 // class java/util/ArrayList\n 121: dup\n 122: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 125: astore 5\n 127: aload_2\n 128: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 133: astore 6\n 135: aload 6\n 137: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 142: ifeq 216\n 145: aload 6\n 147: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 152: astore 7\n 154: iload 4\n 156: ifeq 170\n 159: aload 5\n 161: aload 7\n 163: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 166: pop\n 167: goto 135\n 170: aload 7\n 172: astore 8\n 174: iconst_0\n 175: istore 9\n 177: aload_1\n 178: aload 8\n 180: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 185: checkcast #47 // class java/lang/Boolean\n 188: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 191: ifne 198\n 194: iconst_1\n 195: goto 199\n 198: iconst_0\n 199: ifne 135\n 202: aload 5\n 204: aload 7\n 206: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 209: pop\n 210: iconst_1\n 211: istore 4\n 213: goto 135\n 216: aload 5\n 218: checkcast #60 // class java/util/List\n 221: aload 10\n 223: swap\n 224: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 227: areturn\n\n public static final <T> boolean startsWith(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #426 // String subList\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 23: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 26: aload_1\n 27: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 30: ireturn\n\n public static final <T> java.util.List<T> symmetricDifference(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: checkcast #20 // class java/lang/Iterable\n 21: invokestatic #346 // Method kotlin/collections/CollectionsKt.subtract:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 24: aload_1\n 25: checkcast #20 // class java/lang/Iterable\n 28: aload_0\n 29: checkcast #20 // class java/lang/Iterable\n 32: invokestatic #346 // Method kotlin/collections/CollectionsKt.subtract:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 35: checkcast #20 // class java/lang/Iterable\n 38: invokestatic #828 // Method kotlin/collections/SetsKt.plus:(Ljava/util/Set;Ljava/lang/Iterable;)Ljava/util/Set;\n 41: checkcast #20 // class java/lang/Iterable\n 44: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 47: areturn\n\n public static final <T, R> java.util.List<T> symmetricDifferenceBy(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 26: checkcast #20 // class java/lang/Iterable\n 29: astore 4\n 31: iconst_0\n 32: istore 5\n 34: aload 4\n 36: astore 6\n 38: new #106 // class java/util/ArrayList\n 41: dup\n 42: aload 4\n 44: bipush 10\n 46: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 49: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 52: checkcast #22 // class java/util/Collection\n 55: astore 7\n 57: iconst_0\n 58: istore 8\n 60: aload 6\n 62: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 67: astore 9\n 69: aload 9\n 71: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 76: ifeq 107\n 79: aload 9\n 81: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 86: astore 10\n 88: aload 7\n 90: aload_2\n 91: aload 10\n 93: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 98: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 103: pop\n 104: goto 69\n 107: aload 7\n 109: checkcast #60 // class java/util/List\n 112: nop\n 113: astore_3\n 114: aload_1\n 115: checkcast #20 // class java/lang/Iterable\n 118: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 121: checkcast #20 // class java/lang/Iterable\n 124: astore 5\n 126: iconst_0\n 127: istore 6\n 129: aload 5\n 131: astore 7\n 133: new #106 // class java/util/ArrayList\n 136: dup\n 137: aload 5\n 139: bipush 10\n 141: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 144: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 147: checkcast #22 // class java/util/Collection\n 150: astore 8\n 152: iconst_0\n 153: istore 9\n 155: aload 7\n 157: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 162: astore 10\n 164: aload 10\n 166: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 171: ifeq 202\n 174: aload 10\n 176: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 181: astore 11\n 183: aload 8\n 185: aload_2\n 186: aload 11\n 188: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 193: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 198: pop\n 199: goto 164\n 202: aload 8\n 204: checkcast #60 // class java/util/List\n 207: nop\n 208: astore 4\n 210: aload_0\n 211: checkcast #20 // class java/lang/Iterable\n 214: astore 5\n 216: iconst_0\n 217: istore 6\n 219: aload 5\n 221: astore 7\n 223: new #106 // class java/util/ArrayList\n 226: dup\n 227: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 230: checkcast #22 // class java/util/Collection\n 233: astore 8\n 235: iconst_0\n 236: istore 9\n 238: aload 7\n 240: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 245: astore 10\n 247: aload 10\n 249: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 254: ifeq 304\n 257: aload 10\n 259: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 264: astore 11\n 266: aload 11\n 268: astore 12\n 270: iconst_0\n 271: istore 13\n 273: aload 4\n 275: aload_2\n 276: aload 12\n 278: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 283: invokeinterface #359, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 288: ifne 247\n 291: aload 8\n 293: aload 11\n 295: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 300: pop\n 301: goto 247\n 304: aload 8\n 306: checkcast #60 // class java/util/List\n 309: nop\n 310: checkcast #22 // class java/util/Collection\n 313: aload_1\n 314: checkcast #20 // class java/lang/Iterable\n 317: astore 5\n 319: astore 14\n 321: iconst_0\n 322: istore 6\n 324: aload 5\n 326: astore 7\n 328: new #106 // class java/util/ArrayList\n 331: dup\n 332: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 335: checkcast #22 // class java/util/Collection\n 338: astore 8\n 340: iconst_0\n 341: istore 9\n 343: aload 7\n 345: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 350: astore 10\n 352: aload 10\n 354: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 359: ifeq 408\n 362: aload 10\n 364: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 369: astore 11\n 371: aload 11\n 373: astore 12\n 375: iconst_0\n 376: istore 13\n 378: aload_3\n 379: aload_2\n 380: aload 12\n 382: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 387: invokeinterface #359, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 392: ifne 352\n 395: aload 8\n 397: aload 11\n 399: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 404: pop\n 405: goto 352\n 408: aload 8\n 410: checkcast #60 // class java/util/List\n 413: nop\n 414: aload 14\n 416: swap\n 417: checkcast #20 // class java/lang/Iterable\n 420: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 423: areturn\n\n public static final <T> java.util.List<T> symmetricDifferenceWith(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function2<? super T, ? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_3\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #106 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #22 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 190\n 64: aload 8\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 9\n 75: astore 10\n 77: iconst_0\n 78: istore 11\n 80: aload_1\n 81: checkcast #20 // class java/lang/Iterable\n 84: astore 12\n 86: iconst_0\n 87: istore 13\n 89: aload 12\n 91: instanceof #22 // class java/util/Collection\n 94: ifeq 114\n 97: aload 12\n 99: checkcast #22 // class java/util/Collection\n 102: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 107: ifeq 114\n 110: iconst_1\n 111: goto 173\n 114: aload 12\n 116: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 14\n 123: aload 14\n 125: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifeq 172\n 133: aload 14\n 135: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 140: astore 15\n 142: aload 15\n 144: astore 16\n 146: iconst_0\n 147: istore 17\n 149: aload_2\n 150: aload 10\n 152: aload 16\n 154: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 159: checkcast #47 // class java/lang/Boolean\n 162: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 165: ifeq 123\n 168: iconst_0\n 169: goto 173\n 172: iconst_1\n 173: nop\n 174: ifeq 54\n 177: aload 6\n 179: aload 9\n 181: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 186: pop\n 187: goto 54\n 190: aload 6\n 192: checkcast #60 // class java/util/List\n 195: nop\n 196: checkcast #22 // class java/util/Collection\n 199: aload_1\n 200: checkcast #20 // class java/lang/Iterable\n 203: astore_3\n 204: astore 18\n 206: iconst_0\n 207: istore 4\n 209: aload_3\n 210: astore 5\n 212: new #106 // class java/util/ArrayList\n 215: dup\n 216: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 219: checkcast #22 // class java/util/Collection\n 222: astore 6\n 224: iconst_0\n 225: istore 7\n 227: aload 5\n 229: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 234: astore 8\n 236: aload 8\n 238: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 243: ifeq 372\n 246: aload 8\n 248: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 253: astore 9\n 255: aload 9\n 257: astore 10\n 259: iconst_0\n 260: istore 11\n 262: aload_0\n 263: checkcast #20 // class java/lang/Iterable\n 266: astore 12\n 268: iconst_0\n 269: istore 13\n 271: aload 12\n 273: instanceof #22 // class java/util/Collection\n 276: ifeq 296\n 279: aload 12\n 281: checkcast #22 // class java/util/Collection\n 284: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 289: ifeq 296\n 292: iconst_1\n 293: goto 355\n 296: aload 12\n 298: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 303: astore 14\n 305: aload 14\n 307: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 312: ifeq 354\n 315: aload 14\n 317: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 322: astore 15\n 324: aload 15\n 326: astore 16\n 328: iconst_0\n 329: istore 17\n 331: aload_2\n 332: aload 16\n 334: aload 10\n 336: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 341: checkcast #47 // class java/lang/Boolean\n 344: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 347: ifeq 305\n 350: iconst_0\n 351: goto 355\n 354: iconst_1\n 355: nop\n 356: ifeq 236\n 359: aload 6\n 361: aload 9\n 363: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 368: pop\n 369: goto 236\n 372: aload 6\n 374: checkcast #60 // class java/util/List\n 377: nop\n 378: aload 18\n 380: swap\n 381: checkcast #20 // class java/lang/Iterable\n 384: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 387: areturn\n\n public static final <T> java.util.List<T> tail(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: iconst_1\n 11: invokestatic #380 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 14: areturn\n\n public static final <T> java.util.List<T> take(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: iload_1\n 11: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 14: areturn\n\n public static final <T> java.util.List<T> takeRight(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_1\n 8: invokestatic #429 // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;\n 11: areturn\n\n public static final <T> java.util.List<T> takeRightWhile(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 22: ifeq 31\n 25: invokestatic #410 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 28: goto 172\n 31: aload_2\n 32: aload_2\n 33: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 38: invokeinterface #392, 2 // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;\n 43: astore 4\n 45: aload 4\n 47: invokeinterface #397, 1 // InterfaceMethod java/util/ListIterator.hasPrevious:()Z\n 52: ifeq 165\n 55: aload_1\n 56: aload 4\n 58: invokeinterface #400, 1 // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;\n 63: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 68: checkcast #47 // class java/lang/Boolean\n 71: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 74: ifne 45\n 77: aload 4\n 79: invokeinterface #842, 1 // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;\n 84: pop\n 85: aload_2\n 86: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 91: aload 4\n 93: invokeinterface #403, 1 // InterfaceMethod java/util/ListIterator.nextIndex:()I\n 98: isub\n 99: istore 5\n 101: iload 5\n 103: ifne 112\n 106: invokestatic #410 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 109: goto 172\n 112: new #106 // class java/util/ArrayList\n 115: dup\n 116: iload 5\n 118: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 121: astore 6\n 123: aload 6\n 125: astore 7\n 127: iconst_0\n 128: istore 8\n 130: aload 4\n 132: invokeinterface #843, 1 // InterfaceMethod java/util/ListIterator.hasNext:()Z\n 137: ifeq 156\n 140: aload 7\n 142: aload 4\n 144: invokeinterface #842, 1 // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;\n 149: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 152: pop\n 153: goto 130\n 156: nop\n 157: aload 6\n 159: checkcast #60 // class java/util/List\n 162: goto 172\n 165: aload_2\n 166: checkcast #20 // class java/lang/Iterable\n 169: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 172: areturn\n\n public static final <T> java.util.List<T> takeWhile(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #18 // String predicate\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #20 // class java/lang/Iterable\n 16: astore_2\n 17: iconst_0\n 18: istore_3\n 19: new #106 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 26: astore 4\n 28: aload_2\n 29: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 34: astore 5\n 36: aload 5\n 38: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 43: ifeq 86\n 46: aload 5\n 48: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 53: astore 6\n 55: aload_1\n 56: aload 6\n 58: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 63: checkcast #47 // class java/lang/Boolean\n 66: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 69: ifne 75\n 72: goto 86\n 75: aload 4\n 77: aload 6\n 79: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 82: pop\n 83: goto 36\n 86: aload 4\n 88: checkcast #60 // class java/util/List\n 91: areturn\n\n public static final <T> java.util.List<T> union(java.util.List<? extends T>, java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: checkcast #20 // class java/lang/Iterable\n 21: invokestatic #852 // Method kotlin/collections/CollectionsKt.union:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 24: checkcast #20 // class java/lang/Iterable\n 27: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 30: areturn\n\n public static final <T, R> java.util.List<T> unionBy(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 26: checkcast #20 // class java/lang/Iterable\n 29: astore 4\n 31: iconst_0\n 32: istore 5\n 34: aload 4\n 36: astore 6\n 38: new #106 // class java/util/ArrayList\n 41: dup\n 42: aload 4\n 44: bipush 10\n 46: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 49: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 52: checkcast #22 // class java/util/Collection\n 55: astore 7\n 57: iconst_0\n 58: istore 8\n 60: aload 6\n 62: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 67: astore 9\n 69: aload 9\n 71: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 76: ifeq 107\n 79: aload 9\n 81: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 86: astore 10\n 88: aload 7\n 90: aload_2\n 91: aload 10\n 93: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 98: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 103: pop\n 104: goto 69\n 107: aload 7\n 109: checkcast #60 // class java/util/List\n 112: nop\n 113: astore_3\n 114: aload_0\n 115: checkcast #20 // class java/lang/Iterable\n 118: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 121: aload_1\n 122: checkcast #20 // class java/lang/Iterable\n 125: invokestatic #356 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 128: checkcast #20 // class java/lang/Iterable\n 131: astore 4\n 133: astore 13\n 135: iconst_0\n 136: istore 5\n 138: aload 4\n 140: astore 6\n 142: new #106 // class java/util/ArrayList\n 145: dup\n 146: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 149: checkcast #22 // class java/util/Collection\n 152: astore 7\n 154: iconst_0\n 155: istore 8\n 157: aload 6\n 159: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 164: astore 9\n 166: aload 9\n 168: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 173: ifeq 222\n 176: aload 9\n 178: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 183: astore 10\n 185: aload 10\n 187: astore 11\n 189: iconst_0\n 190: istore 12\n 192: aload_3\n 193: aload_2\n 194: aload 11\n 196: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 201: invokeinterface #359, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 206: ifne 166\n 209: aload 7\n 211: aload 10\n 213: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 218: pop\n 219: goto 166\n 222: aload 7\n 224: checkcast #60 // class java/util/List\n 227: nop\n 228: aload 13\n 230: swap\n 231: checkcast #20 // class java/lang/Iterable\n 234: invokestatic #828 // Method kotlin/collections/SetsKt.plus:(Ljava/util/Set;Ljava/lang/Iterable;)Ljava/util/Set;\n 237: checkcast #20 // class java/lang/Iterable\n 240: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 243: areturn\n\n public static final <T> java.util.List<T> unionWith(java.util.List<? extends T>, java.util.List<? extends T>, kotlin.jvm.functions.Function2<? super T, ? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: astore_3\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #106 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #22 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 190\n 64: aload 8\n 66: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 9\n 75: astore 10\n 77: iconst_0\n 78: istore 11\n 80: aload_1\n 81: checkcast #20 // class java/lang/Iterable\n 84: astore 12\n 86: iconst_0\n 87: istore 13\n 89: aload 12\n 91: instanceof #22 // class java/util/Collection\n 94: ifeq 114\n 97: aload 12\n 99: checkcast #22 // class java/util/Collection\n 102: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 107: ifeq 114\n 110: iconst_0\n 111: goto 173\n 114: aload 12\n 116: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 14\n 123: aload 14\n 125: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifeq 172\n 133: aload 14\n 135: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 140: astore 15\n 142: aload 15\n 144: astore 16\n 146: iconst_0\n 147: istore 17\n 149: aload_2\n 150: aload 10\n 152: aload 16\n 154: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 159: checkcast #47 // class java/lang/Boolean\n 162: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 165: ifeq 123\n 168: iconst_1\n 169: goto 173\n 172: iconst_0\n 173: nop\n 174: ifeq 54\n 177: aload 6\n 179: aload 9\n 181: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 186: pop\n 187: goto 54\n 190: aload 6\n 192: checkcast #60 // class java/util/List\n 195: nop\n 196: checkcast #20 // class java/lang/Iterable\n 199: aload_1\n 200: checkcast #20 // class java/lang/Iterable\n 203: astore_3\n 204: astore 18\n 206: iconst_0\n 207: istore 4\n 209: aload_3\n 210: astore 5\n 212: new #106 // class java/util/ArrayList\n 215: dup\n 216: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 219: checkcast #22 // class java/util/Collection\n 222: astore 6\n 224: iconst_0\n 225: istore 7\n 227: aload 5\n 229: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 234: astore 8\n 236: aload 8\n 238: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 243: ifeq 372\n 246: aload 8\n 248: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 253: astore 9\n 255: aload 9\n 257: astore 10\n 259: iconst_0\n 260: istore 11\n 262: aload_0\n 263: checkcast #20 // class java/lang/Iterable\n 266: astore 12\n 268: iconst_0\n 269: istore 13\n 271: aload 12\n 273: instanceof #22 // class java/util/Collection\n 276: ifeq 296\n 279: aload 12\n 281: checkcast #22 // class java/util/Collection\n 284: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 289: ifeq 296\n 292: iconst_0\n 293: goto 355\n 296: aload 12\n 298: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 303: astore 14\n 305: aload 14\n 307: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 312: ifeq 354\n 315: aload 14\n 317: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 322: astore 15\n 324: aload 15\n 326: astore 16\n 328: iconst_0\n 329: istore 17\n 331: aload_2\n 332: aload 16\n 334: aload 10\n 336: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 341: checkcast #47 // class java/lang/Boolean\n 344: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 347: ifeq 305\n 350: iconst_1\n 351: goto 355\n 354: iconst_0\n 355: nop\n 356: ifeq 236\n 359: aload 6\n 361: aload 9\n 363: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 368: pop\n 369: goto 236\n 372: aload 6\n 374: checkcast #60 // class java/util/List\n 377: nop\n 378: aload 18\n 380: swap\n 381: checkcast #20 // class java/lang/Iterable\n 384: invokestatic #852 // Method kotlin/collections/CollectionsKt.union:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 387: checkcast #20 // class java/lang/Iterable\n 390: invokestatic #349 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 393: areturn\n\n public static final <T, U> kotlin.Pair<java.util.List<T>, java.util.List<U>> unzip(java.util.List<? extends kotlin.Pair<? extends T, ? extends U>>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #865 // Method kotlin/collections/CollectionsKt.unzip:(Ljava/lang/Iterable;)Lkotlin/Pair;\n 13: areturn\n\n public static final <T, U> java.util.List<kotlin.Pair<T, U>> zip(java.util.List<? extends T>, java.util.List<? extends U>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: checkcast #20 // class java/lang/Iterable\n 17: aload_1\n 18: checkcast #20 // class java/lang/Iterable\n 21: invokestatic #104 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 24: areturn\n\n public static final <T, U> java.util.List<kotlin.Pair<T, U>> zipAll(java.util.List<? extends T>, T, java.util.List<? extends U>, U);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_0\n 14: invokeinterface #442, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 19: astore 4\n 21: aload_2\n 22: invokeinterface #442, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 27: astore 5\n 29: new #870 // class ListKt$zipAll$1\n 32: dup\n 33: aload 4\n 35: aload 5\n 37: aload_1\n 38: aload_3\n 39: invokespecial #873 // Method ListKt$zipAll$1.\"<init>\":(Ljava/util/Iterator;Ljava/util/Iterator;Ljava/lang/Object;Ljava/lang/Object;)V\n 42: checkcast #32 // class java/util/Iterator\n 45: invokestatic #876 // Method kotlin/sequences/SequencesKt.asSequence:(Ljava/util/Iterator;)Lkotlin/sequences/Sequence;\n 48: invokestatic #272 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;\n 51: areturn\n\n public static final <K, V> java.util.Map<K, V> zipKeysValues(java.util.List<? extends K>, java.util.List<? extends V>);\n Code:\n 0: aload_0\n 1: ldc_w #885 // String keys\n 4: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #887 // String values\n 11: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_0\n 15: checkcast #20 // class java/lang/Iterable\n 18: aload_1\n 19: checkcast #20 // class java/lang/Iterable\n 22: invokestatic #104 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 25: checkcast #20 // class java/lang/Iterable\n 28: invokestatic #891 // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;\n 31: areturn\n\n public static final <T, U, R> java.util.List<R> zipWith(java.util.List<? extends T>, java.util.List<? extends U>, kotlin.jvm.functions.Function2<? super T, ? super U, ? extends R>);\n Code:\n 0: aload_0\n 1: ldc #247 // String first\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc_w #278 // String second\n 10: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_2\n 14: ldc #198 // String function\n 16: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: checkcast #20 // class java/lang/Iterable\n 23: aload_1\n 24: checkcast #20 // class java/lang/Iterable\n 27: invokestatic #104 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 30: checkcast #20 // class java/lang/Iterable\n 33: astore_3\n 34: iconst_0\n 35: istore 4\n 37: aload_3\n 38: astore 5\n 40: new #106 // class java/util/ArrayList\n 43: dup\n 44: aload_3\n 45: bipush 10\n 47: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 50: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 53: checkcast #22 // class java/util/Collection\n 56: astore 6\n 58: iconst_0\n 59: istore 7\n 61: aload 5\n 63: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 68: astore 8\n 70: aload 8\n 72: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 77: ifeq 139\n 80: aload 8\n 82: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 87: astore 9\n 89: aload 6\n 91: aload 9\n 93: checkcast #111 // class kotlin/Pair\n 96: astore 10\n 98: astore 14\n 100: iconst_0\n 101: istore 11\n 103: aload 10\n 105: invokevirtual #124 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 108: astore 12\n 110: aload 10\n 112: invokevirtual #127 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 115: astore 13\n 117: aload_2\n 118: aload 12\n 120: aload 13\n 122: invokeinterface #223, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 127: aload 14\n 129: swap\n 130: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 135: pop\n 136: goto 70\n 139: aload 6\n 141: checkcast #60 // class java/util/List\n 144: nop\n 145: areturn\n\n public static final <T> java.util.List<kotlin.Pair<java.lang.Integer, T>> zipWithIndex(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #515 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 13: astore_1\n 14: iconst_0\n 15: istore_2\n 16: aload_1\n 17: astore_3\n 18: new #106 // class java/util/ArrayList\n 21: dup\n 22: aload_1\n 23: bipush 10\n 25: invokestatic #131 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 28: invokespecial #134 // Method java/util/ArrayList.\"<init>\":(I)V\n 31: checkcast #22 // class java/util/Collection\n 34: astore 4\n 36: iconst_0\n 37: istore 5\n 39: aload_3\n 40: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 6\n 47: aload 6\n 49: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 108\n 57: aload 6\n 59: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 7\n 66: aload 4\n 68: aload 7\n 70: checkcast #517 // class kotlin/collections/IndexedValue\n 73: astore 8\n 75: astore 10\n 77: iconst_0\n 78: istore 9\n 80: aload 8\n 82: invokevirtual #523 // Method kotlin/collections/IndexedValue.getIndex:()I\n 85: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 88: aload 8\n 90: invokevirtual #520 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 93: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 96: aload 10\n 98: swap\n 99: invokeinterface #138, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 104: pop\n 105: goto 47\n 108: aload 4\n 110: checkcast #60 // class java/util/List\n 113: nop\n 114: areturn\n\n public static final <T> java.util.List<kotlin.Pair<T, T>> zipWithNext(java.util.List<? extends T>);\n Code:\n 0: aload_0\n 1: ldc #10 // String list\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #20 // class java/lang/Iterable\n 10: invokestatic #900 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 13: areturn\n\n private static final <T> boolean compact$isTruthy(T);\n Code:\n 0: aload_0\n 1: astore_1\n 2: aload_1\n 3: ifnonnull 10\n 6: iconst_0\n 7: goto 166\n 10: aload_1\n 11: instanceof #47 // class java/lang/Boolean\n 14: ifeq 27\n 17: aload_0\n 18: checkcast #47 // class java/lang/Boolean\n 21: invokevirtual #50 // Method java/lang/Boolean.booleanValue:()Z\n 24: goto 166\n 27: aload_1\n 28: instanceof #903 // class java/lang/Double\n 31: ifeq 55\n 34: aload_0\n 35: checkcast #759 // class java/lang/Number\n 38: invokevirtual #907 // Method java/lang/Number.doubleValue:()D\n 41: invokestatic #911 // Method java/lang/Double.isNaN:(D)Z\n 44: ifne 51\n 47: iconst_1\n 48: goto 166\n 51: iconst_0\n 52: goto 166\n 55: aload_1\n 56: instanceof #759 // class java/lang/Number\n 59: ifeq 80\n 62: aload_0\n 63: checkcast #759 // class java/lang/Number\n 66: invokevirtual #762 // Method java/lang/Number.intValue:()I\n 69: ifeq 76\n 72: iconst_1\n 73: goto 166\n 76: iconst_0\n 77: goto 166\n 80: aload_1\n 81: instanceof #913 // class java/lang/String\n 84: ifeq 115\n 87: aload_0\n 88: checkcast #587 // class java/lang/CharSequence\n 91: invokeinterface #916, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 96: ifne 103\n 99: iconst_1\n 100: goto 104\n 103: iconst_0\n 104: ifne 111\n 107: iconst_1\n 108: goto 166\n 111: iconst_0\n 112: goto 166\n 115: aload_1\n 116: instanceof #693 // class \"[Ljava/lang/Object;\"\n 119: ifeq 138\n 122: aload_0\n 123: checkcast #693 // class \"[Ljava/lang/Object;\"\n 126: arraylength\n 127: ifeq 134\n 130: iconst_1\n 131: goto 166\n 134: iconst_0\n 135: goto 166\n 138: aload_1\n 139: instanceof #22 // class java/util/Collection\n 142: ifeq 165\n 145: aload_0\n 146: checkcast #22 // class java/util/Collection\n 149: invokeinterface #26, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 154: ifne 161\n 157: iconst_1\n 158: goto 166\n 161: iconst_0\n 162: goto 166\n 165: iconst_1\n 166: ireturn\n\n private static final java.lang.Integer cycle$lambda$9(java.util.List, int);\n Code:\n 0: iload_1\n 1: iconst_1\n 2: iadd\n 3: aload_0\n 4: invokeinterface #86, 1 // InterfaceMethod java/util/List.size:()I\n 9: irem\n 10: invokestatic #306 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 13: areturn\n\n private static final java.lang.Object cycle$lambda$10(java.util.List, int);\n Code:\n 0: aload_0\n 1: iload_1\n 2: invokeinterface #68, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 7: areturn\n\n private static final <T> java.util.List<T> permutations$removeAtIndex(java.util.List<? extends T>, int);\n Code:\n 0: aload_0\n 1: checkcast #20 // class java/lang/Iterable\n 4: iload_1\n 5: invokestatic #406 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;\n 8: checkcast #22 // class java/util/Collection\n 11: aload_0\n 12: checkcast #20 // class java/lang/Iterable\n 15: iload_1\n 16: iconst_1\n 17: iadd\n 18: invokestatic #380 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 21: checkcast #20 // class java/lang/Iterable\n 24: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 27: areturn\n\n private static final <T> java.util.List<T> permutations$prepend(java.util.List<? extends T>, T);\n Code:\n 0: aload_1\n 1: invokestatic #647 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 4: checkcast #22 // class java/util/Collection\n 7: aload_0\n 8: checkcast #20 // class java/lang/Iterable\n 11: invokestatic #740 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 14: areturn\n\n private static final <T> T reduceSuccessive$lastOrElse(java.util.List<? extends T>, T);\n Code:\n 0: aload_0\n 1: invokestatic #923 // Method kotlin/collections/CollectionsKt.lastOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 4: dup\n 5: ifnonnull 10\n 8: pop\n 9: aload_1\n 10: areturn\n\n private static final <T, R> java.util.List<java.util.List<T>> slideBy$slideBy_(kotlin.jvm.functions.Function1<? super T, ? extends R>, java.util.List<? extends T>, java.util.List<java.util.List<T>>);\n Code:\n 0: aload_1\n 1: invokeinterface #64, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 6: ifeq 13\n 9: aload_2\n 10: goto 260\n 13: aload_1\n 14: checkcast #20 // class java/lang/Iterable\n 17: astore 4\n 19: iconst_0\n 20: istore 5\n 22: iconst_0\n 23: istore 6\n 25: new #106 // class java/util/ArrayList\n 28: dup\n 29: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 32: astore 7\n 34: aload 4\n 36: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 8\n 43: aload 8\n 45: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 123\n 53: aload 8\n 55: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 9\n 62: iload 6\n 64: ifeq 78\n 67: aload 7\n 69: aload 9\n 71: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 74: pop\n 75: goto 43\n 78: aload 9\n 80: astore 10\n 82: iconst_0\n 83: istore 11\n 85: aload_0\n 86: aload 10\n 88: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 93: aload_0\n 94: aload_1\n 95: invokestatic #508 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 98: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 103: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 106: ifne 43\n 109: aload 7\n 111: aload 9\n 113: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 116: pop\n 117: iconst_1\n 118: istore 6\n 120: goto 43\n 123: aload 7\n 125: checkcast #60 // class java/util/List\n 128: astore_3\n 129: aload_2\n 130: astore 5\n 132: aload 5\n 134: astore 6\n 136: iconst_0\n 137: istore 7\n 139: aload 6\n 141: aload_1\n 142: checkcast #20 // class java/lang/Iterable\n 145: astore 8\n 147: astore 9\n 149: iconst_0\n 150: istore 10\n 152: new #106 // class java/util/ArrayList\n 155: dup\n 156: invokespecial #109 // Method java/util/ArrayList.\"<init>\":()V\n 159: astore 11\n 161: aload 8\n 163: invokeinterface #30, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 168: astore 12\n 170: aload 12\n 172: invokeinterface #35, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 177: ifeq 234\n 180: aload 12\n 182: invokeinterface #39, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 187: astore 13\n 189: aload 13\n 191: astore 14\n 193: iconst_0\n 194: istore 15\n 196: aload_0\n 197: aload 14\n 199: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 204: aload_0\n 205: aload_1\n 206: invokestatic #508 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 209: invokeinterface #45, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 214: invokestatic #72 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 217: ifne 223\n 220: goto 234\n 223: aload 11\n 225: aload 13\n 227: invokevirtual #118 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 230: pop\n 231: goto 170\n 234: aload 11\n 236: checkcast #60 // class java/util/List\n 239: aload 9\n 241: swap\n 242: invokeinterface #488, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 247: pop\n 248: aload 5\n 250: astore 4\n 252: aload_3\n 253: astore_1\n 254: aload 4\n 256: astore_2\n 257: goto 0\n 260: areturn\n}\n", "javap_err": "" } ]
Prozen__AdventOfCode2018__b0e830f/day03/src/main/kotlin/Main.kt
import java.io.File fun main() { val strings = File(ClassLoader.getSystemResource("input.txt").file).readLines() val field = Array(1000) { Array(1000) { 0 } } strings.forEach { val words = it.split(" ") val start = words[2].dropLast(1).split(",").map { it.toInt() } val size = words[3].split("x").map { it.toInt() } (start[0] until start[0] + size[0]).forEach { x -> (start[1] until start[1] + size[1]).forEach { y -> field[x][y] += 1 } } } println(field.sumBy { it.count { it > 1 } }) val map = strings.map { val words = it.split(" ") val start = words[2].dropLast(1).split(",").map { it.toInt() } val size = words[3].split("x").map { it.toInt() } words[0] to (Point(start[0], start[1]) to Point(start[0] + size[0], start[1] + size[1])) } println(map.first { pair -> map.all { pair.first == it.first || doNotOverlap(pair.second.first, pair.second.second, it.second.first, it.second.second) } }.first) } data class Point(val x: Int, val y: Int) fun doNotOverlap(l1: Point, r1: Point, l2: Point, r2: Point) = l1.x >= r2.x || l2.x >= r1.x || l1.y >= r2.y || l2.y >= r1.y
[ { "class_path": "Prozen__AdventOfCode2018__b0e830f/MainKt.class", "javap": "Compiled from \"Main.kt\"\npublic final class MainKt {\n public static final void main();\n Code:\n 0: new #8 // class java/io/File\n 3: dup\n 4: ldc #10 // String input.txt\n 6: invokestatic #16 // Method java/lang/ClassLoader.getSystemResource:(Ljava/lang/String;)Ljava/net/URL;\n 9: invokevirtual #22 // Method java/net/URL.getFile:()Ljava/lang/String;\n 12: invokespecial #26 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 15: aconst_null\n 16: iconst_1\n 17: aconst_null\n 18: invokestatic #32 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 21: astore_0\n 22: iconst_0\n 23: istore_2\n 24: sipush 1000\n 27: anewarray #34 // class \"[Ljava/lang/Integer;\"\n 30: astore_3\n 31: iload_2\n 32: sipush 1000\n 35: if_icmpge 99\n 38: iload_2\n 39: istore 4\n 41: aload_3\n 42: iload 4\n 44: iconst_0\n 45: istore 5\n 47: sipush 1000\n 50: anewarray #36 // class java/lang/Integer\n 53: astore 6\n 55: istore 26\n 57: astore 25\n 59: iload 5\n 61: sipush 1000\n 64: if_icmpge 86\n 67: iload 5\n 69: istore 7\n 71: aload 6\n 73: iload 7\n 75: iconst_0\n 76: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 79: aastore\n 80: iinc 5, 1\n 83: goto 59\n 86: aload 25\n 88: iload 26\n 90: aload 6\n 92: aastore\n 93: iinc 2, 1\n 96: goto 31\n 99: aload_3\n 100: astore_1\n 101: aload_0\n 102: checkcast #42 // class java/lang/Iterable\n 105: astore_2\n 106: iconst_0\n 107: istore_3\n 108: aload_2\n 109: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 114: astore 4\n 116: aload 4\n 118: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 123: ifeq 678\n 126: aload 4\n 128: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 133: astore 5\n 135: aload 5\n 137: checkcast #58 // class java/lang/String\n 140: astore 6\n 142: iconst_0\n 143: istore 7\n 145: aload 6\n 147: checkcast #60 // class java/lang/CharSequence\n 150: iconst_1\n 151: anewarray #58 // class java/lang/String\n 154: astore 8\n 156: aload 8\n 158: iconst_0\n 159: ldc #62 // String\n 161: aastore\n 162: aload 8\n 164: iconst_0\n 165: iconst_0\n 166: bipush 6\n 168: aconst_null\n 169: invokestatic #68 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 172: astore 9\n 174: aload 9\n 176: iconst_2\n 177: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 182: checkcast #58 // class java/lang/String\n 185: iconst_1\n 186: invokestatic #78 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;\n 189: checkcast #60 // class java/lang/CharSequence\n 192: iconst_1\n 193: anewarray #58 // class java/lang/String\n 196: astore 10\n 198: aload 10\n 200: iconst_0\n 201: ldc #80 // String ,\n 203: aastore\n 204: aload 10\n 206: iconst_0\n 207: iconst_0\n 208: bipush 6\n 210: aconst_null\n 211: invokestatic #68 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 214: checkcast #42 // class java/lang/Iterable\n 217: astore 10\n 219: iconst_0\n 220: istore 11\n 222: aload 10\n 224: astore 12\n 226: new #82 // class java/util/ArrayList\n 229: dup\n 230: aload 10\n 232: bipush 10\n 234: invokestatic #88 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 237: invokespecial #91 // Method java/util/ArrayList.\"<init>\":(I)V\n 240: checkcast #93 // class java/util/Collection\n 243: astore 13\n 245: iconst_0\n 246: istore 14\n 248: aload 12\n 250: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 255: astore 15\n 257: aload 15\n 259: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 264: ifeq 311\n 267: aload 15\n 269: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 274: astore 16\n 276: aload 13\n 278: aload 16\n 280: checkcast #58 // class java/lang/String\n 283: astore 17\n 285: astore 18\n 287: iconst_0\n 288: istore 19\n 290: aload 17\n 292: invokestatic #97 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 295: nop\n 296: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 299: aload 18\n 301: swap\n 302: invokeinterface #101, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 307: pop\n 308: goto 257\n 311: aload 13\n 313: checkcast #70 // class java/util/List\n 316: nop\n 317: astore 8\n 319: aload 9\n 321: iconst_3\n 322: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 327: checkcast #60 // class java/lang/CharSequence\n 330: iconst_1\n 331: anewarray #58 // class java/lang/String\n 334: astore 11\n 336: aload 11\n 338: iconst_0\n 339: ldc #103 // String x\n 341: aastore\n 342: aload 11\n 344: iconst_0\n 345: iconst_0\n 346: bipush 6\n 348: aconst_null\n 349: invokestatic #68 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 352: checkcast #42 // class java/lang/Iterable\n 355: astore 11\n 357: iconst_0\n 358: istore 12\n 360: aload 11\n 362: astore 13\n 364: new #82 // class java/util/ArrayList\n 367: dup\n 368: aload 11\n 370: bipush 10\n 372: invokestatic #88 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 375: invokespecial #91 // Method java/util/ArrayList.\"<init>\":(I)V\n 378: checkcast #93 // class java/util/Collection\n 381: astore 14\n 383: iconst_0\n 384: istore 15\n 386: aload 13\n 388: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 393: astore 16\n 395: aload 16\n 397: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 402: ifeq 449\n 405: aload 16\n 407: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 412: astore 17\n 414: aload 14\n 416: aload 17\n 418: checkcast #58 // class java/lang/String\n 421: astore 19\n 423: astore 18\n 425: iconst_0\n 426: istore 20\n 428: aload 19\n 430: invokestatic #97 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 433: nop\n 434: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 437: aload 18\n 439: swap\n 440: invokeinterface #101, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 445: pop\n 446: goto 395\n 449: aload 14\n 451: checkcast #70 // class java/util/List\n 454: nop\n 455: astore 10\n 457: aload 8\n 459: iconst_0\n 460: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 465: checkcast #105 // class java/lang/Number\n 468: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 471: aload 8\n 473: iconst_0\n 474: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 479: checkcast #105 // class java/lang/Number\n 482: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 485: aload 10\n 487: iconst_0\n 488: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 493: checkcast #105 // class java/lang/Number\n 496: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 499: iadd\n 500: invokestatic #115 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 503: checkcast #42 // class java/lang/Iterable\n 506: astore 11\n 508: iconst_0\n 509: istore 12\n 511: aload 11\n 513: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 518: astore 13\n 520: aload 13\n 522: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 527: ifeq 672\n 530: aload 13\n 532: checkcast #117 // class kotlin/collections/IntIterator\n 535: invokevirtual #120 // Method kotlin/collections/IntIterator.nextInt:()I\n 538: istore 14\n 540: iload 14\n 542: istore 15\n 544: iconst_0\n 545: istore 16\n 547: aload 8\n 549: iconst_1\n 550: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 555: checkcast #105 // class java/lang/Number\n 558: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 561: aload 8\n 563: iconst_1\n 564: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 569: checkcast #105 // class java/lang/Number\n 572: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 575: aload 10\n 577: iconst_1\n 578: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 583: checkcast #105 // class java/lang/Number\n 586: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 589: iadd\n 590: invokestatic #115 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 593: checkcast #42 // class java/lang/Iterable\n 596: astore 17\n 598: iconst_0\n 599: istore 19\n 601: aload 17\n 603: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 608: astore 20\n 610: aload 20\n 612: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 617: ifeq 666\n 620: aload 20\n 622: checkcast #117 // class kotlin/collections/IntIterator\n 625: invokevirtual #120 // Method kotlin/collections/IntIterator.nextInt:()I\n 628: istore 21\n 630: iload 21\n 632: istore 22\n 634: iconst_0\n 635: istore 23\n 637: aload_1\n 638: iload 15\n 640: aaload\n 641: astore 24\n 643: aload 24\n 645: iload 22\n 647: aload 24\n 649: iload 22\n 651: aaload\n 652: invokevirtual #121 // Method java/lang/Integer.intValue:()I\n 655: iconst_1\n 656: iadd\n 657: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 660: aastore\n 661: nop\n 662: nop\n 663: goto 610\n 666: nop\n 667: nop\n 668: nop\n 669: goto 520\n 672: nop\n 673: nop\n 674: nop\n 675: goto 116\n 678: nop\n 679: aload_1\n 680: checkcast #123 // class \"[Ljava/lang/Object;\"\n 683: astore_2\n 684: iconst_0\n 685: istore_3\n 686: iconst_0\n 687: istore 4\n 689: iconst_0\n 690: istore 5\n 692: aload_2\n 693: arraylength\n 694: istore 6\n 696: iload 5\n 698: iload 6\n 700: if_icmpge 809\n 703: aload_2\n 704: iload 5\n 706: aaload\n 707: astore 7\n 709: iload 4\n 711: aload 7\n 713: checkcast #34 // class \"[Ljava/lang/Integer;\"\n 716: astore 8\n 718: istore 25\n 720: iconst_0\n 721: istore 9\n 723: aload 8\n 725: astore 10\n 727: iconst_0\n 728: istore 11\n 730: iconst_0\n 731: istore 12\n 733: iconst_0\n 734: istore 13\n 736: aload 10\n 738: arraylength\n 739: istore 14\n 741: iload 13\n 743: iload 14\n 745: if_icmpge 791\n 748: aload 10\n 750: iload 13\n 752: aaload\n 753: astore 15\n 755: aload 15\n 757: checkcast #105 // class java/lang/Number\n 760: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 763: istore 16\n 765: iconst_0\n 766: istore 17\n 768: iload 16\n 770: iconst_1\n 771: if_icmple 778\n 774: iconst_1\n 775: goto 779\n 778: iconst_0\n 779: ifeq 785\n 782: iinc 12, 1\n 785: iinc 13, 1\n 788: goto 741\n 791: iload 12\n 793: nop\n 794: istore 26\n 796: iload 25\n 798: iload 26\n 800: iadd\n 801: istore 4\n 803: iinc 5, 1\n 806: goto 696\n 809: iload 4\n 811: istore_2\n 812: getstatic #129 // Field java/lang/System.out:Ljava/io/PrintStream;\n 815: iload_2\n 816: invokevirtual #134 // Method java/io/PrintStream.println:(I)V\n 819: aload_0\n 820: checkcast #42 // class java/lang/Iterable\n 823: astore_3\n 824: iconst_0\n 825: istore 4\n 827: aload_3\n 828: astore 5\n 830: new #82 // class java/util/ArrayList\n 833: dup\n 834: aload_3\n 835: bipush 10\n 837: invokestatic #88 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 840: invokespecial #91 // Method java/util/ArrayList.\"<init>\":(I)V\n 843: checkcast #93 // class java/util/Collection\n 846: astore 6\n 848: iconst_0\n 849: istore 7\n 851: aload 5\n 853: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 858: astore 8\n 860: aload 8\n 862: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 867: ifeq 1331\n 870: aload 8\n 872: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 877: astore 9\n 879: aload 6\n 881: aload 9\n 883: checkcast #58 // class java/lang/String\n 886: astore 10\n 888: astore 25\n 890: iconst_0\n 891: istore 11\n 893: aload 10\n 895: checkcast #60 // class java/lang/CharSequence\n 898: iconst_1\n 899: anewarray #58 // class java/lang/String\n 902: astore 12\n 904: aload 12\n 906: iconst_0\n 907: ldc #62 // String\n 909: aastore\n 910: aload 12\n 912: iconst_0\n 913: iconst_0\n 914: bipush 6\n 916: aconst_null\n 917: invokestatic #68 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 920: astore 13\n 922: aload 13\n 924: iconst_2\n 925: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 930: checkcast #58 // class java/lang/String\n 933: iconst_1\n 934: invokestatic #78 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;\n 937: checkcast #60 // class java/lang/CharSequence\n 940: iconst_1\n 941: anewarray #58 // class java/lang/String\n 944: astore 14\n 946: aload 14\n 948: iconst_0\n 949: ldc #80 // String ,\n 951: aastore\n 952: aload 14\n 954: iconst_0\n 955: iconst_0\n 956: bipush 6\n 958: aconst_null\n 959: invokestatic #68 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 962: checkcast #42 // class java/lang/Iterable\n 965: astore 14\n 967: iconst_0\n 968: istore 15\n 970: aload 14\n 972: astore 16\n 974: new #82 // class java/util/ArrayList\n 977: dup\n 978: aload 14\n 980: bipush 10\n 982: invokestatic #88 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 985: invokespecial #91 // Method java/util/ArrayList.\"<init>\":(I)V\n 988: checkcast #93 // class java/util/Collection\n 991: astore 17\n 993: iconst_0\n 994: istore 18\n 996: aload 16\n 998: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1003: astore 19\n 1005: aload 19\n 1007: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1012: ifeq 1059\n 1015: aload 19\n 1017: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1022: astore 20\n 1024: aload 17\n 1026: aload 20\n 1028: checkcast #58 // class java/lang/String\n 1031: astore 21\n 1033: astore 22\n 1035: iconst_0\n 1036: istore 23\n 1038: aload 21\n 1040: invokestatic #97 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 1043: nop\n 1044: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1047: aload 22\n 1049: swap\n 1050: invokeinterface #101, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1055: pop\n 1056: goto 1005\n 1059: aload 17\n 1061: checkcast #70 // class java/util/List\n 1064: nop\n 1065: astore 12\n 1067: aload 13\n 1069: iconst_3\n 1070: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1075: checkcast #60 // class java/lang/CharSequence\n 1078: iconst_1\n 1079: anewarray #58 // class java/lang/String\n 1082: astore 15\n 1084: aload 15\n 1086: iconst_0\n 1087: ldc #103 // String x\n 1089: aastore\n 1090: aload 15\n 1092: iconst_0\n 1093: iconst_0\n 1094: bipush 6\n 1096: aconst_null\n 1097: invokestatic #68 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 1100: checkcast #42 // class java/lang/Iterable\n 1103: astore 15\n 1105: iconst_0\n 1106: istore 16\n 1108: aload 15\n 1110: astore 17\n 1112: new #82 // class java/util/ArrayList\n 1115: dup\n 1116: aload 15\n 1118: bipush 10\n 1120: invokestatic #88 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1123: invokespecial #91 // Method java/util/ArrayList.\"<init>\":(I)V\n 1126: checkcast #93 // class java/util/Collection\n 1129: astore 18\n 1131: iconst_0\n 1132: istore 19\n 1134: aload 17\n 1136: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1141: astore 20\n 1143: aload 20\n 1145: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1150: ifeq 1197\n 1153: aload 20\n 1155: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1160: astore 21\n 1162: aload 18\n 1164: aload 21\n 1166: checkcast #58 // class java/lang/String\n 1169: astore 23\n 1171: astore 22\n 1173: iconst_0\n 1174: istore 24\n 1176: aload 23\n 1178: invokestatic #97 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 1181: nop\n 1182: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1185: aload 22\n 1187: swap\n 1188: invokeinterface #101, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1193: pop\n 1194: goto 1143\n 1197: aload 18\n 1199: checkcast #70 // class java/util/List\n 1202: nop\n 1203: astore 14\n 1205: aload 13\n 1207: iconst_0\n 1208: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1213: new #136 // class Point\n 1216: dup\n 1217: aload 12\n 1219: iconst_0\n 1220: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1225: checkcast #105 // class java/lang/Number\n 1228: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 1231: aload 12\n 1233: iconst_1\n 1234: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1239: checkcast #105 // class java/lang/Number\n 1242: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 1245: invokespecial #139 // Method Point.\"<init>\":(II)V\n 1248: new #136 // class Point\n 1251: dup\n 1252: aload 12\n 1254: iconst_0\n 1255: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1260: checkcast #105 // class java/lang/Number\n 1263: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 1266: aload 14\n 1268: iconst_0\n 1269: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1274: checkcast #105 // class java/lang/Number\n 1277: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 1280: iadd\n 1281: aload 12\n 1283: iconst_1\n 1284: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1289: checkcast #105 // class java/lang/Number\n 1292: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 1295: aload 14\n 1297: iconst_1\n 1298: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1303: checkcast #105 // class java/lang/Number\n 1306: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 1309: iadd\n 1310: invokespecial #139 // Method Point.\"<init>\":(II)V\n 1313: invokestatic #145 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 1316: invokestatic #145 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 1319: aload 25\n 1321: swap\n 1322: invokeinterface #101, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1327: pop\n 1328: goto 860\n 1331: aload 6\n 1333: checkcast #70 // class java/util/List\n 1336: nop\n 1337: astore_2\n 1338: aload_2\n 1339: checkcast #42 // class java/lang/Iterable\n 1342: astore_3\n 1343: iconst_0\n 1344: istore 4\n 1346: aload_3\n 1347: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1352: astore 5\n 1354: aload 5\n 1356: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1361: ifeq 1555\n 1364: aload 5\n 1366: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1371: astore 6\n 1373: aload 6\n 1375: checkcast #147 // class kotlin/Pair\n 1378: astore 7\n 1380: iconst_0\n 1381: istore 8\n 1383: aload_2\n 1384: checkcast #42 // class java/lang/Iterable\n 1387: astore 9\n 1389: iconst_0\n 1390: istore 10\n 1392: aload 9\n 1394: instanceof #93 // class java/util/Collection\n 1397: ifeq 1417\n 1400: aload 9\n 1402: checkcast #93 // class java/util/Collection\n 1405: invokeinterface #150, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 1410: ifeq 1417\n 1413: iconst_1\n 1414: goto 1546\n 1417: aload 9\n 1419: invokeinterface #46, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1424: astore 11\n 1426: aload 11\n 1428: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1433: ifeq 1545\n 1436: aload 11\n 1438: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1443: astore 12\n 1445: aload 12\n 1447: checkcast #147 // class kotlin/Pair\n 1450: astore 13\n 1452: iconst_0\n 1453: istore 14\n 1455: aload 7\n 1457: invokevirtual #153 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1460: aload 13\n 1462: invokevirtual #153 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1465: invokestatic #159 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 1468: ifne 1533\n 1471: aload 7\n 1473: invokevirtual #162 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1476: checkcast #147 // class kotlin/Pair\n 1479: invokevirtual #153 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1482: checkcast #136 // class Point\n 1485: aload 7\n 1487: invokevirtual #162 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1490: checkcast #147 // class kotlin/Pair\n 1493: invokevirtual #162 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1496: checkcast #136 // class Point\n 1499: aload 13\n 1501: invokevirtual #162 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1504: checkcast #147 // class kotlin/Pair\n 1507: invokevirtual #153 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1510: checkcast #136 // class Point\n 1513: aload 13\n 1515: invokevirtual #162 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1518: checkcast #147 // class kotlin/Pair\n 1521: invokevirtual #162 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1524: checkcast #136 // class Point\n 1527: invokestatic #166 // Method doNotOverlap:(LPoint;LPoint;LPoint;LPoint;)Z\n 1530: ifeq 1537\n 1533: iconst_1\n 1534: goto 1538\n 1537: iconst_0\n 1538: ifne 1426\n 1541: iconst_0\n 1542: goto 1546\n 1545: iconst_1\n 1546: nop\n 1547: ifeq 1354\n 1550: aload 6\n 1552: goto 1565\n 1555: new #168 // class java/util/NoSuchElementException\n 1558: dup\n 1559: ldc #170 // String Collection contains no element matching the predicate.\n 1561: invokespecial #171 // Method java/util/NoSuchElementException.\"<init>\":(Ljava/lang/String;)V\n 1564: athrow\n 1565: checkcast #147 // class kotlin/Pair\n 1568: invokevirtual #153 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1571: astore_3\n 1572: getstatic #129 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1575: aload_3\n 1576: invokevirtual #174 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1579: return\n\n public static final boolean doNotOverlap(Point, Point, Point, Point);\n Code:\n 0: aload_0\n 1: ldc #228 // String l1\n 3: invokestatic #232 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #234 // String r1\n 9: invokestatic #232 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_2\n 13: ldc #236 // String l2\n 15: invokestatic #232 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload_3\n 19: ldc #238 // String r2\n 21: invokestatic #232 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 24: aload_0\n 25: invokevirtual #241 // Method Point.getX:()I\n 28: aload_3\n 29: invokevirtual #241 // Method Point.getX:()I\n 32: if_icmpge 68\n 35: aload_2\n 36: invokevirtual #241 // Method Point.getX:()I\n 39: aload_1\n 40: invokevirtual #241 // Method Point.getX:()I\n 43: if_icmpge 68\n 46: aload_0\n 47: invokevirtual #244 // Method Point.getY:()I\n 50: aload_3\n 51: invokevirtual #244 // Method Point.getY:()I\n 54: if_icmpge 68\n 57: aload_2\n 58: invokevirtual #244 // Method Point.getY:()I\n 61: aload_1\n 62: invokevirtual #244 // Method Point.getY:()I\n 65: if_icmplt 72\n 68: iconst_1\n 69: goto 73\n 72: iconst_0\n 73: ireturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #248 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
lasp91__DigitsRecognizer_using_Kotlin__4907cbb/src/DigitsRecognizer.kt
import java.io.File import java.util.stream.IntStream import java.util.concurrent.atomic.AtomicInteger data class Observation (val label: String , val Pixels: IntArray) typealias Distance = (IntArray, IntArray) -> Int typealias Classifier = (IntArray) -> String typealias Observations = Array<Observation> fun observationData(csvData: String) : Observation { val columns = csvData.split(',') val label = columns[0] val pixels = columns.subList(1, columns.lastIndex).map(String::toInt) return Observation(label, pixels.toIntArray()) } fun reader(path: String) : Array<Observation> { val observations = File(path).useLines { lines -> lines.drop(1).map(::observationData).toList().toTypedArray() } return observations } val manhattanDistance = { pixels1: IntArray, pixels2: IntArray -> // Using zip and map val dist = pixels1.zip(pixels2) .map { p -> Math.abs(p.first - p.second) } .sum() dist } val manhattanDistanceImperative = fun(pixels1: IntArray, pixels2: IntArray) : Int { var dist = 0 for (i in 0 until pixels1.size) dist += Math.abs(pixels1[i] - pixels2[i]) return dist } val euclideanDistance = { pixels1: IntArray, pixels2: IntArray -> val dist = pixels1.zip(pixels2) // .map { p -> Math.pow((p.first - p.second).toDouble(), 2.0) } .map({ p -> val dist = (p.first - p.second); dist * dist }) .sum() dist } val euclideanDistanceImperative = fun(pixels1: IntArray, pixels2: IntArray) : Int { var dist = 0 for (i in 0 until pixels1.size) { val dif = Math.abs(pixels1[i] - pixels2[i]) dist += dif * dif } return dist } fun classify(trainingSet: Array<Observation>, dist: Distance, pixels: IntArray) : String { val observation = trainingSet.minBy { (_, Pixels) -> dist(Pixels, pixels) } return observation!!.label } fun evaluate(validationSet: Array<Observation>, classifier: (IntArray) -> String) : Unit { // val average = validationSet // .map({ (label, Pixels) -> if (classifier(Pixels) == label) 1.0 else 0.0 }) // .average() // println("Correct: $average") //} val count = validationSet.size val sum = AtomicInteger(0) IntStream.range(0, validationSet.size).parallel().forEach { i -> if (classifier(validationSet[i].Pixels) == validationSet[i].label) sum.addAndGet(1) } println("Correct: ${sum.toDouble() / count}") } //----------------------------------------------------------------------------------------- fun main(args: Array<String>) { val trainingPath = "./Data/trainingsample.csv" val trainingData = reader(trainingPath) val validationPath = "./Data/validationsample.csv" val validationData = reader(validationPath) val manhattanClassifier = fun(pixels: IntArray) : String { return classify(trainingData, manhattanDistanceImperative, pixels) } val euclideanClassifier = fun(pixels: IntArray) : String { return classify(trainingData, euclideanDistanceImperative, pixels) } run { val startTime = System.currentTimeMillis() println(" Manhattan Kotlin") evaluate(validationData, manhattanClassifier) val endTime = System.currentTimeMillis() val elapsedTime = (endTime - startTime) / 1000.0 println(">>> Elapsed time is: $elapsedTime sec") } run { val startTime = System.currentTimeMillis() println(" Euclidean Kotlin") evaluate(validationData, euclideanClassifier) val endTime = System.currentTimeMillis() val elapsedTime = (endTime - startTime) / 1000.0 println(">>> Elapsed time is: $elapsedTime sec") } }
[ { "class_path": "lasp91__DigitsRecognizer_using_Kotlin__4907cbb/DigitsRecognizerKt.class", "javap": "Compiled from \"DigitsRecognizer.kt\"\npublic final class DigitsRecognizerKt {\n private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> manhattanDistance;\n\n private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> manhattanDistanceImperative;\n\n private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> euclideanDistance;\n\n private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> euclideanDistanceImperative;\n\n public static final Observation observationData(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #9 // String csvData\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #17 // class java/lang/CharSequence\n 10: iconst_1\n 11: newarray char\n 13: astore_2\n 14: aload_2\n 15: iconst_0\n 16: bipush 44\n 18: castore\n 19: aload_2\n 20: iconst_0\n 21: iconst_0\n 22: bipush 6\n 24: aconst_null\n 25: invokestatic #23 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;\n 28: astore_1\n 29: aload_1\n 30: iconst_0\n 31: invokeinterface #29, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 36: checkcast #31 // class java/lang/String\n 39: astore_2\n 40: aload_1\n 41: iconst_1\n 42: aload_1\n 43: invokestatic #37 // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I\n 46: invokeinterface #41, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 51: checkcast #43 // class java/lang/Iterable\n 54: astore 4\n 56: iconst_0\n 57: istore 5\n 59: aload 4\n 61: astore 6\n 63: new #45 // class java/util/ArrayList\n 66: dup\n 67: aload 4\n 69: bipush 10\n 71: invokestatic #49 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 74: invokespecial #53 // Method java/util/ArrayList.\"<init>\":(I)V\n 77: checkcast #55 // class java/util/Collection\n 80: astore 7\n 82: iconst_0\n 83: istore 8\n 85: aload 6\n 87: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 92: astore 9\n 94: aload 9\n 96: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 101: ifeq 148\n 104: aload 9\n 106: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 111: astore 10\n 113: aload 7\n 115: aload 10\n 117: checkcast #31 // class java/lang/String\n 120: astore 11\n 122: astore 13\n 124: iconst_0\n 125: istore 12\n 127: aload 11\n 129: invokestatic #75 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 132: nop\n 133: invokestatic #79 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 136: aload 13\n 138: swap\n 139: invokeinterface #83, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 144: pop\n 145: goto 94\n 148: aload 7\n 150: checkcast #25 // class java/util/List\n 153: nop\n 154: astore_3\n 155: new #85 // class Observation\n 158: dup\n 159: aload_2\n 160: aload_3\n 161: checkcast #55 // class java/util/Collection\n 164: invokestatic #89 // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I\n 167: invokespecial #92 // Method Observation.\"<init>\":(Ljava/lang/String;[I)V\n 170: areturn\n\n public static final Observation[] reader(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #115 // String path\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #117 // class java/io/File\n 9: dup\n 10: aload_0\n 11: invokespecial #120 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 14: astore_2\n 15: getstatic #126 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 18: astore_3\n 19: iconst_0\n 20: istore 4\n 22: aload_2\n 23: astore 5\n 25: sipush 8192\n 28: istore 6\n 30: aload 5\n 32: astore 7\n 34: new #128 // class java/io/InputStreamReader\n 37: dup\n 38: new #130 // class java/io/FileInputStream\n 41: dup\n 42: aload 7\n 44: invokespecial #133 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 47: checkcast #135 // class java/io/InputStream\n 50: aload_3\n 51: invokespecial #138 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 54: checkcast #140 // class java/io/Reader\n 57: astore 7\n 59: aload 7\n 61: instanceof #142 // class java/io/BufferedReader\n 64: ifeq 75\n 67: aload 7\n 69: checkcast #142 // class java/io/BufferedReader\n 72: goto 86\n 75: new #142 // class java/io/BufferedReader\n 78: dup\n 79: aload 7\n 81: iload 6\n 83: invokespecial #145 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 86: checkcast #147 // class java/io/Closeable\n 89: astore 5\n 91: aconst_null\n 92: astore 6\n 94: nop\n 95: aload 5\n 97: checkcast #142 // class java/io/BufferedReader\n 100: astore 7\n 102: iconst_0\n 103: istore 8\n 105: aload 7\n 107: invokestatic #153 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;\n 110: astore 9\n 112: iconst_0\n 113: istore 10\n 115: aload 9\n 117: iconst_1\n 118: invokestatic #159 // Method kotlin/sequences/SequencesKt.drop:(Lkotlin/sequences/Sequence;I)Lkotlin/sequences/Sequence;\n 121: getstatic #165 // Field DigitsRecognizerKt$reader$observations$1$1.INSTANCE:LDigitsRecognizerKt$reader$observations$1$1;\n 124: checkcast #167 // class kotlin/jvm/functions/Function1\n 127: invokestatic #171 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 130: invokestatic #175 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;\n 133: checkcast #55 // class java/util/Collection\n 136: astore 11\n 138: iconst_0\n 139: istore 12\n 141: aload 11\n 143: astore 13\n 145: aload 13\n 147: iconst_0\n 148: anewarray #85 // class Observation\n 151: invokeinterface #179, 2 // InterfaceMethod java/util/Collection.toArray:([Ljava/lang/Object;)[Ljava/lang/Object;\n 156: checkcast #181 // class \"[LObservation;\"\n 159: nop\n 160: astore 7\n 162: aload 5\n 164: aload 6\n 166: invokestatic #187 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 169: aload 7\n 171: goto 195\n 174: astore 8\n 176: aload 8\n 178: astore 6\n 180: aload 8\n 182: athrow\n 183: astore 8\n 185: aload 5\n 187: aload 6\n 189: invokestatic #187 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 192: aload 8\n 194: athrow\n 195: nop\n 196: astore_1\n 197: aload_1\n 198: areturn\n Exception table:\n from to target type\n 94 162 174 Class java/lang/Throwable\n 94 162 183 any\n 174 183 183 any\n 183 185 183 any\n\n public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getManhattanDistance();\n Code:\n 0: getstatic #212 // Field manhattanDistance:Lkotlin/jvm/functions/Function2;\n 3: areturn\n\n public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getManhattanDistanceImperative();\n Code:\n 0: getstatic #216 // Field manhattanDistanceImperative:Lkotlin/jvm/functions/Function2;\n 3: areturn\n\n public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getEuclideanDistance();\n Code:\n 0: getstatic #220 // Field euclideanDistance:Lkotlin/jvm/functions/Function2;\n 3: areturn\n\n public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getEuclideanDistanceImperative();\n Code:\n 0: getstatic #224 // Field euclideanDistanceImperative:Lkotlin/jvm/functions/Function2;\n 3: areturn\n\n public static final java.lang.String classify(Observation[], kotlin.jvm.functions.Function2<? super int[], ? super int[], java.lang.Integer>, int[]);\n Code:\n 0: aload_0\n 1: ldc #229 // String trainingSet\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #231 // String dist\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_2\n 13: ldc #232 // String pixels\n 15: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload_0\n 19: astore 4\n 21: iconst_0\n 22: istore 5\n 24: aload 4\n 26: arraylength\n 27: ifne 34\n 30: iconst_1\n 31: goto 35\n 34: iconst_0\n 35: ifeq 46\n 38: new #234 // class java/util/NoSuchElementException\n 41: dup\n 42: invokespecial #237 // Method java/util/NoSuchElementException.\"<init>\":()V\n 45: athrow\n 46: aload 4\n 48: iconst_0\n 49: aaload\n 50: astore 6\n 52: aload 4\n 54: invokestatic #242 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I\n 57: istore 7\n 59: iload 7\n 61: ifne 69\n 64: aload 6\n 66: goto 178\n 69: aload 6\n 71: astore 8\n 73: iconst_0\n 74: istore 9\n 76: aload 8\n 78: invokevirtual #246 // Method Observation.component2:()[I\n 81: astore 10\n 83: aload_1\n 84: aload 10\n 86: aload_2\n 87: invokeinterface #252, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 92: checkcast #254 // class java/lang/Number\n 95: invokevirtual #258 // Method java/lang/Number.intValue:()I\n 98: istore 8\n 100: iconst_1\n 101: istore 9\n 103: iload 9\n 105: iload 7\n 107: if_icmpgt 176\n 110: aload 4\n 112: iload 9\n 114: aaload\n 115: astore 10\n 117: aload 10\n 119: astore 11\n 121: iconst_0\n 122: istore 12\n 124: aload 11\n 126: invokevirtual #246 // Method Observation.component2:()[I\n 129: astore 13\n 131: aload_1\n 132: aload 13\n 134: aload_2\n 135: invokeinterface #252, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 140: checkcast #254 // class java/lang/Number\n 143: invokevirtual #258 // Method java/lang/Number.intValue:()I\n 146: istore 11\n 148: iload 8\n 150: iload 11\n 152: if_icmple 163\n 155: aload 10\n 157: astore 6\n 159: iload 11\n 161: istore 8\n 163: iload 9\n 165: iload 7\n 167: if_icmpeq 176\n 170: iinc 9, 1\n 173: goto 110\n 176: aload 6\n 178: astore_3\n 179: aload_3\n 180: dup\n 181: invokestatic #262 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 184: invokevirtual #266 // Method Observation.getLabel:()Ljava/lang/String;\n 187: areturn\n\n public static final void evaluate(Observation[], kotlin.jvm.functions.Function1<? super int[], java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc_w #286 // String validationSet\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #288 // String classifier\n 11: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_0\n 15: arraylength\n 16: istore_2\n 17: new #290 // class java/util/concurrent/atomic/AtomicInteger\n 20: dup\n 21: iconst_0\n 22: invokespecial #291 // Method java/util/concurrent/atomic/AtomicInteger.\"<init>\":(I)V\n 25: astore_3\n 26: iconst_0\n 27: aload_0\n 28: arraylength\n 29: invokestatic #297 // InterfaceMethod java/util/stream/IntStream.range:(II)Ljava/util/stream/IntStream;\n 32: invokeinterface #301, 1 // InterfaceMethod java/util/stream/IntStream.parallel:()Ljava/util/stream/IntStream;\n 37: aload_1\n 38: aload_0\n 39: aload_3\n 40: invokedynamic #318, 0 // InvokeDynamic #0:accept:(Lkotlin/jvm/functions/Function1;[LObservation;Ljava/util/concurrent/atomic/AtomicInteger;)Ljava/util/function/IntConsumer;\n 45: invokeinterface #322, 2 // InterfaceMethod java/util/stream/IntStream.forEach:(Ljava/util/function/IntConsumer;)V\n 50: new #324 // class java/lang/StringBuilder\n 53: dup\n 54: invokespecial #325 // Method java/lang/StringBuilder.\"<init>\":()V\n 57: ldc_w #327 // String Correct:\n 60: invokevirtual #331 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 63: aload_3\n 64: invokevirtual #335 // Method java/util/concurrent/atomic/AtomicInteger.doubleValue:()D\n 67: iload_2\n 68: i2d\n 69: ddiv\n 70: invokevirtual #338 // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;\n 73: invokevirtual #341 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 76: getstatic #347 // Field java/lang/System.out:Ljava/io/PrintStream;\n 79: swap\n 80: invokevirtual #352 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 83: return\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc_w #360 // String args\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: ldc_w #362 // String ./Data/trainingsample.csv\n 10: astore_1\n 11: aload_1\n 12: invokestatic #364 // Method reader:(Ljava/lang/String;)[LObservation;\n 15: astore_2\n 16: ldc_w #366 // String ./Data/validationsample.csv\n 19: astore_3\n 20: aload_3\n 21: invokestatic #364 // Method reader:(Ljava/lang/String;)[LObservation;\n 24: astore 4\n 26: aload_2\n 27: invokedynamic #378, 0 // InvokeDynamic #1:invoke:([LObservation;)Lkotlin/jvm/functions/Function1;\n 32: astore 5\n 34: aload_2\n 35: invokedynamic #383, 0 // InvokeDynamic #2:invoke:([LObservation;)Lkotlin/jvm/functions/Function1;\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: invokestatic #387 // Method java/lang/System.currentTimeMillis:()J\n 48: lstore 8\n 50: ldc_w #389 // String Manhattan Kotlin\n 53: getstatic #347 // Field java/lang/System.out:Ljava/io/PrintStream;\n 56: swap\n 57: invokevirtual #352 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 60: aload 4\n 62: aload 5\n 64: invokestatic #391 // Method evaluate:([LObservation;Lkotlin/jvm/functions/Function1;)V\n 67: invokestatic #387 // Method java/lang/System.currentTimeMillis:()J\n 70: lstore 10\n 72: lload 10\n 74: lload 8\n 76: lsub\n 77: l2d\n 78: ldc2_w #392 // double 1000.0d\n 81: ddiv\n 82: dstore 12\n 84: new #324 // class java/lang/StringBuilder\n 87: dup\n 88: invokespecial #325 // Method java/lang/StringBuilder.\"<init>\":()V\n 91: ldc_w #395 // String >>> Elapsed time is:\n 94: invokevirtual #331 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 97: dload 12\n 99: invokevirtual #338 // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;\n 102: ldc_w #397 // String sec\n 105: invokevirtual #331 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 108: invokevirtual #341 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 111: getstatic #347 // Field java/lang/System.out:Ljava/io/PrintStream;\n 114: swap\n 115: invokevirtual #352 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 118: nop\n 119: nop\n 120: iconst_0\n 121: istore 7\n 123: invokestatic #387 // Method java/lang/System.currentTimeMillis:()J\n 126: lstore 8\n 128: ldc_w #399 // String Euclidean Kotlin\n 131: getstatic #347 // Field java/lang/System.out:Ljava/io/PrintStream;\n 134: swap\n 135: invokevirtual #352 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 138: aload 4\n 140: aload 6\n 142: invokestatic #391 // Method evaluate:([LObservation;Lkotlin/jvm/functions/Function1;)V\n 145: invokestatic #387 // Method java/lang/System.currentTimeMillis:()J\n 148: lstore 10\n 150: lload 10\n 152: lload 8\n 154: lsub\n 155: l2d\n 156: ldc2_w #392 // double 1000.0d\n 159: ddiv\n 160: dstore 12\n 162: new #324 // class java/lang/StringBuilder\n 165: dup\n 166: invokespecial #325 // Method java/lang/StringBuilder.\"<init>\":()V\n 169: ldc_w #395 // String >>> Elapsed time is:\n 172: invokevirtual #331 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 175: dload 12\n 177: invokevirtual #338 // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;\n 180: ldc_w #397 // String sec\n 183: invokevirtual #331 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 186: invokevirtual #341 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 189: getstatic #347 // Field java/lang/System.out:Ljava/io/PrintStream;\n 192: swap\n 193: invokevirtual #352 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 196: nop\n 197: nop\n 198: return\n\n private static final int manhattanDistance$lambda$2(int[], int[]);\n Code:\n 0: aload_0\n 1: ldc_w #417 // String pixels1\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #419 // String pixels2\n 11: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_0\n 15: aload_1\n 16: invokestatic #423 // Method kotlin/collections/ArraysKt.zip:([I[I)Ljava/util/List;\n 19: checkcast #43 // class java/lang/Iterable\n 22: astore_3\n 23: nop\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #45 // class java/util/ArrayList\n 33: dup\n 34: aload_3\n 35: bipush 10\n 37: invokestatic #49 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 40: invokespecial #53 // Method java/util/ArrayList.\"<init>\":(I)V\n 43: checkcast #55 // class java/util/Collection\n 46: astore 6\n 48: iconst_0\n 49: istore 7\n 51: aload 5\n 53: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 58: astore 8\n 60: aload 8\n 62: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 67: ifeq 134\n 70: aload 8\n 72: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 77: astore 9\n 79: aload 6\n 81: aload 9\n 83: checkcast #425 // class kotlin/Pair\n 86: astore 10\n 88: astore 12\n 90: iconst_0\n 91: istore 11\n 93: aload 10\n 95: invokevirtual #428 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 98: checkcast #254 // class java/lang/Number\n 101: invokevirtual #258 // Method java/lang/Number.intValue:()I\n 104: aload 10\n 106: invokevirtual #431 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 109: checkcast #254 // class java/lang/Number\n 112: invokevirtual #258 // Method java/lang/Number.intValue:()I\n 115: isub\n 116: invokestatic #437 // Method java/lang/Math.abs:(I)I\n 119: invokestatic #79 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 122: aload 12\n 124: swap\n 125: invokeinterface #83, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 130: pop\n 131: goto 60\n 134: aload 6\n 136: checkcast #25 // class java/util/List\n 139: nop\n 140: checkcast #43 // class java/lang/Iterable\n 143: invokestatic #441 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 146: istore_2\n 147: iload_2\n 148: ireturn\n\n private static final int manhattanDistanceImperative$lambda$3(int[], int[]);\n Code:\n 0: iconst_0\n 1: istore_2\n 2: iconst_0\n 3: istore_3\n 4: aload_0\n 5: arraylength\n 6: istore 4\n 8: iload_3\n 9: iload 4\n 11: if_icmpge 33\n 14: iload_2\n 15: aload_0\n 16: iload_3\n 17: iaload\n 18: aload_1\n 19: iload_3\n 20: iaload\n 21: isub\n 22: invokestatic #437 // Method java/lang/Math.abs:(I)I\n 25: iadd\n 26: istore_2\n 27: iinc 3, 1\n 30: goto 8\n 33: iload_2\n 34: ireturn\n\n private static final int euclideanDistance$lambda$5(int[], int[]);\n Code:\n 0: aload_0\n 1: ldc_w #417 // String pixels1\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #419 // String pixels2\n 11: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_0\n 15: aload_1\n 16: invokestatic #423 // Method kotlin/collections/ArraysKt.zip:([I[I)Ljava/util/List;\n 19: checkcast #43 // class java/lang/Iterable\n 22: astore_3\n 23: nop\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #45 // class java/util/ArrayList\n 33: dup\n 34: aload_3\n 35: bipush 10\n 37: invokestatic #49 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 40: invokespecial #53 // Method java/util/ArrayList.\"<init>\":(I)V\n 43: checkcast #55 // class java/util/Collection\n 46: astore 6\n 48: iconst_0\n 49: istore 7\n 51: aload 5\n 53: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 58: astore 8\n 60: aload 8\n 62: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 67: ifeq 138\n 70: aload 8\n 72: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 77: astore 9\n 79: aload 6\n 81: aload 9\n 83: checkcast #425 // class kotlin/Pair\n 86: astore 10\n 88: astore 13\n 90: iconst_0\n 91: istore 11\n 93: aload 10\n 95: invokevirtual #428 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 98: checkcast #254 // class java/lang/Number\n 101: invokevirtual #258 // Method java/lang/Number.intValue:()I\n 104: aload 10\n 106: invokevirtual #431 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 109: checkcast #254 // class java/lang/Number\n 112: invokevirtual #258 // Method java/lang/Number.intValue:()I\n 115: isub\n 116: istore 12\n 118: iload 12\n 120: iload 12\n 122: imul\n 123: invokestatic #79 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 126: aload 13\n 128: swap\n 129: invokeinterface #83, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 134: pop\n 135: goto 60\n 138: aload 6\n 140: checkcast #25 // class java/util/List\n 143: nop\n 144: checkcast #43 // class java/lang/Iterable\n 147: invokestatic #441 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 150: istore_2\n 151: iload_2\n 152: ireturn\n\n private static final int euclideanDistanceImperative$lambda$6(int[], int[]);\n Code:\n 0: iconst_0\n 1: istore_2\n 2: iconst_0\n 3: istore_3\n 4: aload_0\n 5: arraylength\n 6: istore 4\n 8: iload_3\n 9: iload 4\n 11: if_icmpge 40\n 14: aload_0\n 15: iload_3\n 16: iaload\n 17: aload_1\n 18: iload_3\n 19: iaload\n 20: isub\n 21: invokestatic #437 // Method java/lang/Math.abs:(I)I\n 24: istore 5\n 26: iload_2\n 27: iload 5\n 29: iload 5\n 31: imul\n 32: iadd\n 33: istore_2\n 34: iinc 3, 1\n 37: goto 8\n 40: iload_2\n 41: ireturn\n\n private static final void evaluate$lambda$8(kotlin.jvm.functions.Function1, Observation[], java.util.concurrent.atomic.AtomicInteger, int);\n Code:\n 0: aload_0\n 1: aload_1\n 2: iload_3\n 3: aaload\n 4: invokevirtual #453 // Method Observation.getPixels:()[I\n 7: invokeinterface #455, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 12: aload_1\n 13: iload_3\n 14: aaload\n 15: invokevirtual #266 // Method Observation.getLabel:()Ljava/lang/String;\n 18: invokestatic #459 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 21: ifeq 30\n 24: aload_2\n 25: iconst_1\n 26: invokevirtual #462 // Method java/util/concurrent/atomic/AtomicInteger.addAndGet:(I)I\n 29: pop\n 30: return\n\n private static final java.lang.String main$lambda$9(Observation[], int[]);\n Code:\n 0: aload_0\n 1: getstatic #216 // Field manhattanDistanceImperative:Lkotlin/jvm/functions/Function2;\n 4: aload_1\n 5: invokestatic #467 // Method classify:([LObservation;Lkotlin/jvm/functions/Function2;[I)Ljava/lang/String;\n 8: areturn\n\n private static final java.lang.String main$lambda$10(Observation[], int[]);\n Code:\n 0: aload_0\n 1: getstatic #224 // Field euclideanDistanceImperative:Lkotlin/jvm/functions/Function2;\n 4: aload_1\n 5: invokestatic #467 // Method classify:([LObservation;Lkotlin/jvm/functions/Function2;[I)Ljava/lang/String;\n 8: areturn\n\n static {};\n Code:\n 0: invokedynamic #476, 0 // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function2;\n 5: putstatic #212 // Field manhattanDistance:Lkotlin/jvm/functions/Function2;\n 8: invokedynamic #480, 0 // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function2;\n 13: putstatic #216 // Field manhattanDistanceImperative:Lkotlin/jvm/functions/Function2;\n 16: invokedynamic #484, 0 // InvokeDynamic #5:invoke:()Lkotlin/jvm/functions/Function2;\n 21: putstatic #220 // Field euclideanDistance:Lkotlin/jvm/functions/Function2;\n 24: invokedynamic #488, 0 // InvokeDynamic #6:invoke:()Lkotlin/jvm/functions/Function2;\n 29: putstatic #224 // Field euclideanDistanceImperative:Lkotlin/jvm/functions/Function2;\n 32: return\n}\n", "javap_err": "" }, { "class_path": "lasp91__DigitsRecognizer_using_Kotlin__4907cbb/DigitsRecognizerKt$reader$observations$1$1.class", "javap": "Compiled from \"DigitsRecognizer.kt\"\nfinal class DigitsRecognizerKt$reader$observations$1$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.lang.String, Observation> {\n public static final DigitsRecognizerKt$reader$observations$1$1 INSTANCE;\n\n DigitsRecognizerKt$reader$observations$1$1();\n Code:\n 0: aload_0\n 1: iconst_1\n 2: ldc #11 // class DigitsRecognizerKt\n 4: ldc #13 // String observationData\n 6: ldc #15 // String observationData(Ljava/lang/String;)LObservation;\n 8: iconst_1\n 9: invokespecial #18 // Method kotlin/jvm/internal/FunctionReferenceImpl.\"<init>\":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V\n 12: return\n\n public final Observation invoke(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #24 // String p0\n 3: invokestatic #30 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: invokestatic #32 // Method DigitsRecognizerKt.observationData:(Ljava/lang/String;)LObservation;\n 10: areturn\n\n public java.lang.Object invoke(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #36 // class java/lang/String\n 5: invokevirtual #38 // Method invoke:(Ljava/lang/String;)LObservation;\n 8: areturn\n\n static {};\n Code:\n 0: new #2 // class DigitsRecognizerKt$reader$observations$1$1\n 3: dup\n 4: invokespecial #43 // Method \"<init>\":()V\n 7: putstatic #46 // Field INSTANCE:LDigitsRecognizerKt$reader$observations$1$1;\n 10: return\n}\n", "javap_err": "" } ]
Trilgon__LearningKotlin__8273ff6/src/main/kotlin/Main.kt
import java.util.* fun main(args: Array<String>) { val input: StringBuilder = StringBuilder("10.3 + -2") val queueNumbers: Queue<Double> = LinkedList<Double>() val queueActions: Queue<Char> = LinkedList<Char>() println('\"' + input.toString() + '\"') prepareIn(input, queueNumbers, queueActions) calculateIn(queueNumbers, queueActions) } fun prepareIn(input: StringBuilder, queueNumbers: Queue<Double>, queueActions: Queue<Char>) { var numDetected = false var startIndex = 0 val trimmedIn = input.filter { !it.isWhitespace() } for (i in 0..trimmedIn.lastIndex) { when { trimmedIn[i].isDigit() && !numDetected -> { startIndex = i numDetected = true } !trimmedIn[i].isDigit() && numDetected && trimmedIn[i] != '.' -> { queueNumbers.add(trimmedIn.substring(startIndex, i).toDouble()) queueActions.add(trimmedIn[i]) numDetected = false } !trimmedIn[i].isDigit() && !numDetected && trimmedIn[i] == '-' -> { startIndex = i numDetected = true } } } if (numDetected) { queueNumbers.add(trimmedIn.substring(startIndex..trimmedIn.lastIndex).toDouble()) } println(queueNumbers) println(queueActions) } fun calculateIn(queueNumbers: Queue<Double>, queueActions: Queue<Char>) { var action: Char var result = queueNumbers.poll() var operand: Double while (!queueNumbers.isEmpty()) { operand = queueNumbers.poll() action = queueActions.poll() when (action) { '-' -> result -= operand '+' -> result += operand '*' -> result *= operand '/' -> result /= operand '%' -> result = result % operand * -1.0 } } var pointNum = 8.3 println("pointNum = " + pointNum) println(if(pointNum.compareTo(pointNum.toInt()) == 0) pointNum.toInt() else pointNum) println("result = " + result) println(if(result.compareTo(result.toInt()) == 0) result.toInt() else result) }
[ { "class_path": "Trilgon__LearningKotlin__8273ff6/MainKt.class", "javap": "Compiled from \"Main.kt\"\npublic final class MainKt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #17 // class java/lang/StringBuilder\n 9: dup\n 10: ldc #19 // String 10.3 + -2\n 12: invokespecial #23 // Method java/lang/StringBuilder.\"<init>\":(Ljava/lang/String;)V\n 15: astore_1\n 16: new #25 // class java/util/LinkedList\n 19: dup\n 20: invokespecial #28 // Method java/util/LinkedList.\"<init>\":()V\n 23: checkcast #30 // class java/util/Queue\n 26: astore_2\n 27: new #25 // class java/util/LinkedList\n 30: dup\n 31: invokespecial #28 // Method java/util/LinkedList.\"<init>\":()V\n 34: checkcast #30 // class java/util/Queue\n 37: astore_3\n 38: new #17 // class java/lang/StringBuilder\n 41: dup\n 42: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 45: bipush 34\n 47: istore 4\n 49: aload_1\n 50: invokevirtual #35 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 53: dup\n 54: ldc #37 // String toString(...)\n 56: invokestatic #40 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 59: astore 5\n 61: new #17 // class java/lang/StringBuilder\n 64: dup\n 65: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 68: iload 4\n 70: invokevirtual #44 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 73: aload 5\n 75: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 78: invokevirtual #35 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 81: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 84: bipush 34\n 86: invokevirtual #44 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 89: invokevirtual #35 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 92: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 95: swap\n 96: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 99: aload_1\n 100: aload_2\n 101: aload_3\n 102: invokestatic #63 // Method prepareIn:(Ljava/lang/StringBuilder;Ljava/util/Queue;Ljava/util/Queue;)V\n 105: aload_2\n 106: aload_3\n 107: invokestatic #67 // Method calculateIn:(Ljava/util/Queue;Ljava/util/Queue;)V\n 110: return\n\n public static final void prepareIn(java.lang.StringBuilder, java.util.Queue<java.lang.Double>, java.util.Queue<java.lang.Character>);\n Code:\n 0: aload_0\n 1: ldc #75 // String input\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #76 // String queueNumbers\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_2\n 13: ldc #77 // String queueActions\n 15: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: iconst_0\n 19: istore_3\n 20: iconst_0\n 21: istore 4\n 23: aload_0\n 24: checkcast #79 // class java/lang/CharSequence\n 27: astore 6\n 29: iconst_0\n 30: istore 7\n 32: aload 6\n 34: astore 8\n 36: new #17 // class java/lang/StringBuilder\n 39: dup\n 40: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 43: checkcast #81 // class java/lang/Appendable\n 46: astore 9\n 48: iconst_0\n 49: istore 10\n 51: iconst_0\n 52: istore 11\n 54: aload 8\n 56: invokeinterface #85, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 61: istore 12\n 63: iload 11\n 65: iload 12\n 67: if_icmpge 120\n 70: aload 8\n 72: iload 11\n 74: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 79: istore 13\n 81: iload 13\n 83: istore 14\n 85: iconst_0\n 86: istore 15\n 88: iload 14\n 90: invokestatic #95 // Method kotlin/text/CharsKt.isWhitespace:(C)Z\n 93: ifne 100\n 96: iconst_1\n 97: goto 101\n 100: iconst_0\n 101: ifeq 114\n 104: aload 9\n 106: iload 13\n 108: invokeinterface #98, 2 // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;\n 113: pop\n 114: iinc 11, 1\n 117: goto 63\n 120: aload 9\n 122: checkcast #79 // class java/lang/CharSequence\n 125: nop\n 126: astore 5\n 128: iconst_0\n 129: istore 6\n 131: aload 5\n 133: invokestatic #104 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 136: istore 7\n 138: iload 6\n 140: iload 7\n 142: if_icmpgt 310\n 145: nop\n 146: aload 5\n 148: iload 6\n 150: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 155: invokestatic #109 // Method java/lang/Character.isDigit:(C)Z\n 158: ifeq 174\n 161: iload_3\n 162: ifne 174\n 165: iload 6\n 167: istore 4\n 169: iconst_1\n 170: istore_3\n 171: goto 297\n 174: aload 5\n 176: iload 6\n 178: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 183: invokestatic #109 // Method java/lang/Character.isDigit:(C)Z\n 186: ifne 258\n 189: iload_3\n 190: ifeq 258\n 193: aload 5\n 195: iload 6\n 197: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 202: bipush 46\n 204: if_icmpeq 258\n 207: aload_1\n 208: aload 5\n 210: iload 4\n 212: iload 6\n 214: invokeinterface #113, 3 // InterfaceMethod java/lang/CharSequence.subSequence:(II)Ljava/lang/CharSequence;\n 219: invokevirtual #114 // Method java/lang/Object.toString:()Ljava/lang/String;\n 222: invokestatic #120 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D\n 225: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 228: invokeinterface #128, 2 // InterfaceMethod java/util/Queue.add:(Ljava/lang/Object;)Z\n 233: pop\n 234: aload_2\n 235: aload 5\n 237: iload 6\n 239: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 244: invokestatic #131 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 247: invokeinterface #128, 2 // InterfaceMethod java/util/Queue.add:(Ljava/lang/Object;)Z\n 252: pop\n 253: iconst_0\n 254: istore_3\n 255: goto 297\n 258: aload 5\n 260: iload 6\n 262: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 267: invokestatic #109 // Method java/lang/Character.isDigit:(C)Z\n 270: ifne 297\n 273: iload_3\n 274: ifne 297\n 277: aload 5\n 279: iload 6\n 281: invokeinterface #89, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 286: bipush 45\n 288: if_icmpne 297\n 291: iload 6\n 293: istore 4\n 295: iconst_1\n 296: istore_3\n 297: iload 6\n 299: iload 7\n 301: if_icmpeq 310\n 304: iinc 6, 1\n 307: goto 145\n 310: iload_3\n 311: ifeq 346\n 314: aload_1\n 315: aload 5\n 317: new #133 // class kotlin/ranges/IntRange\n 320: dup\n 321: iload 4\n 323: aload 5\n 325: invokestatic #104 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 328: invokespecial #136 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 331: invokestatic #140 // Method kotlin/text/StringsKt.substring:(Ljava/lang/CharSequence;Lkotlin/ranges/IntRange;)Ljava/lang/String;\n 334: invokestatic #120 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D\n 337: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 340: invokeinterface #128, 2 // InterfaceMethod java/util/Queue.add:(Ljava/lang/Object;)Z\n 345: pop\n 346: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 349: aload_1\n 350: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 353: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 356: aload_2\n 357: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 360: return\n\n public static final void calculateIn(java.util.Queue<java.lang.Double>, java.util.Queue<java.lang.Character>);\n Code:\n 0: aload_0\n 1: ldc #76 // String queueNumbers\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #77 // String queueActions\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: iconst_0\n 13: istore_2\n 14: aload_0\n 15: invokeinterface #163, 1 // InterfaceMethod java/util/Queue.poll:()Ljava/lang/Object;\n 20: checkcast #116 // class java/lang/Double\n 23: astore_3\n 24: dconst_0\n 25: dstore 4\n 27: aload_0\n 28: invokeinterface #167, 1 // InterfaceMethod java/util/Queue.isEmpty:()Z\n 33: ifne 202\n 36: aload_0\n 37: invokeinterface #163, 1 // InterfaceMethod java/util/Queue.poll:()Ljava/lang/Object;\n 42: dup\n 43: ldc #169 // String poll(...)\n 45: invokestatic #40 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 48: checkcast #171 // class java/lang/Number\n 51: invokevirtual #175 // Method java/lang/Number.doubleValue:()D\n 54: dstore 4\n 56: aload_1\n 57: invokeinterface #163, 1 // InterfaceMethod java/util/Queue.poll:()Ljava/lang/Object;\n 62: dup\n 63: ldc #169 // String poll(...)\n 65: invokestatic #40 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 68: checkcast #106 // class java/lang/Character\n 71: invokevirtual #179 // Method java/lang/Character.charValue:()C\n 74: istore_2\n 75: iload_2\n 76: lookupswitch { // 5\n 37: 184\n 42: 156\n 43: 142\n 45: 128\n 47: 170\n default: 199\n }\n 128: aload_3\n 129: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 132: dload 4\n 134: dsub\n 135: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 138: astore_3\n 139: goto 27\n 142: aload_3\n 143: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 146: dload 4\n 148: dadd\n 149: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 152: astore_3\n 153: goto 27\n 156: aload_3\n 157: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 160: dload 4\n 162: dmul\n 163: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 166: astore_3\n 167: goto 27\n 170: aload_3\n 171: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 174: dload 4\n 176: ddiv\n 177: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 180: astore_3\n 181: goto 27\n 184: aload_3\n 185: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 188: dload 4\n 190: drem\n 191: ldc2_w #181 // double -1.0d\n 194: dmul\n 195: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 198: astore_3\n 199: goto 27\n 202: ldc2_w #183 // double 8.3d\n 205: dstore 6\n 207: new #17 // class java/lang/StringBuilder\n 210: dup\n 211: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 214: ldc #186 // String pointNum =\n 216: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 219: dload 6\n 221: invokevirtual #189 // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;\n 224: invokevirtual #35 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 227: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 230: swap\n 231: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 234: dload 6\n 236: dload 6\n 238: d2i\n 239: i2d\n 240: invokestatic #193 // Method java/lang/Double.compare:(DD)I\n 243: ifne 255\n 246: dload 6\n 248: d2i\n 249: invokestatic #198 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 252: goto 260\n 255: dload 6\n 257: invokestatic #124 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 260: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 263: swap\n 264: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 267: new #17 // class java/lang/StringBuilder\n 270: dup\n 271: invokespecial #31 // Method java/lang/StringBuilder.\"<init>\":()V\n 274: ldc #200 // String result =\n 276: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 279: aload_3\n 280: invokevirtual #203 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 283: invokevirtual #35 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 286: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 289: swap\n 290: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 293: aload_3\n 294: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 297: aload_3\n 298: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 301: d2i\n 302: i2d\n 303: invokestatic #193 // Method java/lang/Double.compare:(DD)I\n 306: ifne 320\n 309: aload_3\n 310: invokevirtual #180 // Method java/lang/Double.doubleValue:()D\n 313: d2i\n 314: invokestatic #198 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 317: goto 321\n 320: aload_3\n 321: getstatic #53 // Field java/lang/System.out:Ljava/io/PrintStream;\n 324: swap\n 325: invokevirtual #59 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 328: return\n}\n", "javap_err": "" } ]
sukritishah15__DS-Algo-Point__1b6040f/Kotlin/DiameterBinaryTree.kt
/** * Algorithm: Diameter of Binary Tree * Language: Kotlin * Input: * Sample Binary Tree * Output: * Diameter of Binary Tree * Time Complexity: O(n) as we are visiting every node once. * Space Complexity: O(d) where d is the depth of the binary tree * * Sample Input: * 8 * / \ * 3 10 * / \ \ * 1 6 14 * / \ / * 4 7 13 * * Sample Output: * Diameter of Binary Tree: 6 */ import kotlin.math.max class BinaryTree(var value: Int) { var leftChild: BinaryTree? = null var rightChild: BinaryTree? = null } class DiameterBinaryTree { private fun dfs(root: BinaryTree?): Pair<Int, Int> { if (root == null) { return Pair(0, 0) } val leftChild = dfs(root.leftChild) val rightChild = dfs(root.rightChild) val diameter = max(leftChild.first, max(rightChild.first, leftChild.second + rightChild.second)) return Pair(diameter, max(leftChild.second, rightChild.second) + 1) } fun diameterOfBinaryTree(root: BinaryTree?): Int { return dfs(root).first } } fun main() { val tree = BinaryTree(8) tree.leftChild = BinaryTree(3) tree.rightChild = BinaryTree(10) tree.leftChild?.leftChild = BinaryTree(1) tree.leftChild?.rightChild = BinaryTree(6) tree.leftChild?.rightChild?.leftChild = BinaryTree(4) tree.leftChild?.rightChild?.rightChild = BinaryTree(7) tree.rightChild?.rightChild = BinaryTree(14) tree.rightChild?.rightChild?.leftChild = BinaryTree(13) val diam = DiameterBinaryTree() val diameter = diam.diameterOfBinaryTree(tree) println("Diameter of Binary Tree: $diameter") }
[ { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/DiameterBinaryTreeKt.class", "javap": "Compiled from \"DiameterBinaryTree.kt\"\npublic final class DiameterBinaryTreeKt {\n public static final void main();\n Code:\n 0: new #8 // class BinaryTree\n 3: dup\n 4: bipush 8\n 6: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 9: astore_0\n 10: aload_0\n 11: new #8 // class BinaryTree\n 14: dup\n 15: iconst_3\n 16: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 19: invokevirtual #16 // Method BinaryTree.setLeftChild:(LBinaryTree;)V\n 22: aload_0\n 23: new #8 // class BinaryTree\n 26: dup\n 27: bipush 10\n 29: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 32: invokevirtual #19 // Method BinaryTree.setRightChild:(LBinaryTree;)V\n 35: aload_0\n 36: invokevirtual #23 // Method BinaryTree.getLeftChild:()LBinaryTree;\n 39: dup\n 40: ifnull 57\n 43: new #8 // class BinaryTree\n 46: dup\n 47: iconst_1\n 48: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 51: invokevirtual #16 // Method BinaryTree.setLeftChild:(LBinaryTree;)V\n 54: goto 58\n 57: pop\n 58: aload_0\n 59: invokevirtual #23 // Method BinaryTree.getLeftChild:()LBinaryTree;\n 62: dup\n 63: ifnull 81\n 66: new #8 // class BinaryTree\n 69: dup\n 70: bipush 6\n 72: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 75: invokevirtual #19 // Method BinaryTree.setRightChild:(LBinaryTree;)V\n 78: goto 82\n 81: pop\n 82: aload_0\n 83: invokevirtual #23 // Method BinaryTree.getLeftChild:()LBinaryTree;\n 86: dup\n 87: ifnull 111\n 90: invokevirtual #26 // Method BinaryTree.getRightChild:()LBinaryTree;\n 93: dup\n 94: ifnull 111\n 97: new #8 // class BinaryTree\n 100: dup\n 101: iconst_4\n 102: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 105: invokevirtual #16 // Method BinaryTree.setLeftChild:(LBinaryTree;)V\n 108: goto 112\n 111: pop\n 112: aload_0\n 113: invokevirtual #23 // Method BinaryTree.getLeftChild:()LBinaryTree;\n 116: dup\n 117: ifnull 142\n 120: invokevirtual #26 // Method BinaryTree.getRightChild:()LBinaryTree;\n 123: dup\n 124: ifnull 142\n 127: new #8 // class BinaryTree\n 130: dup\n 131: bipush 7\n 133: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 136: invokevirtual #19 // Method BinaryTree.setRightChild:(LBinaryTree;)V\n 139: goto 143\n 142: pop\n 143: aload_0\n 144: invokevirtual #26 // Method BinaryTree.getRightChild:()LBinaryTree;\n 147: dup\n 148: ifnull 166\n 151: new #8 // class BinaryTree\n 154: dup\n 155: bipush 14\n 157: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 160: invokevirtual #19 // Method BinaryTree.setRightChild:(LBinaryTree;)V\n 163: goto 167\n 166: pop\n 167: aload_0\n 168: invokevirtual #26 // Method BinaryTree.getRightChild:()LBinaryTree;\n 171: dup\n 172: ifnull 197\n 175: invokevirtual #26 // Method BinaryTree.getRightChild:()LBinaryTree;\n 178: dup\n 179: ifnull 197\n 182: new #8 // class BinaryTree\n 185: dup\n 186: bipush 13\n 188: invokespecial #12 // Method BinaryTree.\"<init>\":(I)V\n 191: invokevirtual #16 // Method BinaryTree.setLeftChild:(LBinaryTree;)V\n 194: goto 198\n 197: pop\n 198: new #28 // class DiameterBinaryTree\n 201: dup\n 202: invokespecial #30 // Method DiameterBinaryTree.\"<init>\":()V\n 205: astore_1\n 206: aload_1\n 207: aload_0\n 208: invokevirtual #34 // Method DiameterBinaryTree.diameterOfBinaryTree:(LBinaryTree;)I\n 211: istore_2\n 212: new #36 // class java/lang/StringBuilder\n 215: dup\n 216: invokespecial #37 // Method java/lang/StringBuilder.\"<init>\":()V\n 219: ldc #39 // String Diameter of Binary Tree:\n 221: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 224: iload_2\n 225: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 228: invokevirtual #50 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 231: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 234: swap\n 235: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 238: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #71 // Method main:()V\n 3: return\n}\n", "javap_err": "" }, { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/DiameterBinaryTree.class", "javap": "Compiled from \"DiameterBinaryTree.kt\"\npublic final class DiameterBinaryTree {\n public DiameterBinaryTree();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n private final kotlin.Pair<java.lang.Integer, java.lang.Integer> dfs(BinaryTree);\n Code:\n 0: aload_1\n 1: ifnonnull 20\n 4: new #15 // class kotlin/Pair\n 7: dup\n 8: iconst_0\n 9: invokestatic #21 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 12: iconst_0\n 13: invokestatic #21 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 16: invokespecial #24 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 19: areturn\n 20: aload_0\n 21: aload_1\n 22: invokevirtual #30 // Method BinaryTree.getLeftChild:()LBinaryTree;\n 25: invokespecial #32 // Method dfs:(LBinaryTree;)Lkotlin/Pair;\n 28: astore_2\n 29: aload_0\n 30: aload_1\n 31: invokevirtual #35 // Method BinaryTree.getRightChild:()LBinaryTree;\n 34: invokespecial #32 // Method dfs:(LBinaryTree;)Lkotlin/Pair;\n 37: astore_3\n 38: nop\n 39: aload_2\n 40: invokevirtual #39 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 43: checkcast #41 // class java/lang/Number\n 46: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 49: aload_3\n 50: invokevirtual #39 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 53: checkcast #41 // class java/lang/Number\n 56: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 59: aload_2\n 60: invokevirtual #48 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 63: checkcast #41 // class java/lang/Number\n 66: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 69: aload_3\n 70: invokevirtual #48 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 73: checkcast #41 // class java/lang/Number\n 76: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 79: iadd\n 80: invokestatic #54 // Method java/lang/Math.max:(II)I\n 83: invokestatic #54 // Method java/lang/Math.max:(II)I\n 86: istore 4\n 88: new #15 // class kotlin/Pair\n 91: dup\n 92: iload 4\n 94: invokestatic #21 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 97: aload_2\n 98: invokevirtual #48 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 101: checkcast #41 // class java/lang/Number\n 104: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 107: aload_3\n 108: invokevirtual #48 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 111: checkcast #41 // class java/lang/Number\n 114: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 117: invokestatic #54 // Method java/lang/Math.max:(II)I\n 120: iconst_1\n 121: iadd\n 122: invokestatic #21 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 125: invokespecial #24 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 128: areturn\n\n public final int diameterOfBinaryTree(BinaryTree);\n Code:\n 0: aload_0\n 1: aload_1\n 2: invokespecial #32 // Method dfs:(LBinaryTree;)Lkotlin/Pair;\n 5: invokevirtual #39 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 8: checkcast #41 // class java/lang/Number\n 11: invokevirtual #45 // Method java/lang/Number.intValue:()I\n 14: ireturn\n}\n", "javap_err": "" } ]
sukritishah15__DS-Algo-Point__1b6040f/Kotlin/LongestCommonSubSequence.kt
/** * Algorithm: Longest Common Sub-Sequence using Dynamic Programming * Language: Kotlin * Input: * String1 and String2 -> Two Strings * Output: * Integer -> The longest common sub-sequence of String1 and String2 * Time Complexity: O(nStr1*nStr2) * Space Complexity: O(nStr1*nStr2) * * Sample Input: * Enter the first String: * AGGTAB * Enter the second String: * GXTXAYB * * Sample Output: * The length of longest common sub-sequence is: */ import kotlin.math.max class LongestCommonSubSequence { fun longestCommonSubSequence(str1: String, str2: String): Int { val nStr1 = str1.length val nStr2 = str2.length val dp = Array(nStr1 + 1) { IntArray(nStr2 + 1) } (1 until nStr1 + 1).forEach { i -> (1 until (nStr2 + 1)).forEach { j -> if (str1[i - 1] == str2[j - 1]) { dp[i][j] = 1 + dp[i - 1][j - 1] } else { dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) } } } return dp[nStr1][nStr2] } } fun main() { println("Enter the first string: ") val string1 = readLine()!! println("Enter the second string: ") val string2 = readLine()!! val lcs = LongestCommonSubSequence() println("The length of longest common sub-sequence is: ${lcs.longestCommonSubSequence(string1, string2)}") }
[ { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/LongestCommonSubSequence.class", "javap": "Compiled from \"LongestCommonSubSequence.kt\"\npublic final class LongestCommonSubSequence {\n public LongestCommonSubSequence();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int longestCommonSubSequence(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String str1\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #23 // String str2\n 9: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_1\n 13: invokevirtual #29 // Method java/lang/String.length:()I\n 16: istore_3\n 17: aload_2\n 18: invokevirtual #29 // Method java/lang/String.length:()I\n 21: istore 4\n 23: iconst_0\n 24: istore 6\n 26: iload_3\n 27: iconst_1\n 28: iadd\n 29: istore 7\n 31: iload 7\n 33: anewarray #31 // class \"[I\"\n 36: astore 8\n 38: iload 6\n 40: iload 7\n 42: if_icmpge 66\n 45: iload 6\n 47: istore 9\n 49: aload 8\n 51: iload 9\n 53: iload 4\n 55: iconst_1\n 56: iadd\n 57: newarray int\n 59: aastore\n 60: iinc 6, 1\n 63: goto 38\n 66: aload 8\n 68: astore 5\n 70: iconst_1\n 71: iload_3\n 72: iconst_1\n 73: iadd\n 74: invokestatic #37 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 77: checkcast #39 // class java/lang/Iterable\n 80: astore 6\n 82: iconst_0\n 83: istore 7\n 85: aload 6\n 87: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 92: astore 8\n 94: aload 8\n 96: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 101: ifeq 259\n 104: aload 8\n 106: checkcast #51 // class kotlin/collections/IntIterator\n 109: invokevirtual #54 // Method kotlin/collections/IntIterator.nextInt:()I\n 112: istore 9\n 114: iload 9\n 116: istore 10\n 118: iconst_0\n 119: istore 11\n 121: iconst_1\n 122: iload 4\n 124: iconst_1\n 125: iadd\n 126: invokestatic #37 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 129: checkcast #39 // class java/lang/Iterable\n 132: astore 12\n 134: iconst_0\n 135: istore 13\n 137: aload 12\n 139: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 144: astore 14\n 146: aload 14\n 148: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 153: ifeq 253\n 156: aload 14\n 158: checkcast #51 // class kotlin/collections/IntIterator\n 161: invokevirtual #54 // Method kotlin/collections/IntIterator.nextInt:()I\n 164: istore 15\n 166: iload 15\n 168: istore 16\n 170: iconst_0\n 171: istore 17\n 173: aload_1\n 174: iload 10\n 176: iconst_1\n 177: isub\n 178: invokevirtual #58 // Method java/lang/String.charAt:(I)C\n 181: aload_2\n 182: iload 16\n 184: iconst_1\n 185: isub\n 186: invokevirtual #58 // Method java/lang/String.charAt:(I)C\n 189: if_icmpne 217\n 192: aload 5\n 194: iload 10\n 196: aaload\n 197: iload 16\n 199: iconst_1\n 200: aload 5\n 202: iload 10\n 204: iconst_1\n 205: isub\n 206: aaload\n 207: iload 16\n 209: iconst_1\n 210: isub\n 211: iaload\n 212: iadd\n 213: iastore\n 214: goto 248\n 217: aload 5\n 219: iload 10\n 221: aaload\n 222: iload 16\n 224: aload 5\n 226: iload 10\n 228: iconst_1\n 229: isub\n 230: aaload\n 231: iload 16\n 233: iaload\n 234: aload 5\n 236: iload 10\n 238: aaload\n 239: iload 16\n 241: iconst_1\n 242: isub\n 243: iaload\n 244: invokestatic #64 // Method java/lang/Math.max:(II)I\n 247: iastore\n 248: nop\n 249: nop\n 250: goto 146\n 253: nop\n 254: nop\n 255: nop\n 256: goto 94\n 259: nop\n 260: aload 5\n 262: iload_3\n 263: aaload\n 264: iload 4\n 266: iaload\n 267: ireturn\n}\n", "javap_err": "" }, { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/LongestCommonSubSequenceKt.class", "javap": "Compiled from \"LongestCommonSubSequence.kt\"\npublic final class LongestCommonSubSequenceKt {\n public static final void main();\n Code:\n 0: ldc #8 // String Enter the first string:\n 2: getstatic #14 // Field java/lang/System.out:Ljava/io/PrintStream;\n 5: swap\n 6: invokevirtual #20 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 9: invokestatic #26 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 12: dup\n 13: invokestatic #31 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 16: astore_0\n 17: ldc #33 // String Enter the second string:\n 19: getstatic #14 // Field java/lang/System.out:Ljava/io/PrintStream;\n 22: swap\n 23: invokevirtual #20 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 26: invokestatic #26 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 29: dup\n 30: invokestatic #31 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 33: astore_1\n 34: new #35 // class LongestCommonSubSequence\n 37: dup\n 38: invokespecial #38 // Method LongestCommonSubSequence.\"<init>\":()V\n 41: astore_2\n 42: new #40 // class java/lang/StringBuilder\n 45: dup\n 46: invokespecial #41 // Method java/lang/StringBuilder.\"<init>\":()V\n 49: ldc #43 // String The length of longest common sub-sequence is:\n 51: invokevirtual #47 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 54: aload_2\n 55: aload_0\n 56: aload_1\n 57: invokevirtual #51 // Method LongestCommonSubSequence.longestCommonSubSequence:(Ljava/lang/String;Ljava/lang/String;)I\n 60: invokevirtual #54 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 63: invokevirtual #57 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 66: getstatic #14 // Field java/lang/System.out:Ljava/io/PrintStream;\n 69: swap\n 70: invokevirtual #20 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 73: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #65 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
sukritishah15__DS-Algo-Point__1b6040f/Kotlin/MergeSort.kt
/** * Algorithm: Merge Sorting * Language: Kotlin * Input: * a) n: Size of Array * b) arr: Integer Array of size n * Output: * a) Array before applying Merge Sorting * b) Array after applying Merge Sorting * Time Complexity: O(n * log n) * Space Complexity: O(n) * * Sample Input: * Enter the size of the integer array: * 5 * Enter an integer array: * 5 4 8 2 1 * * Sample Output: * Array before sorting is: * 5 4 8 2 1 * Array after sorting is: * 1 2 4 5 8 */ import MergeSort.Companion.printIArray import java.util.* class MergeSort { fun mergeSort(array: IntArray) { val n = array.size if (n < 2) return val mid = n / 2 val left = IntArray(mid) val right = IntArray(n - mid) for (i in 0 until mid) left[i] = array[i] for (i in mid until n) right[i - mid] = array[i] mergeSort(left) mergeSort(right) merge(left, right, array) } private fun merge(left: IntArray, right: IntArray, array: IntArray) { val nLeft = left.size val nRight = right.size var i = 0 var j = 0 var k = 0 while (i < nLeft && j < nRight) { if (left[i] <= right[j]) { array[k] = left[i] k++ i++ } else { array[k] = right[j] k++ j++ } } while (i < nLeft) { array[k] = left[i] i++ k++ } while (j < nRight) { array[k] = right[j] j++ k++ } } companion object { fun printIArray(array: IntArray) { println(array.joinToString(" ")) } } } fun main() { val scanner = Scanner(System.`in`) println("Enter the size of the integer array: ") val n = scanner.nextInt() println("Enter an integer array: ") val arr = IntArray(n) arr.indices.forEach { arr[it] = scanner.nextInt() } val merge = MergeSort() println("Array before sorting is: ") printIArray(arr) merge.mergeSort(arr) println("Array after sorting is: ") printIArray(arr) }
[ { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/MergeSort$Companion.class", "javap": "Compiled from \"MergeSort.kt\"\npublic final class MergeSort$Companion {\n private MergeSort$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final void printIArray(int[]);\n Code:\n 0: aload_1\n 1: ldc #15 // String array\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #23 // String\n 9: checkcast #25 // class java/lang/CharSequence\n 12: aconst_null\n 13: aconst_null\n 14: iconst_0\n 15: aconst_null\n 16: aconst_null\n 17: bipush 62\n 19: aconst_null\n 20: invokestatic #31 // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 23: getstatic #37 // Field java/lang/System.out:Ljava/io/PrintStream;\n 26: swap\n 27: invokevirtual #43 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 30: return\n\n public MergeSort$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #46 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/MergeSortKt.class", "javap": "Compiled from \"MergeSort.kt\"\npublic final class MergeSortKt {\n public static final void main();\n Code:\n 0: new #8 // class java/util/Scanner\n 3: dup\n 4: getstatic #14 // Field java/lang/System.in:Ljava/io/InputStream;\n 7: invokespecial #18 // Method java/util/Scanner.\"<init>\":(Ljava/io/InputStream;)V\n 10: astore_0\n 11: ldc #20 // String Enter the size of the integer array:\n 13: getstatic #24 // Field java/lang/System.out:Ljava/io/PrintStream;\n 16: swap\n 17: invokevirtual #30 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 20: aload_0\n 21: invokevirtual #34 // Method java/util/Scanner.nextInt:()I\n 24: istore_1\n 25: ldc #36 // String Enter an integer array:\n 27: getstatic #24 // Field java/lang/System.out:Ljava/io/PrintStream;\n 30: swap\n 31: invokevirtual #30 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 34: iload_1\n 35: newarray int\n 37: astore_2\n 38: aload_2\n 39: invokestatic #42 // Method kotlin/collections/ArraysKt.getIndices:([I)Lkotlin/ranges/IntRange;\n 42: checkcast #44 // class java/lang/Iterable\n 45: astore_3\n 46: iconst_0\n 47: istore 4\n 49: aload_3\n 50: invokeinterface #48, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 55: astore 5\n 57: aload 5\n 59: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 64: ifeq 97\n 67: aload 5\n 69: checkcast #56 // class kotlin/collections/IntIterator\n 72: invokevirtual #57 // Method kotlin/collections/IntIterator.nextInt:()I\n 75: istore 6\n 77: iload 6\n 79: istore 7\n 81: iconst_0\n 82: istore 8\n 84: aload_2\n 85: iload 7\n 87: aload_0\n 88: invokevirtual #34 // Method java/util/Scanner.nextInt:()I\n 91: iastore\n 92: nop\n 93: nop\n 94: goto 57\n 97: nop\n 98: new #59 // class MergeSort\n 101: dup\n 102: invokespecial #61 // Method MergeSort.\"<init>\":()V\n 105: astore_3\n 106: ldc #63 // String Array before sorting is:\n 108: getstatic #24 // Field java/lang/System.out:Ljava/io/PrintStream;\n 111: swap\n 112: invokevirtual #30 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 115: getstatic #67 // Field MergeSort.Companion:LMergeSort$Companion;\n 118: aload_2\n 119: invokevirtual #73 // Method MergeSort$Companion.printIArray:([I)V\n 122: aload_3\n 123: aload_2\n 124: invokevirtual #76 // Method MergeSort.mergeSort:([I)V\n 127: ldc #78 // String Array after sorting is:\n 129: getstatic #24 // Field java/lang/System.out:Ljava/io/PrintStream;\n 132: swap\n 133: invokevirtual #30 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 136: getstatic #67 // Field MergeSort.Companion:LMergeSort$Companion;\n 139: aload_2\n 140: invokevirtual #73 // Method MergeSort$Companion.printIArray:([I)V\n 143: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #96 // Method main:()V\n 3: return\n}\n", "javap_err": "" }, { "class_path": "sukritishah15__DS-Algo-Point__1b6040f/MergeSort.class", "javap": "Compiled from \"MergeSort.kt\"\npublic final class MergeSort {\n public static final MergeSort$Companion Companion;\n\n public MergeSort();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final void mergeSort(int[]);\n Code:\n 0: aload_1\n 1: ldc #15 // String array\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: arraylength\n 8: istore_2\n 9: iload_2\n 10: iconst_2\n 11: if_icmpge 15\n 14: return\n 15: iload_2\n 16: iconst_2\n 17: idiv\n 18: istore_3\n 19: iload_3\n 20: newarray int\n 22: astore 4\n 24: iload_2\n 25: iload_3\n 26: isub\n 27: newarray int\n 29: astore 5\n 31: iconst_0\n 32: istore 6\n 34: iload 6\n 36: iload_3\n 37: if_icmpge 55\n 40: aload 4\n 42: iload 6\n 44: aload_1\n 45: iload 6\n 47: iaload\n 48: iastore\n 49: iinc 6, 1\n 52: goto 34\n 55: iload_3\n 56: istore 6\n 58: iload 6\n 60: iload_2\n 61: if_icmpge 81\n 64: aload 5\n 66: iload 6\n 68: iload_3\n 69: isub\n 70: aload_1\n 71: iload 6\n 73: iaload\n 74: iastore\n 75: iinc 6, 1\n 78: goto 58\n 81: aload_0\n 82: aload 4\n 84: invokevirtual #23 // Method mergeSort:([I)V\n 87: aload_0\n 88: aload 5\n 90: invokevirtual #23 // Method mergeSort:([I)V\n 93: aload_0\n 94: aload 4\n 96: aload 5\n 98: aload_1\n 99: invokespecial #27 // Method merge:([I[I[I)V\n 102: return\n\n private final void merge(int[], int[], int[]);\n Code:\n 0: aload_1\n 1: arraylength\n 2: istore 4\n 4: aload_2\n 5: arraylength\n 6: istore 5\n 8: iconst_0\n 9: istore 6\n 11: iconst_0\n 12: istore 7\n 14: iconst_0\n 15: istore 8\n 17: iload 6\n 19: iload 4\n 21: if_icmpge 76\n 24: iload 7\n 26: iload 5\n 28: if_icmpge 76\n 31: aload_1\n 32: iload 6\n 34: iaload\n 35: aload_2\n 36: iload 7\n 38: iaload\n 39: if_icmpgt 59\n 42: aload_3\n 43: iload 8\n 45: aload_1\n 46: iload 6\n 48: iaload\n 49: iastore\n 50: iinc 8, 1\n 53: iinc 6, 1\n 56: goto 17\n 59: aload_3\n 60: iload 8\n 62: aload_2\n 63: iload 7\n 65: iaload\n 66: iastore\n 67: iinc 8, 1\n 70: iinc 7, 1\n 73: goto 17\n 76: iload 6\n 78: iload 4\n 80: if_icmpge 100\n 83: aload_3\n 84: iload 8\n 86: aload_1\n 87: iload 6\n 89: iaload\n 90: iastore\n 91: iinc 6, 1\n 94: iinc 8, 1\n 97: goto 76\n 100: iload 7\n 102: iload 5\n 104: if_icmpge 124\n 107: aload_3\n 108: iload 8\n 110: aload_2\n 111: iload 7\n 113: iaload\n 114: iastore\n 115: iinc 7, 1\n 118: iinc 8, 1\n 121: goto 100\n 124: return\n\n static {};\n Code:\n 0: new #42 // class MergeSort$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #45 // Method MergeSort$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #49 // Field Companion:LMergeSort$Companion;\n 11: return\n}\n", "javap_err": "" } ]
dlew__kotlin-riddler__55e9d2f/src/binary.kt
/** * Proof for the Riddler problem from March 18, 2016 * * http://fivethirtyeight.com/features/can-you-best-the-mysterious-man-in-the-trench-coat/ */ fun main(args: Array<String>) { findBestOutcome(1, 1000, 9) } fun findBestOutcome(lowerBound: Int, upperBound: Int, maxGuesses: Int, verbose: Boolean = false) { var best = 0 var bestGuess = 0 for (guess in lowerBound..upperBound) { val outcome = outcome(lowerBound, upperBound, maxGuesses, guess) if (outcome > best) { best = outcome bestGuess = guess } if (verbose) { println(String.format("Guessing %d yields an outcome of %d", guess, outcome)) } } println(String.format("Best outcome: guess %d", bestGuess)) } /** * A measure of how profitable a guess will be - the sum of all successful amounts it can get to */ fun outcome(lowerBound: Int, upperBound: Int, maxGuesses: Int, guess: Int): Int { var outcome = 0 for (actual in lowerBound..upperBound) { val result = binary(lowerBound, upperBound, guess, actual) if (result <= maxGuesses) { outcome += actual } } return outcome } /** * Counts how many times it takes to guess the amount of money. * * This is a non-standard binary search because it allows you to start * on any number (but splits the halves after that). */ fun binary(lowerBound: Int, upperBound: Int, guess: Int, actual: Int): Int { if (lowerBound > upperBound || guess < lowerBound || guess > upperBound || actual < lowerBound || actual > upperBound) { throw IllegalArgumentException("You entered something wrong...") } var left: Int = lowerBound var right: Int = upperBound var iterations: Int = 0 var isFirst: Boolean = true while (true) { // On the first runthrough, don't calculate the midpoint; use the guess provided val current = if (isFirst) guess else (left + right) / 2 isFirst = false iterations += 1 // Each time we do this, it counts as a guess if (current == actual) { break; } else if (current < actual) { left = current + 1 } else if (current > actual) { right = current - 1 } } return iterations }
[ { "class_path": "dlew__kotlin-riddler__55e9d2f/BinaryKt.class", "javap": "Compiled from \"binary.kt\"\npublic final class BinaryKt {\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #9 // String args\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_1\n 7: sipush 1000\n 10: bipush 9\n 12: iconst_0\n 13: bipush 8\n 15: aconst_null\n 16: invokestatic #19 // Method findBestOutcome$default:(IIIZILjava/lang/Object;)V\n 19: return\n\n public static final void findBestOutcome(int, int, int, boolean);\n Code:\n 0: iconst_0\n 1: istore 4\n 3: iconst_0\n 4: istore 5\n 6: iload_0\n 7: istore 6\n 9: iload 6\n 11: iload_1\n 12: if_icmpgt 121\n 15: iload_0\n 16: iload_1\n 17: iload_2\n 18: iload 6\n 20: invokestatic #26 // Method outcome:(IIII)I\n 23: istore 7\n 25: iload 7\n 27: iload 4\n 29: if_icmple 40\n 32: iload 7\n 34: istore 4\n 36: iload 6\n 38: istore 5\n 40: iload_3\n 41: ifeq 109\n 44: getstatic #32 // Field kotlin/jvm/internal/StringCompanionObject.INSTANCE:Lkotlin/jvm/internal/StringCompanionObject;\n 47: pop\n 48: ldc #34 // String Guessing %d yields an outcome of %d\n 50: astore 9\n 52: iconst_2\n 53: anewarray #4 // class java/lang/Object\n 56: astore 10\n 58: aload 10\n 60: iconst_0\n 61: iload 6\n 63: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 66: aastore\n 67: aload 10\n 69: iconst_1\n 70: iload 7\n 72: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 75: aastore\n 76: aload 10\n 78: astore 10\n 80: aload 9\n 82: aload 10\n 84: aload 10\n 86: arraylength\n 87: invokestatic #46 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 90: invokestatic #52 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 93: dup\n 94: ldc #54 // String format(...)\n 96: invokestatic #57 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 99: astore 8\n 101: getstatic #63 // Field java/lang/System.out:Ljava/io/PrintStream;\n 104: aload 8\n 106: invokevirtual #69 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 109: iload 6\n 111: iload_1\n 112: if_icmpeq 121\n 115: iinc 6, 1\n 118: goto 15\n 121: getstatic #32 // Field kotlin/jvm/internal/StringCompanionObject.INSTANCE:Lkotlin/jvm/internal/StringCompanionObject;\n 124: pop\n 125: ldc #71 // String Best outcome: guess %d\n 127: astore 7\n 129: iconst_1\n 130: anewarray #4 // class java/lang/Object\n 133: astore 8\n 135: aload 8\n 137: iconst_0\n 138: iload 5\n 140: invokestatic #40 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 143: aastore\n 144: aload 8\n 146: astore 8\n 148: aload 7\n 150: aload 8\n 152: aload 8\n 154: arraylength\n 155: invokestatic #46 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 158: invokestatic #52 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 161: dup\n 162: ldc #54 // String format(...)\n 164: invokestatic #57 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 167: astore 6\n 169: getstatic #63 // Field java/lang/System.out:Ljava/io/PrintStream;\n 172: aload 6\n 174: invokevirtual #69 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 177: return\n\n public static void findBestOutcome$default(int, int, int, boolean, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: bipush 8\n 4: iand\n 5: ifeq 10\n 8: iconst_0\n 9: istore_3\n 10: iload_0\n 11: iload_1\n 12: iload_2\n 13: iload_3\n 14: invokestatic #82 // Method findBestOutcome:(IIIZ)V\n 17: return\n\n public static final int outcome(int, int, int, int);\n Code:\n 0: iconst_0\n 1: istore 4\n 3: iload_0\n 4: istore 5\n 6: iload 5\n 8: iload_1\n 9: if_icmpgt 47\n 12: iload_0\n 13: iload_1\n 14: iload_3\n 15: iload 5\n 17: invokestatic #85 // Method binary:(IIII)I\n 20: istore 6\n 22: iload 6\n 24: iload_2\n 25: if_icmpgt 35\n 28: iload 4\n 30: iload 5\n 32: iadd\n 33: istore 4\n 35: iload 5\n 37: iload_1\n 38: if_icmpeq 47\n 41: iinc 5, 1\n 44: goto 12\n 47: iload 4\n 49: ireturn\n\n public static final int binary(int, int, int, int);\n Code:\n 0: iload_0\n 1: iload_1\n 2: if_icmpgt 25\n 5: iload_2\n 6: iload_0\n 7: if_icmplt 25\n 10: iload_2\n 11: iload_1\n 12: if_icmpgt 25\n 15: iload_3\n 16: iload_0\n 17: if_icmplt 25\n 20: iload_3\n 21: iload_1\n 22: if_icmple 35\n 25: new #89 // class java/lang/IllegalArgumentException\n 28: dup\n 29: ldc #91 // String You entered something wrong...\n 31: invokespecial #95 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 34: athrow\n 35: iload_0\n 36: istore 4\n 38: iload_1\n 39: istore 5\n 41: iconst_0\n 42: istore 6\n 44: iconst_1\n 45: istore 7\n 47: nop\n 48: iload 7\n 50: ifeq 57\n 53: iload_2\n 54: goto 64\n 57: iload 4\n 59: iload 5\n 61: iadd\n 62: iconst_2\n 63: idiv\n 64: istore 8\n 66: iconst_0\n 67: istore 7\n 69: iinc 6, 1\n 72: iload 8\n 74: iload_3\n 75: if_icmpne 81\n 78: goto 111\n 81: iload 8\n 83: iload_3\n 84: if_icmpge 96\n 87: iload 8\n 89: iconst_1\n 90: iadd\n 91: istore 4\n 93: goto 47\n 96: iload 8\n 98: iload_3\n 99: if_icmple 47\n 102: iload 8\n 104: iconst_1\n 105: isub\n 106: istore 5\n 108: goto 47\n 111: iload 6\n 113: ireturn\n}\n", "javap_err": "" } ]
algorithm-archivists__algorithm-archive__38c40e0/contents/thomas_algorithm/code/kotlin/thomas.kt
private fun thomas(a: DoubleArray, b: DoubleArray, c: DoubleArray, d: DoubleArray): DoubleArray { val cPrime = c.clone() val x = d.clone() val size = a.size cPrime[0] /= b[0] x[0] /= b[0] for (i in 1 until size) { val scale = 1.0 / (b[i] - cPrime[i - 1] * a[i]) cPrime[i] *= scale x[i] = (x[i] - a[i] * x[i - 1]) * scale } for (i in (size - 2) downTo 0) { x[i] -= cPrime[i] * x[i + 1] } return x } fun main(args: Array<String>) { val a = doubleArrayOf(0.0, 2.0, 3.0) val b = doubleArrayOf(1.0, 3.0, 6.0) val c = doubleArrayOf(4.0, 5.0, 0.0) val x = doubleArrayOf(7.0, 5.0, 3.0) val solution = thomas(a, b, c, x) println("System:") println("[%.1f, %.1f, %.1f][x] = [%.1f]".format(b[0], c[0], 0f, x[0])) println("[%.1f, %.1f, %.1f][y] = [%.1f]".format(a[1], b[1], c[1], x[1])) println("[%.1f, %.1f, %.1f][z] = [%.1f]\n".format(0f, a[2], b[2], x[2])) println("Solution:") for (i in solution.indices) { println("[% .5f]".format(solution[i])) } }
[ { "class_path": "algorithm-archivists__algorithm-archive__38c40e0/ThomasKt.class", "javap": "Compiled from \"thomas.kt\"\npublic final class ThomasKt {\n private static final double[] thomas(double[], double[], double[], double[]);\n Code:\n 0: aload_2\n 1: invokevirtual #10 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 4: checkcast #12 // class \"[D\"\n 7: astore 4\n 9: aload_3\n 10: invokevirtual #10 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 13: checkcast #12 // class \"[D\"\n 16: astore 5\n 18: aload_0\n 19: arraylength\n 20: istore 6\n 22: aload 4\n 24: iconst_0\n 25: aload 4\n 27: iconst_0\n 28: daload\n 29: aload_1\n 30: iconst_0\n 31: daload\n 32: ddiv\n 33: dastore\n 34: aload 5\n 36: iconst_0\n 37: aload 5\n 39: iconst_0\n 40: daload\n 41: aload_1\n 42: iconst_0\n 43: daload\n 44: ddiv\n 45: dastore\n 46: iconst_1\n 47: istore 7\n 49: iload 7\n 51: iload 6\n 53: if_icmpge 126\n 56: dconst_1\n 57: aload_1\n 58: iload 7\n 60: daload\n 61: aload 4\n 63: iload 7\n 65: iconst_1\n 66: isub\n 67: daload\n 68: aload_0\n 69: iload 7\n 71: daload\n 72: dmul\n 73: dsub\n 74: ddiv\n 75: dstore 8\n 77: iload 7\n 79: istore 10\n 81: aload 4\n 83: iload 10\n 85: aload 4\n 87: iload 10\n 89: daload\n 90: dload 8\n 92: dmul\n 93: dastore\n 94: aload 5\n 96: iload 7\n 98: aload 5\n 100: iload 7\n 102: daload\n 103: aload_0\n 104: iload 7\n 106: daload\n 107: aload 5\n 109: iload 7\n 111: iconst_1\n 112: isub\n 113: daload\n 114: dmul\n 115: dsub\n 116: dload 8\n 118: dmul\n 119: dastore\n 120: iinc 7, 1\n 123: goto 49\n 126: iload 6\n 128: iconst_2\n 129: isub\n 130: istore 7\n 132: iconst_m1\n 133: iload 7\n 135: if_icmpge 172\n 138: iload 7\n 140: istore 8\n 142: aload 5\n 144: iload 8\n 146: aload 5\n 148: iload 8\n 150: daload\n 151: aload 4\n 153: iload 7\n 155: daload\n 156: aload 5\n 158: iload 7\n 160: iconst_1\n 161: iadd\n 162: daload\n 163: dmul\n 164: dsub\n 165: dastore\n 166: iinc 7, -1\n 169: goto 132\n 172: aload 5\n 174: areturn\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #28 // String args\n 3: invokestatic #34 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_3\n 7: newarray double\n 9: astore_2\n 10: aload_2\n 11: iconst_0\n 12: dconst_0\n 13: dastore\n 14: aload_2\n 15: iconst_1\n 16: ldc2_w #35 // double 2.0d\n 19: dastore\n 20: aload_2\n 21: iconst_2\n 22: ldc2_w #37 // double 3.0d\n 25: dastore\n 26: aload_2\n 27: astore_1\n 28: iconst_3\n 29: newarray double\n 31: astore_3\n 32: aload_3\n 33: iconst_0\n 34: dconst_1\n 35: dastore\n 36: aload_3\n 37: iconst_1\n 38: ldc2_w #37 // double 3.0d\n 41: dastore\n 42: aload_3\n 43: iconst_2\n 44: ldc2_w #39 // double 6.0d\n 47: dastore\n 48: aload_3\n 49: astore_2\n 50: iconst_3\n 51: newarray double\n 53: astore 4\n 55: aload 4\n 57: iconst_0\n 58: ldc2_w #41 // double 4.0d\n 61: dastore\n 62: aload 4\n 64: iconst_1\n 65: ldc2_w #43 // double 5.0d\n 68: dastore\n 69: aload 4\n 71: iconst_2\n 72: dconst_0\n 73: dastore\n 74: aload 4\n 76: astore_3\n 77: iconst_3\n 78: newarray double\n 80: astore 5\n 82: aload 5\n 84: iconst_0\n 85: ldc2_w #45 // double 7.0d\n 88: dastore\n 89: aload 5\n 91: iconst_1\n 92: ldc2_w #43 // double 5.0d\n 95: dastore\n 96: aload 5\n 98: iconst_2\n 99: ldc2_w #37 // double 3.0d\n 102: dastore\n 103: aload 5\n 105: astore 4\n 107: aload_1\n 108: aload_2\n 109: aload_3\n 110: aload 4\n 112: invokestatic #48 // Method thomas:([D[D[D[D)[D\n 115: astore 5\n 117: ldc #50 // String System:\n 119: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 122: swap\n 123: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 126: ldc #64 // String [%.1f, %.1f, %.1f][x] = [%.1f]\n 128: astore 6\n 130: iconst_4\n 131: anewarray #4 // class java/lang/Object\n 134: astore 7\n 136: aload 7\n 138: iconst_0\n 139: aload_2\n 140: iconst_0\n 141: daload\n 142: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 145: aastore\n 146: aload 7\n 148: iconst_1\n 149: aload_3\n 150: iconst_0\n 151: daload\n 152: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 155: aastore\n 156: aload 7\n 158: iconst_2\n 159: fconst_0\n 160: invokestatic #75 // Method java/lang/Float.valueOf:(F)Ljava/lang/Float;\n 163: aastore\n 164: aload 7\n 166: iconst_3\n 167: aload 4\n 169: iconst_0\n 170: daload\n 171: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 174: aastore\n 175: aload 7\n 177: astore 7\n 179: aload 6\n 181: aload 7\n 183: aload 7\n 185: arraylength\n 186: invokestatic #81 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 189: invokestatic #87 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 192: dup\n 193: ldc #89 // String format(...)\n 195: invokestatic #92 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 198: astore 6\n 200: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 203: aload 6\n 205: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 208: ldc #94 // String [%.1f, %.1f, %.1f][y] = [%.1f]\n 210: astore 6\n 212: iconst_4\n 213: anewarray #4 // class java/lang/Object\n 216: astore 7\n 218: aload 7\n 220: iconst_0\n 221: aload_1\n 222: iconst_1\n 223: daload\n 224: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 227: aastore\n 228: aload 7\n 230: iconst_1\n 231: aload_2\n 232: iconst_1\n 233: daload\n 234: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 237: aastore\n 238: aload 7\n 240: iconst_2\n 241: aload_3\n 242: iconst_1\n 243: daload\n 244: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 247: aastore\n 248: aload 7\n 250: iconst_3\n 251: aload 4\n 253: iconst_1\n 254: daload\n 255: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 258: aastore\n 259: aload 7\n 261: astore 7\n 263: aload 6\n 265: aload 7\n 267: aload 7\n 269: arraylength\n 270: invokestatic #81 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 273: invokestatic #87 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 276: dup\n 277: ldc #89 // String format(...)\n 279: invokestatic #92 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 282: astore 6\n 284: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 287: aload 6\n 289: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 292: ldc #96 // String [%.1f, %.1f, %.1f][z] = [%.1f]\\n\n 294: astore 6\n 296: iconst_4\n 297: anewarray #4 // class java/lang/Object\n 300: astore 7\n 302: aload 7\n 304: iconst_0\n 305: fconst_0\n 306: invokestatic #75 // Method java/lang/Float.valueOf:(F)Ljava/lang/Float;\n 309: aastore\n 310: aload 7\n 312: iconst_1\n 313: aload_1\n 314: iconst_2\n 315: daload\n 316: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 319: aastore\n 320: aload 7\n 322: iconst_2\n 323: aload_2\n 324: iconst_2\n 325: daload\n 326: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 329: aastore\n 330: aload 7\n 332: iconst_3\n 333: aload 4\n 335: iconst_2\n 336: daload\n 337: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 340: aastore\n 341: aload 7\n 343: astore 7\n 345: aload 6\n 347: aload 7\n 349: aload 7\n 351: arraylength\n 352: invokestatic #81 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 355: invokestatic #87 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 358: dup\n 359: ldc #89 // String format(...)\n 361: invokestatic #92 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 364: astore 6\n 366: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 369: aload 6\n 371: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 374: ldc #98 // String Solution:\n 376: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 379: swap\n 380: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 383: iconst_0\n 384: istore 6\n 386: aload 5\n 388: arraylength\n 389: istore 7\n 391: iload 6\n 393: iload 7\n 395: if_icmpge 459\n 398: ldc #100 // String [% .5f]\n 400: astore 8\n 402: iconst_1\n 403: anewarray #4 // class java/lang/Object\n 406: astore 9\n 408: aload 9\n 410: iconst_0\n 411: aload 5\n 413: iload 6\n 415: daload\n 416: invokestatic #70 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 419: aastore\n 420: aload 9\n 422: astore 9\n 424: aload 8\n 426: aload 9\n 428: aload 9\n 430: arraylength\n 431: invokestatic #81 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 434: invokestatic #87 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 437: dup\n 438: ldc #89 // String format(...)\n 440: invokestatic #92 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 443: astore 8\n 445: getstatic #56 // Field java/lang/System.out:Ljava/io/PrintStream;\n 448: aload 8\n 450: invokevirtual #62 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 453: iinc 6, 1\n 456: goto 391\n 459: return\n}\n", "javap_err": "" } ]
victorYghor__Kotlin-Problems__0d30e37/Create-an-euphonious-word/src/main/kotlin/Main.kt
val vowels: List<Char> = listOf('a', 'e', 'i', 'o', 'u', 'y') val consonants: List<Char> = listOf('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z') fun fixClusterVowels(cluster: String): String { val listOfVowels: MutableList<Char> = cluster.toMutableList() val correctionI = listOfVowels.size / 2 for (i in 2 until(listOfVowels.lastIndex + correctionI) step 3) { listOfVowels.add(i, consonants.random()) } return listOfVowels.joinToString("") } fun fixClusterConsonants(cluster:String): String { val listOfConsonants: MutableList<Char> = cluster.toMutableList() val correctionI = listOfConsonants.size / 2 for (i in 2 until(listOfConsonants.lastIndex + correctionI) step 3) { // start in the index 2 because a vowel is put in the 3rd element if a put index 3 the word fit in the 4th and don't solve the problem listOfConsonants.add(i, vowels.random()) } return listOfConsonants.joinToString("") } fun findClusters(word: String): List<Int?> { val clusterIndices: List<Int?> for (i in word.indices) { var quantV = 0 do { if (vowels.contains(word[i + quantV]) && i + quantV + 1 <= word.lastIndex) { ++quantV } else if (i + quantV == word.lastIndex && vowels.contains(word[i + quantV])) { ++quantV } } while (i + quantV <= word.lastIndex && vowels.contains(word[i + quantV])) if (quantV >= 3) { clusterIndices = listOf(i, i + quantV) return clusterIndices } var quantC = 0 do { if (consonants.contains(word[i + quantC]) && i + quantC + 1 <= word.lastIndex) { ++quantC } else if (i + quantC == word.lastIndex && consonants.contains(word[i + quantC])) { ++quantC } } while (i + quantC <= word.lastIndex && consonants.contains(word[i + quantC])) if (quantC >= 3) { clusterIndices = listOf(i, i + quantC) return clusterIndices } } clusterIndices = listOf(null) return clusterIndices } fun solveClusters(wordParam: String): String { var word = wordParam var indexCluster = findClusters(word) while (indexCluster[0] != null) { val cluster: String = word.substring(indexCluster[0] ?: 0, indexCluster[1] ?: 0) if (vowels.contains(cluster[0])) { val fixedCluster = fixClusterVowels(cluster) word = word.replaceFirst(cluster, fixedCluster) indexCluster = findClusters(word) } else if (consonants.contains(cluster[0])) { val fixedCluster = fixClusterConsonants(cluster) word = word.replaceFirst(cluster, fixedCluster) indexCluster = findClusters(word) } else { break } } return word } fun main() { val word = readln() println(solveClusters(word)) println(solveClusters(word).length - word.length) } /* val vowels: List<Char> = listOf('a', 'e', 'i', 'o', 'u', 'y') val consonants: List<Char> = listOf('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z') fun findClusters(word: String):MutableList<Int?> { val sizesOfClusters: MutableList<Int?> = mutableListOf() var countV = 2 var countC = 2 var lastLetter: Char? = null var nextToLetter: Char? = null for (letter in word) { if (vowels.contains(letter) && (if (lastLetter != null ) vowels.contains(lastLetter) else false) && vowels.contains(nextToLetter)) { ++countV } else if (consonants.contains(letter) && (if (lastLetter != null ) consonants.contains(lastLetter) else false) && consonants.contains(nextToLetter)){ ++countC } else if (countV >= 3) { sizesOfClusters.add(countV) countV = 2 } else if (countC >= 3) { sizesOfClusters.add(countC) countC = 2 } nextToLetter = lastLetter lastLetter = letter } if (countV >= 3) { sizesOfClusters.add(countV) } else if (countC >= 3) { sizesOfClusters.add(countC) } return sizesOfClusters } fun lettersToPut(clusters: MutableList<Int?>): Int { if (clusters.size == 0) { return 0 } for (i in clusters.indices) { if (clusters[i]!! % 2 == 0 ) { clusters[i] = clusters[i]!! / 2 - 1 } else if (clusters[i]!! % 2 == 1) { clusters[i] = clusters[i]!! / 2 } } var sum = 0 for (size in clusters){ sum += size!! } return sum } fun main() { val word = readln() println(lettersToPut(findClusters(word))) } */
[ { "class_path": "victorYghor__Kotlin-Problems__0d30e37/MainKt.class", "javap": "Compiled from \"Main.kt\"\npublic final class MainKt {\n private static final java.util.List<java.lang.Character> vowels;\n\n private static final java.util.List<java.lang.Character> consonants;\n\n public static final java.util.List<java.lang.Character> getVowels();\n Code:\n 0: getstatic #12 // Field vowels:Ljava/util/List;\n 3: areturn\n\n public static final java.util.List<java.lang.Character> getConsonants();\n Code:\n 0: getstatic #16 // Field consonants:Ljava/util/List;\n 3: areturn\n\n public static final java.lang.String fixClusterVowels(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #20 // String cluster\n 3: invokestatic #26 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #28 // class java/lang/CharSequence\n 10: invokestatic #34 // Method kotlin/text/StringsKt.toMutableList:(Ljava/lang/CharSequence;)Ljava/util/List;\n 13: astore_1\n 14: aload_1\n 15: invokeinterface #40, 1 // InterfaceMethod java/util/List.size:()I\n 20: iconst_2\n 21: idiv\n 22: istore_2\n 23: iconst_2\n 24: aload_1\n 25: invokestatic #46 // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I\n 28: iload_2\n 29: iadd\n 30: invokestatic #52 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 33: checkcast #54 // class kotlin/ranges/IntProgression\n 36: iconst_3\n 37: invokestatic #58 // Method kotlin/ranges/RangesKt.step:(Lkotlin/ranges/IntProgression;I)Lkotlin/ranges/IntProgression;\n 40: astore_3\n 41: aload_3\n 42: invokevirtual #61 // Method kotlin/ranges/IntProgression.getFirst:()I\n 45: istore 4\n 47: aload_3\n 48: invokevirtual #64 // Method kotlin/ranges/IntProgression.getLast:()I\n 51: istore 5\n 53: aload_3\n 54: invokevirtual #67 // Method kotlin/ranges/IntProgression.getStep:()I\n 57: istore 6\n 59: iload 6\n 61: ifle 71\n 64: iload 4\n 66: iload 5\n 68: if_icmple 83\n 71: iload 6\n 73: ifge 123\n 76: iload 5\n 78: iload 4\n 80: if_icmpgt 123\n 83: aload_1\n 84: iload 4\n 86: getstatic #16 // Field consonants:Ljava/util/List;\n 89: checkcast #69 // class java/util/Collection\n 92: getstatic #75 // Field kotlin/random/Random.Default:Lkotlin/random/Random$Default;\n 95: checkcast #71 // class kotlin/random/Random\n 98: invokestatic #79 // Method kotlin/collections/CollectionsKt.random:(Ljava/util/Collection;Lkotlin/random/Random;)Ljava/lang/Object;\n 101: invokeinterface #83, 3 // InterfaceMethod java/util/List.add:(ILjava/lang/Object;)V\n 106: iload 4\n 108: iload 5\n 110: if_icmpeq 123\n 113: iload 4\n 115: iload 6\n 117: iadd\n 118: istore 4\n 120: goto 83\n 123: aload_1\n 124: checkcast #85 // class java/lang/Iterable\n 127: ldc #87 // String\n 129: checkcast #28 // class java/lang/CharSequence\n 132: aconst_null\n 133: aconst_null\n 134: iconst_0\n 135: aconst_null\n 136: aconst_null\n 137: bipush 62\n 139: aconst_null\n 140: invokestatic #91 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 143: areturn\n\n public static final java.lang.String fixClusterConsonants(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #20 // String cluster\n 3: invokestatic #26 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #28 // class java/lang/CharSequence\n 10: invokestatic #34 // Method kotlin/text/StringsKt.toMutableList:(Ljava/lang/CharSequence;)Ljava/util/List;\n 13: astore_1\n 14: aload_1\n 15: invokeinterface #40, 1 // InterfaceMethod java/util/List.size:()I\n 20: iconst_2\n 21: idiv\n 22: istore_2\n 23: iconst_2\n 24: aload_1\n 25: invokestatic #46 // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I\n 28: iload_2\n 29: iadd\n 30: invokestatic #52 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 33: checkcast #54 // class kotlin/ranges/IntProgression\n 36: iconst_3\n 37: invokestatic #58 // Method kotlin/ranges/RangesKt.step:(Lkotlin/ranges/IntProgression;I)Lkotlin/ranges/IntProgression;\n 40: astore_3\n 41: aload_3\n 42: invokevirtual #61 // Method kotlin/ranges/IntProgression.getFirst:()I\n 45: istore 4\n 47: aload_3\n 48: invokevirtual #64 // Method kotlin/ranges/IntProgression.getLast:()I\n 51: istore 5\n 53: aload_3\n 54: invokevirtual #67 // Method kotlin/ranges/IntProgression.getStep:()I\n 57: istore 6\n 59: iload 6\n 61: ifle 71\n 64: iload 4\n 66: iload 5\n 68: if_icmple 83\n 71: iload 6\n 73: ifge 123\n 76: iload 5\n 78: iload 4\n 80: if_icmpgt 123\n 83: aload_1\n 84: iload 4\n 86: getstatic #12 // Field vowels:Ljava/util/List;\n 89: checkcast #69 // class java/util/Collection\n 92: getstatic #75 // Field kotlin/random/Random.Default:Lkotlin/random/Random$Default;\n 95: checkcast #71 // class kotlin/random/Random\n 98: invokestatic #79 // Method kotlin/collections/CollectionsKt.random:(Ljava/util/Collection;Lkotlin/random/Random;)Ljava/lang/Object;\n 101: invokeinterface #83, 3 // InterfaceMethod java/util/List.add:(ILjava/lang/Object;)V\n 106: iload 4\n 108: iload 5\n 110: if_icmpeq 123\n 113: iload 4\n 115: iload 6\n 117: iadd\n 118: istore 4\n 120: goto 83\n 123: aload_1\n 124: checkcast #85 // class java/lang/Iterable\n 127: ldc #87 // String\n 129: checkcast #28 // class java/lang/CharSequence\n 132: aconst_null\n 133: aconst_null\n 134: iconst_0\n 135: aconst_null\n 136: aconst_null\n 137: bipush 62\n 139: aconst_null\n 140: invokestatic #91 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 143: areturn\n\n public static final java.util.List<java.lang.Integer> findClusters(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #105 // String word\n 3: invokestatic #26 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aconst_null\n 7: astore_1\n 8: iconst_0\n 9: istore_2\n 10: aload_0\n 11: checkcast #28 // class java/lang/CharSequence\n 14: invokeinterface #108, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 19: istore_3\n 20: iload_2\n 21: iload_3\n 22: if_icmpge 353\n 25: iconst_0\n 26: istore 4\n 28: getstatic #12 // Field vowels:Ljava/util/List;\n 31: aload_0\n 32: iload_2\n 33: iload 4\n 35: iadd\n 36: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 39: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 42: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 47: ifeq 72\n 50: iload_2\n 51: iload 4\n 53: iadd\n 54: iconst_1\n 55: iadd\n 56: aload_0\n 57: checkcast #28 // class java/lang/CharSequence\n 60: invokestatic #125 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 63: if_icmpgt 72\n 66: iinc 4, 1\n 69: goto 111\n 72: iload_2\n 73: iload 4\n 75: iadd\n 76: aload_0\n 77: checkcast #28 // class java/lang/CharSequence\n 80: invokestatic #125 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 83: if_icmpne 111\n 86: getstatic #12 // Field vowels:Ljava/util/List;\n 89: aload_0\n 90: iload_2\n 91: iload 4\n 93: iadd\n 94: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 97: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 100: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 105: ifeq 111\n 108: iinc 4, 1\n 111: iload_2\n 112: iload 4\n 114: iadd\n 115: aload_0\n 116: checkcast #28 // class java/lang/CharSequence\n 119: invokestatic #125 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 122: if_icmpgt 147\n 125: getstatic #12 // Field vowels:Ljava/util/List;\n 128: aload_0\n 129: iload_2\n 130: iload 4\n 132: iadd\n 133: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 136: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 139: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 144: ifne 28\n 147: iload 4\n 149: iconst_3\n 150: if_icmplt 186\n 153: iconst_2\n 154: anewarray #127 // class java/lang/Integer\n 157: astore 5\n 159: aload 5\n 161: iconst_0\n 162: iload_2\n 163: invokestatic #130 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 166: aastore\n 167: aload 5\n 169: iconst_1\n 170: iload_2\n 171: iload 4\n 173: iadd\n 174: invokestatic #130 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 177: aastore\n 178: aload 5\n 180: invokestatic #134 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 183: astore_1\n 184: aload_1\n 185: areturn\n 186: iconst_0\n 187: istore 5\n 189: getstatic #16 // Field consonants:Ljava/util/List;\n 192: aload_0\n 193: iload_2\n 194: iload 5\n 196: iadd\n 197: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 200: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 203: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 208: ifeq 233\n 211: iload_2\n 212: iload 5\n 214: iadd\n 215: iconst_1\n 216: iadd\n 217: aload_0\n 218: checkcast #28 // class java/lang/CharSequence\n 221: invokestatic #125 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 224: if_icmpgt 233\n 227: iinc 5, 1\n 230: goto 272\n 233: iload_2\n 234: iload 5\n 236: iadd\n 237: aload_0\n 238: checkcast #28 // class java/lang/CharSequence\n 241: invokestatic #125 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 244: if_icmpne 272\n 247: getstatic #16 // Field consonants:Ljava/util/List;\n 250: aload_0\n 251: iload_2\n 252: iload 5\n 254: iadd\n 255: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 258: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 261: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 266: ifeq 272\n 269: iinc 5, 1\n 272: iload_2\n 273: iload 5\n 275: iadd\n 276: aload_0\n 277: checkcast #28 // class java/lang/CharSequence\n 280: invokestatic #125 // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I\n 283: if_icmpgt 308\n 286: getstatic #16 // Field consonants:Ljava/util/List;\n 289: aload_0\n 290: iload_2\n 291: iload 5\n 293: iadd\n 294: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 297: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 300: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 305: ifne 189\n 308: iload 5\n 310: iconst_3\n 311: if_icmplt 347\n 314: iconst_2\n 315: anewarray #127 // class java/lang/Integer\n 318: astore 6\n 320: aload 6\n 322: iconst_0\n 323: iload_2\n 324: invokestatic #130 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 327: aastore\n 328: aload 6\n 330: iconst_1\n 331: iload_2\n 332: iload 5\n 334: iadd\n 335: invokestatic #130 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 338: aastore\n 339: aload 6\n 341: invokestatic #134 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 344: astore_1\n 345: aload_1\n 346: areturn\n 347: iinc 2, 1\n 350: goto 20\n 353: aconst_null\n 354: invokestatic #137 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 357: astore_1\n 358: aload_1\n 359: areturn\n\n public static final java.lang.String solveClusters(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #143 // String wordParam\n 3: invokestatic #26 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_1\n 8: aload_1\n 9: invokestatic #145 // Method findClusters:(Ljava/lang/String;)Ljava/util/List;\n 12: astore_2\n 13: aload_2\n 14: iconst_0\n 15: invokeinterface #149, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 20: ifnull 181\n 23: aload_1\n 24: astore 4\n 26: aload_2\n 27: iconst_0\n 28: invokeinterface #149, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 33: checkcast #127 // class java/lang/Integer\n 36: dup\n 37: ifnull 46\n 40: invokevirtual #152 // Method java/lang/Integer.intValue:()I\n 43: goto 48\n 46: pop\n 47: iconst_0\n 48: istore 5\n 50: aload_2\n 51: iconst_1\n 52: invokeinterface #149, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 57: checkcast #127 // class java/lang/Integer\n 60: dup\n 61: ifnull 70\n 64: invokevirtual #152 // Method java/lang/Integer.intValue:()I\n 67: goto 72\n 70: pop\n 71: iconst_0\n 72: istore 6\n 74: aload 4\n 76: iload 5\n 78: iload 6\n 80: invokevirtual #156 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 83: dup\n 84: ldc #158 // String substring(...)\n 86: invokestatic #161 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 89: astore_3\n 90: getstatic #12 // Field vowels:Ljava/util/List;\n 93: aload_3\n 94: iconst_0\n 95: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 98: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 101: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 106: ifeq 134\n 109: aload_3\n 110: invokestatic #163 // Method fixClusterVowels:(Ljava/lang/String;)Ljava/lang/String;\n 113: astore 4\n 115: aload_1\n 116: aload_3\n 117: aload 4\n 119: iconst_0\n 120: iconst_4\n 121: aconst_null\n 122: invokestatic #167 // Method kotlin/text/StringsKt.replaceFirst$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 125: astore_1\n 126: aload_1\n 127: invokestatic #145 // Method findClusters:(Ljava/lang/String;)Ljava/util/List;\n 130: astore_2\n 131: goto 13\n 134: getstatic #16 // Field consonants:Ljava/util/List;\n 137: aload_3\n 138: iconst_0\n 139: invokevirtual #112 // Method java/lang/String.charAt:(I)C\n 142: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 145: invokeinterface #122, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 150: ifeq 178\n 153: aload_3\n 154: invokestatic #169 // Method fixClusterConsonants:(Ljava/lang/String;)Ljava/lang/String;\n 157: astore 4\n 159: aload_1\n 160: aload_3\n 161: aload 4\n 163: iconst_0\n 164: iconst_4\n 165: aconst_null\n 166: invokestatic #167 // Method kotlin/text/StringsKt.replaceFirst$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 169: astore_1\n 170: aload_1\n 171: invokestatic #145 // Method findClusters:(Ljava/lang/String;)Ljava/util/List;\n 174: astore_2\n 175: goto 13\n 178: goto 181\n 181: aload_1\n 182: areturn\n\n public static final void main();\n Code:\n 0: invokestatic #179 // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;\n 3: astore_0\n 4: aload_0\n 5: invokestatic #181 // Method solveClusters:(Ljava/lang/String;)Ljava/lang/String;\n 8: getstatic #187 // Field java/lang/System.out:Ljava/io/PrintStream;\n 11: swap\n 12: invokevirtual #193 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 15: aload_0\n 16: invokestatic #181 // Method solveClusters:(Ljava/lang/String;)Ljava/lang/String;\n 19: invokevirtual #194 // Method java/lang/String.length:()I\n 22: aload_0\n 23: invokevirtual #194 // Method java/lang/String.length:()I\n 26: isub\n 27: istore_1\n 28: getstatic #187 // Field java/lang/System.out:Ljava/io/PrintStream;\n 31: iload_1\n 32: invokevirtual #197 // Method java/io/PrintStream.println:(I)V\n 35: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #200 // Method main:()V\n 3: return\n\n static {};\n Code:\n 0: bipush 6\n 2: anewarray #114 // class java/lang/Character\n 5: astore_0\n 6: aload_0\n 7: iconst_0\n 8: bipush 97\n 10: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 13: aastore\n 14: aload_0\n 15: iconst_1\n 16: bipush 101\n 18: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 21: aastore\n 22: aload_0\n 23: iconst_2\n 24: bipush 105\n 26: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 29: aastore\n 30: aload_0\n 31: iconst_3\n 32: bipush 111\n 34: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 37: aastore\n 38: aload_0\n 39: iconst_4\n 40: bipush 117\n 42: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 45: aastore\n 46: aload_0\n 47: iconst_5\n 48: bipush 121\n 50: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 53: aastore\n 54: aload_0\n 55: invokestatic #134 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 58: putstatic #12 // Field vowels:Ljava/util/List;\n 61: bipush 20\n 63: anewarray #114 // class java/lang/Character\n 66: astore_0\n 67: aload_0\n 68: iconst_0\n 69: bipush 98\n 71: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 74: aastore\n 75: aload_0\n 76: iconst_1\n 77: bipush 99\n 79: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 82: aastore\n 83: aload_0\n 84: iconst_2\n 85: bipush 100\n 87: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 90: aastore\n 91: aload_0\n 92: iconst_3\n 93: bipush 102\n 95: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 98: aastore\n 99: aload_0\n 100: iconst_4\n 101: bipush 103\n 103: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 106: aastore\n 107: aload_0\n 108: iconst_5\n 109: bipush 104\n 111: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 114: aastore\n 115: aload_0\n 116: bipush 6\n 118: bipush 106\n 120: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 123: aastore\n 124: aload_0\n 125: bipush 7\n 127: bipush 107\n 129: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 132: aastore\n 133: aload_0\n 134: bipush 8\n 136: bipush 108\n 138: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 141: aastore\n 142: aload_0\n 143: bipush 9\n 145: bipush 109\n 147: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 150: aastore\n 151: aload_0\n 152: bipush 10\n 154: bipush 110\n 156: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 159: aastore\n 160: aload_0\n 161: bipush 11\n 163: bipush 112\n 165: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 168: aastore\n 169: aload_0\n 170: bipush 12\n 172: bipush 113\n 174: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 177: aastore\n 178: aload_0\n 179: bipush 13\n 181: bipush 114\n 183: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 186: aastore\n 187: aload_0\n 188: bipush 14\n 190: bipush 115\n 192: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 195: aastore\n 196: aload_0\n 197: bipush 15\n 199: bipush 116\n 201: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 204: aastore\n 205: aload_0\n 206: bipush 16\n 208: bipush 118\n 210: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 213: aastore\n 214: aload_0\n 215: bipush 17\n 217: bipush 119\n 219: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 222: aastore\n 223: aload_0\n 224: bipush 18\n 226: bipush 120\n 228: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 231: aastore\n 232: aload_0\n 233: bipush 19\n 235: bipush 122\n 237: invokestatic #118 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 240: aastore\n 241: aload_0\n 242: invokestatic #134 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 245: putstatic #16 // Field consonants:Ljava/util/List;\n 248: return\n}\n", "javap_err": "" } ]
joshpierce__advent-of-code-22__fd5414c/src/Day07.kt
import java.io.File // I'm not proud of this, but it works. fun main() { var lines: List<String> = File("Day07.txt").readLines() var fileSystem: MutableList<Obj> = mutableListOf() fileSystem.add(Obj("/", ObjectType.Directory, 0)) var currentObj: Obj = fileSystem[0] for (i in 0..lines.size - 1) { //println("Current Line: " + lines[i]) //currentObj.children.forEach { println("Object under " + currentObj.objName + " | " + it.objName + " | " +it.objType.toString() + " | " + it.parent!!.objName) } var parts = lines[i].split(" ") when (parts[0]) { "$" -> { when (parts[1]) { "cd" -> { when (parts[2]) { "/" -> { // Go to root //println("Changing current obj to root") currentObj = fileSystem[0] } ".." -> { //println("Changing current obj to parent " + currentObj.parent!!.objName) currentObj = currentObj.parent!! } else -> { var target = currentObj.children.filter { it.objName == parts[2] }.first() //println("Changing current obj to " + target.objName) currentObj = target } } } "ls" -> { //println("Listing directory: " + currentObj.objName) var nextCommandLine = lines.slice(i+1..lines.size - 1).indexOfFirst { it.split(" ")[0] == "$" } + i + 1 if (i == nextCommandLine) { nextCommandLine = lines.size } //println("nextCommandLine is " + nextCommandLine.toString()) //println("i is " + i.toString()) for (idx in i+1..nextCommandLine - 1) { var lsParts = lines[idx].split(" ") when (lsParts[0]) { "dir" -> { if (currentObj.children.filter { it.objName == lsParts[1] && it.objType == ObjectType.Directory }.count() == 0) { //println("Adding directory: " + lsParts[1] + " to " + currentObj.objName) currentObj.children.add(Obj(lsParts[1], ObjectType.Directory, 0, currentObj)) } } else -> { if (currentObj.children.filter { it.objName == lsParts[1] && it.objType == ObjectType.File }.count() == 0) { //println("Adding file: " + lsParts[1] + " to " + currentObj.objName) currentObj.children.add(Obj(lsParts[1], ObjectType.File, lsParts[0].toInt(), currentObj)) } } } } } } } else -> { // This is a file print("") } } } println("------------") printStructure(fileSystem[0], 0) var sizes = getDirectoriesWithSizes(fileSystem[0]) sizes.sortByDescending { it.size } sizes.forEach { println(it.path + " | " + it.size.toString()) } println("Part 1 size: " + sizes.filter { it.size < 100000 }.sumOf { it.size }.toString()) var freeSpace = 70000000 - sizes[0].size println("Total Free Space is " + freeSpace.toString()) var validSizes = sizes.filter { it.size + freeSpace > 30000000 }.toMutableList() validSizes.sortBy { it.size } validSizes.forEach { println("Valid Size: " + it.path + " | " + it.size.toString()) } println("Smallest Directory To Achieve Goal is " + validSizes[0].path.toString() + " | " + validSizes[0].size.toString()) } fun printStructure(obj: Obj, level: Int) { var indent = "" for (i in 0..level) { indent += " " } indent += "- " if (obj.objType == ObjectType.Directory) { println(indent + obj.objName) } else { println(indent + obj.objName + " | " + obj.objSize.toString()) } obj.children.forEach { printStructure(it, level + 1) } } fun getDirectoriesWithSizes(obj: Obj): MutableList<DirectoryInfo> { var directorySizes: MutableList<DirectoryInfo> = mutableListOf() if (obj.objType == ObjectType.Directory) { directorySizes.add(DirectoryInfo(obj.objName, 0)) } obj.children.forEach { if (it.objType == ObjectType.Directory) { directorySizes.add(DirectoryInfo(it.objName, 0)) } else { directorySizes[0].size += it.objSize } } obj.children.forEach { if (it.objType == ObjectType.Directory) { var childSizes = getDirectoriesWithSizes(it) directorySizes[0].size += childSizes[0].size directorySizes.addAll(childSizes) } } return directorySizes.filter { it.size > 0 }.toMutableList() } enum class ObjectType { Directory, File } class DirectoryInfo(path: String, size: Int) { var path: String = path var size: Int = size } class Obj(objName: String, objType: ObjectType, objSize: Int, parent: Obj? = null) { var objName: String = objName var objType: ObjectType = objType var objSize: Int = objSize var children: MutableList<Obj> = mutableListOf() var parent: Obj? = parent }
[ { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day07Kt$main$$inlined$sortBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day07Kt$main$$inlined$sortBy$1<T> implements java.util.Comparator {\n public Day07Kt$main$$inlined$sortBy$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_1\n 1: checkcast #23 // class DirectoryInfo\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method DirectoryInfo.getSize:()I\n 12: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 15: checkcast #35 // class java/lang/Comparable\n 18: aload_2\n 19: checkcast #23 // class DirectoryInfo\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method DirectoryInfo.getSize:()I\n 32: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 35: aload 5\n 37: swap\n 38: checkcast #35 // class java/lang/Comparable\n 41: invokestatic #41 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" }, { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day07Kt$main$$inlined$sortByDescending$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day07Kt$main$$inlined$sortByDescending$1<T> implements java.util.Comparator {\n public Day07Kt$main$$inlined$sortByDescending$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_2\n 1: checkcast #23 // class DirectoryInfo\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method DirectoryInfo.getSize:()I\n 12: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 15: checkcast #35 // class java/lang/Comparable\n 18: aload_1\n 19: checkcast #23 // class DirectoryInfo\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method DirectoryInfo.getSize:()I\n 32: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 35: aload 5\n 37: swap\n 38: checkcast #35 // class java/lang/Comparable\n 41: invokestatic #41 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" }, { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day07Kt.class", "javap": "Compiled from \"Day07.kt\"\npublic final class Day07Kt {\n public static final void main();\n Code:\n 0: new #8 // class java/io/File\n 3: dup\n 4: ldc #10 // String Day07.txt\n 6: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: aconst_null\n 10: iconst_1\n 11: aconst_null\n 12: invokestatic #20 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 15: astore_0\n 16: new #22 // class java/util/ArrayList\n 19: dup\n 20: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 23: checkcast #26 // class java/util/List\n 26: astore_1\n 27: aload_1\n 28: new #28 // class Obj\n 31: dup\n 32: ldc #30 // String /\n 34: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 37: iconst_0\n 38: aconst_null\n 39: bipush 8\n 41: aconst_null\n 42: invokespecial #39 // Method Obj.\"<init>\":(Ljava/lang/String;LObjectType;ILObj;ILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 45: invokeinterface #43, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 50: pop\n 51: aload_1\n 52: iconst_0\n 53: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 58: checkcast #28 // class Obj\n 61: astore_2\n 62: iconst_0\n 63: istore_3\n 64: aload_0\n 65: invokeinterface #51, 1 // InterfaceMethod java/util/List.size:()I\n 70: istore 4\n 72: iload_3\n 73: iload 4\n 75: if_icmpge 947\n 78: aconst_null\n 79: astore 5\n 81: aload_0\n 82: iload_3\n 83: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 88: checkcast #53 // class java/lang/CharSequence\n 91: iconst_1\n 92: anewarray #55 // class java/lang/String\n 95: astore 6\n 97: aload 6\n 99: iconst_0\n 100: ldc #57 // String\n 102: aastore\n 103: aload 6\n 105: iconst_0\n 106: iconst_0\n 107: bipush 6\n 109: aconst_null\n 110: invokestatic #63 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 113: astore 5\n 115: aload 5\n 117: iconst_0\n 118: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 123: checkcast #55 // class java/lang/String\n 126: ldc #65 // String $\n 128: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 131: ifeq 932\n 134: aload 5\n 136: iconst_1\n 137: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 142: checkcast #55 // class java/lang/String\n 145: astore 7\n 147: aload 7\n 149: ldc #73 // String cd\n 151: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 154: ifeq 337\n 157: aload 5\n 159: iconst_2\n 160: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 165: checkcast #55 // class java/lang/String\n 168: astore 8\n 170: aload 8\n 172: ldc #30 // String /\n 174: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 177: ifeq 194\n 180: aload_1\n 181: iconst_0\n 182: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 187: checkcast #28 // class Obj\n 190: astore_2\n 191: goto 941\n 194: aload 8\n 196: ldc #75 // String ..\n 198: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 201: ifeq 216\n 204: aload_2\n 205: invokevirtual #79 // Method Obj.getParent:()LObj;\n 208: dup\n 209: invokestatic #83 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 212: astore_2\n 213: goto 941\n 216: aload_2\n 217: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 220: checkcast #89 // class java/lang/Iterable\n 223: astore 10\n 225: iconst_0\n 226: istore 11\n 228: aload 10\n 230: astore 12\n 232: new #22 // class java/util/ArrayList\n 235: dup\n 236: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 239: checkcast #91 // class java/util/Collection\n 242: astore 13\n 244: iconst_0\n 245: istore 14\n 247: aload 12\n 249: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 254: astore 15\n 256: aload 15\n 258: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 263: ifeq 317\n 266: aload 15\n 268: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 273: astore 16\n 275: aload 16\n 277: checkcast #28 // class Obj\n 280: astore 17\n 282: iconst_0\n 283: istore 18\n 285: aload 17\n 287: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 290: aload 5\n 292: iconst_2\n 293: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 298: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 301: ifeq 256\n 304: aload 13\n 306: aload 16\n 308: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 313: pop\n 314: goto 256\n 317: aload 13\n 319: checkcast #26 // class java/util/List\n 322: nop\n 323: invokestatic #116 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 326: checkcast #28 // class Obj\n 329: astore 9\n 331: aload 9\n 333: astore_2\n 334: goto 941\n 337: aload 7\n 339: ldc #118 // String ls\n 341: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 344: ifeq 941\n 347: aload_0\n 348: new #120 // class kotlin/ranges/IntRange\n 351: dup\n 352: iload_3\n 353: iconst_1\n 354: iadd\n 355: aload_0\n 356: invokeinterface #51, 1 // InterfaceMethod java/util/List.size:()I\n 361: iconst_1\n 362: isub\n 363: invokespecial #123 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 366: invokestatic #127 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;\n 369: astore 9\n 371: iconst_0\n 372: istore 10\n 374: iconst_0\n 375: istore 11\n 377: aload 9\n 379: invokeinterface #128, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 384: astore 12\n 386: aload 12\n 388: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 393: ifeq 467\n 396: aload 12\n 398: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 403: astore 13\n 405: aload 13\n 407: checkcast #55 // class java/lang/String\n 410: astore 14\n 412: iconst_0\n 413: istore 15\n 415: aload 14\n 417: checkcast #53 // class java/lang/CharSequence\n 420: iconst_1\n 421: anewarray #55 // class java/lang/String\n 424: astore 16\n 426: aload 16\n 428: iconst_0\n 429: ldc #57 // String\n 431: aastore\n 432: aload 16\n 434: iconst_0\n 435: iconst_0\n 436: bipush 6\n 438: aconst_null\n 439: invokestatic #63 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 442: iconst_0\n 443: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 448: ldc #65 // String $\n 450: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 453: ifeq 461\n 456: iload 11\n 458: goto 468\n 461: iinc 11, 1\n 464: goto 386\n 467: iconst_m1\n 468: iload_3\n 469: iadd\n 470: iconst_1\n 471: iadd\n 472: istore 8\n 474: iload_3\n 475: iload 8\n 477: if_icmpne 488\n 480: aload_0\n 481: invokeinterface #51, 1 // InterfaceMethod java/util/List.size:()I\n 486: istore 8\n 488: iload_3\n 489: iconst_1\n 490: iadd\n 491: istore 9\n 493: iload 8\n 495: iconst_1\n 496: isub\n 497: istore 10\n 499: iload 9\n 501: iload 10\n 503: if_icmpgt 941\n 506: aconst_null\n 507: astore 11\n 509: aload_0\n 510: iload 9\n 512: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 517: checkcast #53 // class java/lang/CharSequence\n 520: iconst_1\n 521: anewarray #55 // class java/lang/String\n 524: astore 12\n 526: aload 12\n 528: iconst_0\n 529: ldc #57 // String\n 531: aastore\n 532: aload 12\n 534: iconst_0\n 535: iconst_0\n 536: bipush 6\n 538: aconst_null\n 539: invokestatic #63 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 542: astore 11\n 544: aload 11\n 546: iconst_0\n 547: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 552: checkcast #55 // class java/lang/String\n 555: ldc #130 // String dir\n 557: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 560: ifeq 736\n 563: aload_2\n 564: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 567: checkcast #89 // class java/lang/Iterable\n 570: astore 13\n 572: iconst_0\n 573: istore 14\n 575: aload 13\n 577: astore 15\n 579: new #22 // class java/util/ArrayList\n 582: dup\n 583: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 586: checkcast #91 // class java/util/Collection\n 589: astore 16\n 591: iconst_0\n 592: istore 17\n 594: aload 15\n 596: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 601: astore 18\n 603: aload 18\n 605: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 610: ifeq 683\n 613: aload 18\n 615: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 620: astore 19\n 622: aload 19\n 624: checkcast #28 // class Obj\n 627: astore 20\n 629: iconst_0\n 630: istore 21\n 632: aload 20\n 634: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 637: aload 11\n 639: iconst_1\n 640: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 645: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 648: ifeq 666\n 651: aload 20\n 653: invokevirtual #134 // Method Obj.getObjType:()LObjectType;\n 656: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 659: if_acmpne 666\n 662: iconst_1\n 663: goto 667\n 666: iconst_0\n 667: ifeq 603\n 670: aload 16\n 672: aload 19\n 674: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 679: pop\n 680: goto 603\n 683: aload 16\n 685: checkcast #26 // class java/util/List\n 688: nop\n 689: checkcast #91 // class java/util/Collection\n 692: invokeinterface #135, 1 // InterfaceMethod java/util/Collection.size:()I\n 697: ifne 919\n 700: aload_2\n 701: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 704: new #28 // class Obj\n 707: dup\n 708: aload 11\n 710: iconst_1\n 711: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 716: checkcast #55 // class java/lang/String\n 719: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 722: iconst_0\n 723: aload_2\n 724: invokespecial #138 // Method Obj.\"<init>\":(Ljava/lang/String;LObjectType;ILObj;)V\n 727: invokeinterface #43, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 732: pop\n 733: goto 919\n 736: aload_2\n 737: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 740: checkcast #89 // class java/lang/Iterable\n 743: astore 13\n 745: iconst_0\n 746: istore 14\n 748: aload 13\n 750: astore 15\n 752: new #22 // class java/util/ArrayList\n 755: dup\n 756: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 759: checkcast #91 // class java/util/Collection\n 762: astore 16\n 764: iconst_0\n 765: istore 17\n 767: aload 15\n 769: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 774: astore 18\n 776: aload 18\n 778: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 783: ifeq 856\n 786: aload 18\n 788: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 793: astore 19\n 795: aload 19\n 797: checkcast #28 // class Obj\n 800: astore 20\n 802: iconst_0\n 803: istore 21\n 805: aload 20\n 807: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 810: aload 11\n 812: iconst_1\n 813: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 818: invokestatic #71 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 821: ifeq 839\n 824: aload 20\n 826: invokevirtual #134 // Method Obj.getObjType:()LObjectType;\n 829: getstatic #141 // Field ObjectType.File:LObjectType;\n 832: if_acmpne 839\n 835: iconst_1\n 836: goto 840\n 839: iconst_0\n 840: ifeq 776\n 843: aload 16\n 845: aload 19\n 847: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 852: pop\n 853: goto 776\n 856: aload 16\n 858: checkcast #26 // class java/util/List\n 861: nop\n 862: checkcast #91 // class java/util/Collection\n 865: invokeinterface #135, 1 // InterfaceMethod java/util/Collection.size:()I\n 870: ifne 919\n 873: aload_2\n 874: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 877: new #28 // class Obj\n 880: dup\n 881: aload 11\n 883: iconst_1\n 884: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 889: checkcast #55 // class java/lang/String\n 892: getstatic #141 // Field ObjectType.File:LObjectType;\n 895: aload 11\n 897: iconst_0\n 898: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 903: checkcast #55 // class java/lang/String\n 906: invokestatic #147 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 909: aload_2\n 910: invokespecial #138 // Method Obj.\"<init>\":(Ljava/lang/String;LObjectType;ILObj;)V\n 913: invokeinterface #43, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 918: pop\n 919: iload 9\n 921: iload 10\n 923: if_icmpeq 941\n 926: iinc 9, 1\n 929: goto 506\n 932: ldc #149 // String\n 934: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 937: swap\n 938: invokevirtual #160 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 941: iinc 3, 1\n 944: goto 72\n 947: ldc #162 // String ------------\n 949: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 952: swap\n 953: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 956: aload_1\n 957: iconst_0\n 958: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 963: checkcast #28 // class Obj\n 966: iconst_0\n 967: invokestatic #169 // Method printStructure:(LObj;I)V\n 970: aload_1\n 971: iconst_0\n 972: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 977: checkcast #28 // class Obj\n 980: invokestatic #173 // Method getDirectoriesWithSizes:(LObj;)Ljava/util/List;\n 983: astore_3\n 984: aload_3\n 985: astore 4\n 987: iconst_0\n 988: istore 5\n 990: aload 4\n 992: invokeinterface #51, 1 // InterfaceMethod java/util/List.size:()I\n 997: iconst_1\n 998: if_icmple 1016\n 1001: aload 4\n 1003: new #175 // class Day07Kt$main$$inlined$sortByDescending$1\n 1006: dup\n 1007: invokespecial #176 // Method Day07Kt$main$$inlined$sortByDescending$1.\"<init>\":()V\n 1010: checkcast #178 // class java/util/Comparator\n 1013: invokestatic #182 // Method kotlin/collections/CollectionsKt.sortWith:(Ljava/util/List;Ljava/util/Comparator;)V\n 1016: nop\n 1017: aload_3\n 1018: checkcast #89 // class java/lang/Iterable\n 1021: astore 4\n 1023: iconst_0\n 1024: istore 5\n 1026: aload 4\n 1028: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1033: astore 6\n 1035: aload 6\n 1037: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1042: ifeq 1107\n 1045: aload 6\n 1047: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1052: astore 7\n 1054: aload 7\n 1056: checkcast #184 // class DirectoryInfo\n 1059: astore 8\n 1061: iconst_0\n 1062: istore 9\n 1064: new #186 // class java/lang/StringBuilder\n 1067: dup\n 1068: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 1071: aload 8\n 1073: invokevirtual #190 // Method DirectoryInfo.getPath:()Ljava/lang/String;\n 1076: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1079: ldc #196 // String |\n 1081: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1084: aload 8\n 1086: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1089: invokevirtual #202 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1092: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1095: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1098: swap\n 1099: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1102: nop\n 1103: nop\n 1104: goto 1035\n 1107: nop\n 1108: new #186 // class java/lang/StringBuilder\n 1111: dup\n 1112: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 1115: ldc #207 // String Part 1 size:\n 1117: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1120: aload_3\n 1121: checkcast #89 // class java/lang/Iterable\n 1124: astore 4\n 1126: astore 22\n 1128: iconst_0\n 1129: istore 5\n 1131: aload 4\n 1133: astore 6\n 1135: new #22 // class java/util/ArrayList\n 1138: dup\n 1139: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 1142: checkcast #91 // class java/util/Collection\n 1145: astore 7\n 1147: iconst_0\n 1148: istore 8\n 1150: aload 6\n 1152: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1157: astore 9\n 1159: aload 9\n 1161: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1166: ifeq 1219\n 1169: aload 9\n 1171: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1176: astore 10\n 1178: aload 10\n 1180: checkcast #184 // class DirectoryInfo\n 1183: astore 11\n 1185: iconst_0\n 1186: istore 12\n 1188: aload 11\n 1190: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1193: ldc #208 // int 100000\n 1195: if_icmpge 1202\n 1198: iconst_1\n 1199: goto 1203\n 1202: iconst_0\n 1203: ifeq 1159\n 1206: aload 7\n 1208: aload 10\n 1210: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1215: pop\n 1216: goto 1159\n 1219: aload 7\n 1221: checkcast #26 // class java/util/List\n 1224: nop\n 1225: aload 22\n 1227: swap\n 1228: checkcast #89 // class java/lang/Iterable\n 1231: astore 4\n 1233: astore 22\n 1235: iconst_0\n 1236: istore 5\n 1238: aload 4\n 1240: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1245: astore 6\n 1247: aload 6\n 1249: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1254: ifeq 1297\n 1257: aload 6\n 1259: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1264: astore 7\n 1266: iload 5\n 1268: aload 7\n 1270: checkcast #184 // class DirectoryInfo\n 1273: astore 8\n 1275: istore 23\n 1277: iconst_0\n 1278: istore 9\n 1280: aload 8\n 1282: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1285: istore 24\n 1287: iload 23\n 1289: iload 24\n 1291: iadd\n 1292: istore 5\n 1294: goto 1247\n 1297: iload 5\n 1299: istore 23\n 1301: aload 22\n 1303: iload 23\n 1305: invokevirtual #202 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1308: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1311: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1314: swap\n 1315: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1318: iconst_0\n 1319: istore 4\n 1321: ldc #209 // int 70000000\n 1323: aload_3\n 1324: iconst_0\n 1325: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1330: checkcast #184 // class DirectoryInfo\n 1333: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1336: isub\n 1337: istore 4\n 1339: new #186 // class java/lang/StringBuilder\n 1342: dup\n 1343: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 1346: ldc #211 // String Total Free Space is\n 1348: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1351: iload 4\n 1353: invokevirtual #202 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1356: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1359: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1362: swap\n 1363: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1366: aload_3\n 1367: checkcast #89 // class java/lang/Iterable\n 1370: astore 6\n 1372: iconst_0\n 1373: istore 7\n 1375: aload 6\n 1377: astore 8\n 1379: new #22 // class java/util/ArrayList\n 1382: dup\n 1383: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 1386: checkcast #91 // class java/util/Collection\n 1389: astore 9\n 1391: iconst_0\n 1392: istore 10\n 1394: aload 8\n 1396: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1401: astore 11\n 1403: aload 11\n 1405: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1410: ifeq 1466\n 1413: aload 11\n 1415: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1420: astore 12\n 1422: aload 12\n 1424: checkcast #184 // class DirectoryInfo\n 1427: astore 13\n 1429: iconst_0\n 1430: istore 14\n 1432: aload 13\n 1434: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1437: iload 4\n 1439: iadd\n 1440: ldc #212 // int 30000000\n 1442: if_icmple 1449\n 1445: iconst_1\n 1446: goto 1450\n 1449: iconst_0\n 1450: ifeq 1403\n 1453: aload 9\n 1455: aload 12\n 1457: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1462: pop\n 1463: goto 1403\n 1466: aload 9\n 1468: checkcast #26 // class java/util/List\n 1471: nop\n 1472: checkcast #91 // class java/util/Collection\n 1475: invokestatic #216 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 1478: astore 5\n 1480: aload 5\n 1482: astore 6\n 1484: iconst_0\n 1485: istore 7\n 1487: aload 6\n 1489: invokeinterface #51, 1 // InterfaceMethod java/util/List.size:()I\n 1494: iconst_1\n 1495: if_icmple 1513\n 1498: aload 6\n 1500: new #218 // class Day07Kt$main$$inlined$sortBy$1\n 1503: dup\n 1504: invokespecial #219 // Method Day07Kt$main$$inlined$sortBy$1.\"<init>\":()V\n 1507: checkcast #178 // class java/util/Comparator\n 1510: invokestatic #182 // Method kotlin/collections/CollectionsKt.sortWith:(Ljava/util/List;Ljava/util/Comparator;)V\n 1513: nop\n 1514: aload 5\n 1516: checkcast #89 // class java/lang/Iterable\n 1519: astore 6\n 1521: iconst_0\n 1522: istore 7\n 1524: aload 6\n 1526: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1531: astore 8\n 1533: aload 8\n 1535: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1540: ifeq 1610\n 1543: aload 8\n 1545: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1550: astore 9\n 1552: aload 9\n 1554: checkcast #184 // class DirectoryInfo\n 1557: astore 10\n 1559: iconst_0\n 1560: istore 11\n 1562: new #186 // class java/lang/StringBuilder\n 1565: dup\n 1566: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 1569: ldc #221 // String Valid Size:\n 1571: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1574: aload 10\n 1576: invokevirtual #190 // Method DirectoryInfo.getPath:()Ljava/lang/String;\n 1579: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1582: ldc #196 // String |\n 1584: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1587: aload 10\n 1589: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1592: invokevirtual #202 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1595: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1598: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1601: swap\n 1602: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1605: nop\n 1606: nop\n 1607: goto 1533\n 1610: nop\n 1611: new #186 // class java/lang/StringBuilder\n 1614: dup\n 1615: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 1618: ldc #223 // String Smallest Directory To Achieve Goal is\n 1620: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1623: aload 5\n 1625: iconst_0\n 1626: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1631: checkcast #184 // class DirectoryInfo\n 1634: invokevirtual #190 // Method DirectoryInfo.getPath:()Ljava/lang/String;\n 1637: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1640: ldc #196 // String |\n 1642: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1645: aload 5\n 1647: iconst_0\n 1648: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1653: checkcast #184 // class DirectoryInfo\n 1656: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 1659: invokevirtual #202 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1662: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1665: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1668: swap\n 1669: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1672: return\n\n public static final void printStructure(Obj, int);\n Code:\n 0: aload_0\n 1: ldc_w #275 // String obj\n 4: invokestatic #279 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: ldc #149 // String\n 9: astore_2\n 10: iconst_0\n 11: istore_3\n 12: iload_3\n 13: iload_1\n 14: if_icmpgt 49\n 17: new #186 // class java/lang/StringBuilder\n 20: dup\n 21: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 24: aload_2\n 25: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 28: ldc_w #281 // String\n 31: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 34: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 37: astore_2\n 38: iload_3\n 39: iload_1\n 40: if_icmpeq 49\n 43: iinc 3, 1\n 46: goto 17\n 49: new #186 // class java/lang/StringBuilder\n 52: dup\n 53: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 56: aload_2\n 57: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 60: ldc_w #283 // String -\n 63: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 66: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 69: astore_2\n 70: aload_0\n 71: invokevirtual #134 // Method Obj.getObjType:()LObjectType;\n 74: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 77: if_acmpne 111\n 80: new #186 // class java/lang/StringBuilder\n 83: dup\n 84: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 87: aload_2\n 88: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 91: aload_0\n 92: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 95: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 98: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 101: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 104: swap\n 105: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 108: goto 151\n 111: new #186 // class java/lang/StringBuilder\n 114: dup\n 115: invokespecial #187 // Method java/lang/StringBuilder.\"<init>\":()V\n 118: aload_2\n 119: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 122: aload_0\n 123: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 126: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 129: ldc #196 // String |\n 131: invokevirtual #194 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 134: aload_0\n 135: invokevirtual #286 // Method Obj.getObjSize:()I\n 138: invokevirtual #202 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 141: invokevirtual #205 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 144: getstatic #155 // Field java/lang/System.out:Ljava/io/PrintStream;\n 147: swap\n 148: invokevirtual #165 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 151: aload_0\n 152: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 155: checkcast #89 // class java/lang/Iterable\n 158: astore_3\n 159: iconst_0\n 160: istore 4\n 162: aload_3\n 163: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 168: astore 5\n 170: aload 5\n 172: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 177: ifeq 212\n 180: aload 5\n 182: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 187: astore 6\n 189: aload 6\n 191: checkcast #28 // class Obj\n 194: astore 7\n 196: iconst_0\n 197: istore 8\n 199: aload 7\n 201: iload_1\n 202: iconst_1\n 203: iadd\n 204: invokestatic #169 // Method printStructure:(LObj;I)V\n 207: nop\n 208: nop\n 209: goto 170\n 212: nop\n 213: return\n\n public static final java.util.List<DirectoryInfo> getDirectoriesWithSizes(Obj);\n Code:\n 0: aload_0\n 1: ldc_w #275 // String obj\n 4: invokestatic #279 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aconst_null\n 8: astore_1\n 9: new #22 // class java/util/ArrayList\n 12: dup\n 13: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 16: checkcast #26 // class java/util/List\n 19: astore_1\n 20: aload_0\n 21: invokevirtual #134 // Method Obj.getObjType:()LObjectType;\n 24: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 27: if_acmpne 49\n 30: aload_1\n 31: new #184 // class DirectoryInfo\n 34: dup\n 35: aload_0\n 36: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 39: iconst_0\n 40: invokespecial #293 // Method DirectoryInfo.\"<init>\":(Ljava/lang/String;I)V\n 43: invokeinterface #43, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 48: pop\n 49: aload_0\n 50: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 53: checkcast #89 // class java/lang/Iterable\n 56: astore_2\n 57: iconst_0\n 58: istore_3\n 59: aload_2\n 60: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 65: astore 4\n 67: aload 4\n 69: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 74: ifeq 163\n 77: aload 4\n 79: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 5\n 86: aload 5\n 88: checkcast #28 // class Obj\n 91: astore 6\n 93: iconst_0\n 94: istore 7\n 96: aload 6\n 98: invokevirtual #134 // Method Obj.getObjType:()LObjectType;\n 101: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 104: if_acmpne 130\n 107: aload_1\n 108: new #184 // class DirectoryInfo\n 111: dup\n 112: aload 6\n 114: invokevirtual #109 // Method Obj.getObjName:()Ljava/lang/String;\n 117: iconst_0\n 118: invokespecial #293 // Method DirectoryInfo.\"<init>\":(Ljava/lang/String;I)V\n 121: invokeinterface #43, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 126: pop\n 127: goto 158\n 130: aload_1\n 131: iconst_0\n 132: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 137: checkcast #184 // class DirectoryInfo\n 140: astore 8\n 142: aload 8\n 144: aload 8\n 146: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 149: aload 6\n 151: invokevirtual #286 // Method Obj.getObjSize:()I\n 154: iadd\n 155: invokevirtual #297 // Method DirectoryInfo.setSize:(I)V\n 158: nop\n 159: nop\n 160: goto 67\n 163: nop\n 164: aload_0\n 165: invokevirtual #87 // Method Obj.getChildren:()Ljava/util/List;\n 168: checkcast #89 // class java/lang/Iterable\n 171: astore_2\n 172: iconst_0\n 173: istore_3\n 174: aload_2\n 175: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 180: astore 4\n 182: aload 4\n 184: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 189: ifeq 283\n 192: aload 4\n 194: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 199: astore 5\n 201: aload 5\n 203: checkcast #28 // class Obj\n 206: astore 6\n 208: iconst_0\n 209: istore 7\n 211: aload 6\n 213: invokevirtual #134 // Method Obj.getObjType:()LObjectType;\n 216: getstatic #36 // Field ObjectType.Directory:LObjectType;\n 219: if_acmpne 278\n 222: aload 6\n 224: invokestatic #173 // Method getDirectoriesWithSizes:(LObj;)Ljava/util/List;\n 227: astore 8\n 229: aload_1\n 230: iconst_0\n 231: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 236: checkcast #184 // class DirectoryInfo\n 239: astore 9\n 241: aload 9\n 243: aload 9\n 245: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 248: aload 8\n 250: iconst_0\n 251: invokeinterface #47, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 256: checkcast #184 // class DirectoryInfo\n 259: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 262: iadd\n 263: invokevirtual #297 // Method DirectoryInfo.setSize:(I)V\n 266: aload_1\n 267: aload 8\n 269: checkcast #91 // class java/util/Collection\n 272: invokeinterface #301, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 277: pop\n 278: nop\n 279: nop\n 280: goto 182\n 283: nop\n 284: aload_1\n 285: checkcast #89 // class java/lang/Iterable\n 288: astore_2\n 289: iconst_0\n 290: istore_3\n 291: aload_2\n 292: astore 4\n 294: new #22 // class java/util/ArrayList\n 297: dup\n 298: invokespecial #24 // Method java/util/ArrayList.\"<init>\":()V\n 301: checkcast #91 // class java/util/Collection\n 304: astore 5\n 306: iconst_0\n 307: istore 6\n 309: aload 4\n 311: invokeinterface #95, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 316: astore 7\n 318: aload 7\n 320: invokeinterface #101, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 325: ifeq 376\n 328: aload 7\n 330: invokeinterface #105, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 335: astore 8\n 337: aload 8\n 339: checkcast #184 // class DirectoryInfo\n 342: astore 9\n 344: iconst_0\n 345: istore 10\n 347: aload 9\n 349: invokevirtual #199 // Method DirectoryInfo.getSize:()I\n 352: ifle 359\n 355: iconst_1\n 356: goto 360\n 359: iconst_0\n 360: ifeq 318\n 363: aload 5\n 365: aload 8\n 367: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 372: pop\n 373: goto 318\n 376: aload 5\n 378: checkcast #26 // class java/util/List\n 381: nop\n 382: checkcast #91 // class java/util/Collection\n 385: invokestatic #216 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 388: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #309 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
joshpierce__advent-of-code-22__fd5414c/src/Day15.kt
import java.io.File import kotlin.collections.fill import java.math.BigInteger // So... this returned a couple possible solutions for part 2, the first one that came out ended up being correct // and it's 01:28a so I'm going to bed. Hopefully I'll find time tomorrow to come back to this to clean it up. fun main() { var validMin: Int = 0 var validMax: Int = 4000000 var rowCheck: Int = 2000000 var directions: List<String> = File("Day15.txt").readLines() var sbpairs: MutableList<Pair<Pair<Int, Int>, Pair<Int, Int>>> = directions.map { val parts = it.replace("Sensor at x=", "") .replace(", y=", ",") .replace(": closest beacon is at x=", ",") .split(",") Pair(Pair(parts[0].toInt(), parts[1].toInt()), Pair(parts[2].toInt(), parts[3].toInt())) }.toMutableList() // get all x and y values with the same euclidian distance to the beacon in a specified row var points: MutableSet<Pair<Int, Int>> = mutableSetOf() sbpairs.forEach { var possPoints = getPoints(it.first, it.second, rowCheck) var beacons = sbpairs.map { it.second } possPoints.forEach { if (!beacons.contains(it)) { points.add(it) } } } println("Part 1 Answer: ${points.size}") println() var possPoints: MutableList<Pair<Int, Int>> = mutableListOf() sbpairs.forEach { //println("Getting Diamond For ${it.first.toString()} to ${it.second.toString()}") possPoints.addAll(getDiamondOutsides(it.first, it.second)) } // Don't run this for the large grid or you're going to have a bad time // var innerPoints: MutableList<Pair<Int, Int>> = mutableListOf() // sbpairs.forEach { // innerPoints.addAll(getPoints(it.first, it.second, -1)) // } // for (i in validMin..validMax) { // for (j in validMin..validMax) { // if (sbpairs.map { it.second }.contains(Pair(j, i))) { // print("🟣") // } // else if (sbpairs.map { it.first }.contains(Pair(j, i))) { // print("🟢") // } // else if (innerPoints.contains(Pair(j, i))) { // print("⚫️") // } else { // print("🤪") // } // } // println() // } // Sort the possible points by x and then y so that we can find duplicates possPoints.sortWith(compareBy({ it.first }, { it.second })) // Run through the list sequentially and tally up the duplicates var dups: MutableList<Pair<Pair<Int, Int>, Int>> = mutableListOf() var i: Int = 0 while (i <= possPoints.size - 1) { if (possPoints[i].first >= validMin && possPoints[i].first <= validMax && possPoints[i].second >= validMin && possPoints[i].second <= validMax && i < possPoints.size - 1) { if (possPoints[i] == possPoints[i+1]) { var count = 1 while (possPoints[i] == possPoints[i+count]) { count++ } dups.add(Pair(possPoints[i], count)) i += (count - 1) } else { i++ } } else { i++ } } // Sort the duplicates by the number of duplicates to test the most likely locations first dups.sortByDescending({ it.second }) // Get a map of our sensors and beacons and distances for testing var beacons: List<SBPair> = sbpairs.map { SBPair(it.first, it.second, getDistance(it.first, it.second)) } var distressLocation: Pair<Int, Int> = Pair(0, 0) run dups@ { dups.forEach { dup -> //println("Testing For Distress Location @ ${dup.first.toString()} | ${dup.second} duplicates") var isValid = true beacons.forEach beacon@ { beacon -> if (getDistance(dup.first, beacon.start) <= beacon.distance) { isValid = false return@beacon } } if (isValid) { //println("Found our distress location: ${dup.first.toString()}") distressLocation = dup.first return@dups } } } println("Part 2 Answer: | ${(BigInteger(distressLocation.first.toInt().toString()).multiply(BigInteger("4000000"))).plus(BigInteger(distressLocation.second.toInt().toString()))}") } class SBPair(start: Pair<Int, Int>, end: Pair<Int, Int>, distance: Int) { var start: Pair<Int, Int> = start var end: Pair<Int, Int> = end var distance: Int = distance } enum class DiamondDirection { DOWNLEFT, DOWNRIGHT, UPRIGHT, UPLEFT } fun getPointsAround(start: Pair<Int,Int>): MutableList<Pair<Int, Int>> { val points: MutableList<Pair<Int, Int>> = mutableListOf() points.add(Pair(start.first - 1, start.second)) points.add(Pair(start.first + 1, start.second)) points.add(Pair(start.first, start.second - 1)) points.add(Pair(start.first, start.second + 1)) return points } fun getDistance(start: Pair<Int, Int>, end: Pair<Int, Int>): Int { val xDiff = start.first - end.first val yDiff = start.second - end.second return Math.abs(xDiff) + Math.abs(yDiff) } fun getDiamondOutsides(start: Pair<Int, Int>, end: Pair<Int, Int>): MutableList<Pair<Int, Int>> { val points: MutableList<Pair<Int, Int>> = mutableListOf() // Adding 1 to the distance to get the points just outside the diamond val distance = getDistance(start, end) + 1 var iterator = Pair(0,distance) do { if (iterator.second != 0) points.add(Pair(start.first + iterator.first, start.second + iterator.second)) if (iterator.second != 0) points.add(Pair(start.first + iterator.first, start.second - iterator.second)) if (iterator.first != 0) points.add(Pair(start.first - iterator.first, start.second + iterator.second)) if (iterator.first != 0) points.add(Pair(start.first - iterator.first, start.second - iterator.second)) iterator = Pair(iterator.first + 1, iterator.second - 1) } while (iterator.second != 0) return points } fun getPoints(start: Pair<Int, Int>, end: Pair<Int, Int>, row: Int): List<Pair<Int, Int>> { val points: MutableList<Pair<Int, Int>> = mutableListOf() val distance = getDistance(start, end) if (row != -1) { for (i in (start.first-distance)..(start.first+distance)) { var testXDiff = start.first - i var testYDiff = start.second - row if (Math.abs(testXDiff) + Math.abs(testYDiff) <= distance) { points.add(Pair(i, row)) } } } else { for (i in (start.first-distance)..(start.first+distance)) { for (j in (start.second-distance)..(start.second+distance)) { var testXDiff = start.first - i var testYDiff = start.second - j if (Math.abs(testXDiff) + Math.abs(testYDiff) <= distance) { points.add(Pair(i, j)) } } } } return points }
[ { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day15Kt.class", "javap": "Compiled from \"Day15.kt\"\npublic final class Day15Kt {\n public static final void main();\n Code:\n 0: iconst_0\n 1: istore_0\n 2: ldc #7 // int 4000000\n 4: istore_1\n 5: iconst_0\n 6: istore_2\n 7: ldc #8 // int 2000000\n 9: istore_2\n 10: new #10 // class java/io/File\n 13: dup\n 14: ldc #12 // String Day15.txt\n 16: invokespecial #16 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 19: aconst_null\n 20: iconst_1\n 21: aconst_null\n 22: invokestatic #22 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 25: astore_3\n 26: aconst_null\n 27: astore 4\n 29: aload_3\n 30: checkcast #24 // class java/lang/Iterable\n 33: astore 5\n 35: iconst_0\n 36: istore 6\n 38: aload 5\n 40: astore 7\n 42: new #26 // class java/util/ArrayList\n 45: dup\n 46: aload 5\n 48: bipush 10\n 50: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 53: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 56: checkcast #37 // class java/util/Collection\n 59: astore 8\n 61: iconst_0\n 62: istore 9\n 64: aload 7\n 66: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 71: astore 10\n 73: aload 10\n 75: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 80: ifeq 266\n 83: aload 10\n 85: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 90: astore 11\n 92: aload 8\n 94: aload 11\n 96: checkcast #53 // class java/lang/String\n 99: astore 12\n 101: astore 25\n 103: iconst_0\n 104: istore 13\n 106: aload 12\n 108: ldc #55 // String Sensor at x=\n 110: ldc #57 // String\n 112: iconst_0\n 113: iconst_4\n 114: aconst_null\n 115: invokestatic #63 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 118: ldc #65 // String , y=\n 120: ldc #67 // String ,\n 122: iconst_0\n 123: iconst_4\n 124: aconst_null\n 125: invokestatic #63 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 128: ldc #69 // String : closest beacon is at x=\n 130: ldc #67 // String ,\n 132: iconst_0\n 133: iconst_4\n 134: aconst_null\n 135: invokestatic #63 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 138: checkcast #71 // class java/lang/CharSequence\n 141: iconst_1\n 142: anewarray #53 // class java/lang/String\n 145: astore 14\n 147: aload 14\n 149: iconst_0\n 150: ldc #67 // String ,\n 152: aastore\n 153: aload 14\n 155: iconst_0\n 156: iconst_0\n 157: bipush 6\n 159: aconst_null\n 160: invokestatic #75 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 163: astore 15\n 165: new #77 // class kotlin/Pair\n 168: dup\n 169: new #77 // class kotlin/Pair\n 172: dup\n 173: aload 15\n 175: iconst_0\n 176: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 181: checkcast #53 // class java/lang/String\n 184: invokestatic #89 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 187: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 190: aload 15\n 192: iconst_1\n 193: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 198: checkcast #53 // class java/lang/String\n 201: invokestatic #89 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 204: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 207: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 210: new #77 // class kotlin/Pair\n 213: dup\n 214: aload 15\n 216: iconst_2\n 217: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 222: checkcast #53 // class java/lang/String\n 225: invokestatic #89 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 228: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 231: aload 15\n 233: iconst_3\n 234: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 239: checkcast #53 // class java/lang/String\n 242: invokestatic #89 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 245: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 248: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 251: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 254: aload 25\n 256: swap\n 257: invokeinterface #100, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 262: pop\n 263: goto 73\n 266: aload 8\n 268: checkcast #79 // class java/util/List\n 271: nop\n 272: checkcast #37 // class java/util/Collection\n 275: invokestatic #104 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 278: astore 4\n 280: aconst_null\n 281: astore 5\n 283: new #106 // class java/util/LinkedHashSet\n 286: dup\n 287: invokespecial #108 // Method java/util/LinkedHashSet.\"<init>\":()V\n 290: checkcast #110 // class java/util/Set\n 293: astore 5\n 295: aload 4\n 297: checkcast #24 // class java/lang/Iterable\n 300: astore 6\n 302: iconst_0\n 303: istore 7\n 305: aload 6\n 307: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 312: astore 8\n 314: aload 8\n 316: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 321: ifeq 575\n 324: aload 8\n 326: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 331: astore 9\n 333: aload 9\n 335: checkcast #77 // class kotlin/Pair\n 338: astore 10\n 340: iconst_0\n 341: istore 11\n 343: aload 10\n 345: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 348: checkcast #77 // class kotlin/Pair\n 351: aload 10\n 353: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 356: checkcast #77 // class kotlin/Pair\n 359: iload_2\n 360: invokestatic #120 // Method getPoints:(Lkotlin/Pair;Lkotlin/Pair;I)Ljava/util/List;\n 363: astore 12\n 365: new #122 // class kotlin/jvm/internal/Ref$ObjectRef\n 368: dup\n 369: invokespecial #123 // Method kotlin/jvm/internal/Ref$ObjectRef.\"<init>\":()V\n 372: astore 13\n 374: aload 13\n 376: aload 4\n 378: checkcast #24 // class java/lang/Iterable\n 381: astore 14\n 383: astore 15\n 385: iconst_0\n 386: istore 16\n 388: aload 14\n 390: astore 17\n 392: new #26 // class java/util/ArrayList\n 395: dup\n 396: aload 14\n 398: bipush 10\n 400: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 403: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 406: checkcast #37 // class java/util/Collection\n 409: astore 18\n 411: iconst_0\n 412: istore 19\n 414: aload 17\n 416: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 421: astore 20\n 423: aload 20\n 425: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 430: ifeq 476\n 433: aload 20\n 435: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 440: astore 21\n 442: aload 18\n 444: aload 21\n 446: checkcast #77 // class kotlin/Pair\n 449: astore 22\n 451: astore 23\n 453: iconst_0\n 454: istore 24\n 456: aload 22\n 458: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 461: checkcast #77 // class kotlin/Pair\n 464: aload 23\n 466: swap\n 467: invokeinterface #100, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 472: pop\n 473: goto 423\n 476: aload 18\n 478: checkcast #79 // class java/util/List\n 481: nop\n 482: aload 15\n 484: swap\n 485: putfield #127 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 488: aload 12\n 490: checkcast #24 // class java/lang/Iterable\n 493: astore 14\n 495: iconst_0\n 496: istore 16\n 498: aload 14\n 500: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 505: astore 17\n 507: aload 17\n 509: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 514: ifeq 569\n 517: aload 17\n 519: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 524: astore 18\n 526: aload 18\n 528: checkcast #77 // class kotlin/Pair\n 531: astore 19\n 533: iconst_0\n 534: istore 20\n 536: aload 13\n 538: getfield #127 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 541: checkcast #79 // class java/util/List\n 544: aload 19\n 546: invokeinterface #130, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 551: ifne 564\n 554: aload 5\n 556: aload 19\n 558: invokeinterface #131, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 563: pop\n 564: nop\n 565: nop\n 566: goto 507\n 569: nop\n 570: nop\n 571: nop\n 572: goto 314\n 575: nop\n 576: new #133 // class java/lang/StringBuilder\n 579: dup\n 580: invokespecial #134 // Method java/lang/StringBuilder.\"<init>\":()V\n 583: ldc #136 // String Part 1 Answer:\n 585: invokevirtual #140 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 588: aload 5\n 590: invokeinterface #144, 1 // InterfaceMethod java/util/Set.size:()I\n 595: invokevirtual #147 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 598: invokevirtual #151 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 601: getstatic #157 // Field java/lang/System.out:Ljava/io/PrintStream;\n 604: swap\n 605: invokevirtual #163 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 608: getstatic #157 // Field java/lang/System.out:Ljava/io/PrintStream;\n 611: invokevirtual #165 // Method java/io/PrintStream.println:()V\n 614: aconst_null\n 615: astore 6\n 617: new #26 // class java/util/ArrayList\n 620: dup\n 621: invokespecial #166 // Method java/util/ArrayList.\"<init>\":()V\n 624: checkcast #79 // class java/util/List\n 627: astore 6\n 629: aload 4\n 631: checkcast #24 // class java/lang/Iterable\n 634: astore 7\n 636: iconst_0\n 637: istore 8\n 639: aload 7\n 641: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 646: astore 9\n 648: aload 9\n 650: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 655: ifeq 712\n 658: aload 9\n 660: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 665: astore 10\n 667: aload 10\n 669: checkcast #77 // class kotlin/Pair\n 672: astore 11\n 674: iconst_0\n 675: istore 12\n 677: aload 6\n 679: aload 11\n 681: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 684: checkcast #77 // class kotlin/Pair\n 687: aload 11\n 689: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 692: checkcast #77 // class kotlin/Pair\n 695: invokestatic #170 // Method getDiamondOutsides:(Lkotlin/Pair;Lkotlin/Pair;)Ljava/util/List;\n 698: checkcast #37 // class java/util/Collection\n 701: invokeinterface #174, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 706: pop\n 707: nop\n 708: nop\n 709: goto 648\n 712: nop\n 713: aload 6\n 715: iconst_2\n 716: anewarray #176 // class kotlin/jvm/functions/Function1\n 719: astore 7\n 721: aload 7\n 723: iconst_0\n 724: invokedynamic #195, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 729: aastore\n 730: aload 7\n 732: iconst_1\n 733: invokedynamic #200, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 738: aastore\n 739: aload 7\n 741: invokestatic #206 // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;\n 744: invokestatic #210 // Method kotlin/collections/CollectionsKt.sortWith:(Ljava/util/List;Ljava/util/Comparator;)V\n 747: aconst_null\n 748: astore 7\n 750: new #26 // class java/util/ArrayList\n 753: dup\n 754: invokespecial #166 // Method java/util/ArrayList.\"<init>\":()V\n 757: checkcast #79 // class java/util/List\n 760: astore 7\n 762: iconst_0\n 763: istore 8\n 765: iload 8\n 767: aload 6\n 769: invokeinterface #211, 1 // InterfaceMethod java/util/List.size:()I\n 774: iconst_1\n 775: isub\n 776: if_icmpgt 1012\n 779: aload 6\n 781: iload 8\n 783: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 788: checkcast #77 // class kotlin/Pair\n 791: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 794: checkcast #213 // class java/lang/Number\n 797: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 800: iflt 1003\n 803: aload 6\n 805: iload 8\n 807: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 812: checkcast #77 // class kotlin/Pair\n 815: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 818: checkcast #213 // class java/lang/Number\n 821: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 824: iload_1\n 825: if_icmpgt 1003\n 828: aload 6\n 830: iload 8\n 832: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 837: checkcast #77 // class kotlin/Pair\n 840: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 843: checkcast #213 // class java/lang/Number\n 846: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 849: iflt 1003\n 852: aload 6\n 854: iload 8\n 856: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 861: checkcast #77 // class kotlin/Pair\n 864: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 867: checkcast #213 // class java/lang/Number\n 870: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 873: iload_1\n 874: if_icmpgt 1003\n 877: iload 8\n 879: aload 6\n 881: invokeinterface #211, 1 // InterfaceMethod java/util/List.size:()I\n 886: iconst_1\n 887: isub\n 888: if_icmpge 1003\n 891: aload 6\n 893: iload 8\n 895: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 900: aload 6\n 902: iload 8\n 904: iconst_1\n 905: iadd\n 906: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 911: invokestatic #222 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 914: ifeq 994\n 917: iconst_1\n 918: istore 9\n 920: aload 6\n 922: iload 8\n 924: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 929: aload 6\n 931: iload 8\n 933: iload 9\n 935: iadd\n 936: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 941: invokestatic #222 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 944: ifeq 953\n 947: iinc 9, 1\n 950: goto 920\n 953: aload 7\n 955: new #77 // class kotlin/Pair\n 958: dup\n 959: aload 6\n 961: iload 8\n 963: invokeinterface #83, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 968: iload 9\n 970: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 973: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 976: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 981: pop\n 982: iload 8\n 984: iload 9\n 986: iconst_1\n 987: isub\n 988: iadd\n 989: istore 8\n 991: goto 765\n 994: iload 8\n 996: iinc 8, 1\n 999: pop\n 1000: goto 765\n 1003: iload 8\n 1005: iinc 8, 1\n 1008: pop\n 1009: goto 765\n 1012: aload 7\n 1014: astore 9\n 1016: iconst_0\n 1017: istore 10\n 1019: aload 9\n 1021: invokeinterface #211, 1 // InterfaceMethod java/util/List.size:()I\n 1026: iconst_1\n 1027: if_icmple 1045\n 1030: aload 9\n 1032: new #225 // class Day15Kt$main$$inlined$sortByDescending$1\n 1035: dup\n 1036: invokespecial #226 // Method Day15Kt$main$$inlined$sortByDescending$1.\"<init>\":()V\n 1039: checkcast #228 // class java/util/Comparator\n 1042: invokestatic #210 // Method kotlin/collections/CollectionsKt.sortWith:(Ljava/util/List;Ljava/util/Comparator;)V\n 1045: nop\n 1046: aconst_null\n 1047: astore 9\n 1049: aload 4\n 1051: checkcast #24 // class java/lang/Iterable\n 1054: astore 10\n 1056: iconst_0\n 1057: istore 11\n 1059: aload 10\n 1061: astore 12\n 1063: new #26 // class java/util/ArrayList\n 1066: dup\n 1067: aload 10\n 1069: bipush 10\n 1071: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1074: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 1077: checkcast #37 // class java/util/Collection\n 1080: astore 13\n 1082: iconst_0\n 1083: istore 14\n 1085: aload 12\n 1087: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1092: astore 15\n 1094: aload 15\n 1096: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1101: ifeq 1181\n 1104: aload 15\n 1106: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1111: astore 16\n 1113: aload 13\n 1115: aload 16\n 1117: checkcast #77 // class kotlin/Pair\n 1120: astore 17\n 1122: astore 25\n 1124: iconst_0\n 1125: istore 18\n 1127: new #230 // class SBPair\n 1130: dup\n 1131: aload 17\n 1133: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1136: checkcast #77 // class kotlin/Pair\n 1139: aload 17\n 1141: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1144: checkcast #77 // class kotlin/Pair\n 1147: aload 17\n 1149: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1152: checkcast #77 // class kotlin/Pair\n 1155: aload 17\n 1157: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1160: checkcast #77 // class kotlin/Pair\n 1163: invokestatic #234 // Method getDistance:(Lkotlin/Pair;Lkotlin/Pair;)I\n 1166: invokespecial #237 // Method SBPair.\"<init>\":(Lkotlin/Pair;Lkotlin/Pair;I)V\n 1169: aload 25\n 1171: swap\n 1172: invokeinterface #100, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1177: pop\n 1178: goto 1094\n 1181: aload 13\n 1183: checkcast #79 // class java/util/List\n 1186: nop\n 1187: astore 9\n 1189: aconst_null\n 1190: astore 10\n 1192: new #77 // class kotlin/Pair\n 1195: dup\n 1196: iconst_0\n 1197: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1200: iconst_0\n 1201: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1204: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 1207: astore 10\n 1209: iconst_0\n 1210: istore 11\n 1212: aload 7\n 1214: checkcast #24 // class java/lang/Iterable\n 1217: astore 12\n 1219: iconst_0\n 1220: istore 13\n 1222: aload 12\n 1224: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1229: astore 14\n 1231: aload 14\n 1233: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1238: ifeq 1370\n 1241: aload 14\n 1243: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1248: astore 15\n 1250: aload 15\n 1252: checkcast #77 // class kotlin/Pair\n 1255: astore 16\n 1257: iconst_0\n 1258: istore 17\n 1260: iconst_0\n 1261: istore 18\n 1263: iconst_1\n 1264: istore 18\n 1266: aload 9\n 1268: checkcast #24 // class java/lang/Iterable\n 1271: astore 19\n 1273: iconst_0\n 1274: istore 20\n 1276: aload 19\n 1278: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1283: astore 21\n 1285: aload 21\n 1287: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1292: ifeq 1349\n 1295: aload 21\n 1297: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1302: astore 22\n 1304: aload 22\n 1306: checkcast #230 // class SBPair\n 1309: astore 23\n 1311: iconst_0\n 1312: istore 24\n 1314: aload 16\n 1316: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1319: checkcast #77 // class kotlin/Pair\n 1322: aload 23\n 1324: invokevirtual #241 // Method SBPair.getStart:()Lkotlin/Pair;\n 1327: invokestatic #234 // Method getDistance:(Lkotlin/Pair;Lkotlin/Pair;)I\n 1330: aload 23\n 1332: invokevirtual #243 // Method SBPair.getDistance:()I\n 1335: if_icmpgt 1344\n 1338: iconst_0\n 1339: istore 18\n 1341: goto 1345\n 1344: nop\n 1345: nop\n 1346: goto 1285\n 1349: nop\n 1350: iload 18\n 1352: ifeq 1365\n 1355: aload 16\n 1357: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1360: astore 10\n 1362: goto 1372\n 1365: nop\n 1366: nop\n 1367: goto 1231\n 1370: nop\n 1371: nop\n 1372: nop\n 1373: new #133 // class java/lang/StringBuilder\n 1376: dup\n 1377: invokespecial #134 // Method java/lang/StringBuilder.\"<init>\":()V\n 1380: ldc #245 // String Part 2 Answer: |\n 1382: invokevirtual #140 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1385: new #247 // class java/math/BigInteger\n 1388: dup\n 1389: aload 10\n 1391: checkcast #77 // class kotlin/Pair\n 1394: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1397: checkcast #213 // class java/lang/Number\n 1400: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 1403: invokestatic #250 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 1406: invokespecial #251 // Method java/math/BigInteger.\"<init>\":(Ljava/lang/String;)V\n 1409: new #247 // class java/math/BigInteger\n 1412: dup\n 1413: ldc #253 // String 4000000\n 1415: invokespecial #251 // Method java/math/BigInteger.\"<init>\":(Ljava/lang/String;)V\n 1418: invokevirtual #257 // Method java/math/BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;\n 1421: dup\n 1422: ldc_w #259 // String multiply(...)\n 1425: invokestatic #263 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 1428: astore 11\n 1430: new #247 // class java/math/BigInteger\n 1433: dup\n 1434: aload 10\n 1436: checkcast #77 // class kotlin/Pair\n 1439: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 1442: checkcast #213 // class java/lang/Number\n 1445: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 1448: invokestatic #250 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 1451: invokespecial #251 // Method java/math/BigInteger.\"<init>\":(Ljava/lang/String;)V\n 1454: aload 11\n 1456: swap\n 1457: invokevirtual #265 // Method java/math/BigInteger.add:(Ljava/math/BigInteger;)Ljava/math/BigInteger;\n 1460: dup\n 1461: ldc_w #267 // String add(...)\n 1464: invokestatic #263 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 1467: invokevirtual #270 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 1470: invokevirtual #151 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1473: getstatic #157 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1476: swap\n 1477: invokevirtual #163 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1480: return\n\n public static final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> getPointsAround(kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc_w #322 // String start\n 4: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: new #26 // class java/util/ArrayList\n 10: dup\n 11: invokespecial #166 // Method java/util/ArrayList.\"<init>\":()V\n 14: checkcast #79 // class java/util/List\n 17: astore_1\n 18: aload_1\n 19: new #77 // class kotlin/Pair\n 22: dup\n 23: aload_0\n 24: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 27: checkcast #213 // class java/lang/Number\n 30: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 33: iconst_1\n 34: isub\n 35: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 38: aload_0\n 39: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 42: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 45: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 50: pop\n 51: aload_1\n 52: new #77 // class kotlin/Pair\n 55: dup\n 56: aload_0\n 57: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 60: checkcast #213 // class java/lang/Number\n 63: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 66: iconst_1\n 67: iadd\n 68: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 71: aload_0\n 72: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 75: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 78: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 83: pop\n 84: aload_1\n 85: new #77 // class kotlin/Pair\n 88: dup\n 89: aload_0\n 90: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 93: aload_0\n 94: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 97: checkcast #213 // class java/lang/Number\n 100: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 103: iconst_1\n 104: isub\n 105: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 108: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 111: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 116: pop\n 117: aload_1\n 118: new #77 // class kotlin/Pair\n 121: dup\n 122: aload_0\n 123: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 126: aload_0\n 127: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 130: checkcast #213 // class java/lang/Number\n 133: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 136: iconst_1\n 137: iadd\n 138: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 141: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 144: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 149: pop\n 150: aload_1\n 151: areturn\n\n public static final int getDistance(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc_w #322 // String start\n 4: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #328 // String end\n 11: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_0\n 15: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 18: checkcast #213 // class java/lang/Number\n 21: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 24: aload_1\n 25: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 28: checkcast #213 // class java/lang/Number\n 31: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 34: isub\n 35: istore_2\n 36: aload_0\n 37: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 40: checkcast #213 // class java/lang/Number\n 43: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 46: aload_1\n 47: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 50: checkcast #213 // class java/lang/Number\n 53: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 56: isub\n 57: istore_3\n 58: iload_2\n 59: invokestatic #334 // Method java/lang/Math.abs:(I)I\n 62: iload_3\n 63: invokestatic #334 // Method java/lang/Math.abs:(I)I\n 66: iadd\n 67: ireturn\n\n public static final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> getDiamondOutsides(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc_w #322 // String start\n 4: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #328 // String end\n 11: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: new #26 // class java/util/ArrayList\n 17: dup\n 18: invokespecial #166 // Method java/util/ArrayList.\"<init>\":()V\n 21: checkcast #79 // class java/util/List\n 24: astore_2\n 25: aload_0\n 26: aload_1\n 27: invokestatic #234 // Method getDistance:(Lkotlin/Pair;Lkotlin/Pair;)I\n 30: iconst_1\n 31: iadd\n 32: istore_3\n 33: new #77 // class kotlin/Pair\n 36: dup\n 37: iconst_0\n 38: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 41: iload_3\n 42: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 45: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 48: astore 4\n 50: aload 4\n 52: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 55: checkcast #213 // class java/lang/Number\n 58: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 61: ifeq 128\n 64: aload_2\n 65: new #77 // class kotlin/Pair\n 68: dup\n 69: aload_0\n 70: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 73: checkcast #213 // class java/lang/Number\n 76: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 79: aload 4\n 81: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 84: checkcast #213 // class java/lang/Number\n 87: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 90: iadd\n 91: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 94: aload_0\n 95: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 98: checkcast #213 // class java/lang/Number\n 101: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 104: aload 4\n 106: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 109: checkcast #213 // class java/lang/Number\n 112: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 115: iadd\n 116: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 119: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 122: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 127: pop\n 128: aload 4\n 130: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 133: checkcast #213 // class java/lang/Number\n 136: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 139: ifeq 206\n 142: aload_2\n 143: new #77 // class kotlin/Pair\n 146: dup\n 147: aload_0\n 148: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 151: checkcast #213 // class java/lang/Number\n 154: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 157: aload 4\n 159: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 162: checkcast #213 // class java/lang/Number\n 165: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 168: iadd\n 169: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 172: aload_0\n 173: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 176: checkcast #213 // class java/lang/Number\n 179: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 182: aload 4\n 184: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 187: checkcast #213 // class java/lang/Number\n 190: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 193: isub\n 194: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 197: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 200: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 205: pop\n 206: aload 4\n 208: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 211: checkcast #213 // class java/lang/Number\n 214: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 217: ifeq 284\n 220: aload_2\n 221: new #77 // class kotlin/Pair\n 224: dup\n 225: aload_0\n 226: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 229: checkcast #213 // class java/lang/Number\n 232: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 235: aload 4\n 237: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 240: checkcast #213 // class java/lang/Number\n 243: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 246: isub\n 247: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 250: aload_0\n 251: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 254: checkcast #213 // class java/lang/Number\n 257: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 260: aload 4\n 262: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 265: checkcast #213 // class java/lang/Number\n 268: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 271: iadd\n 272: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 275: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 278: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 283: pop\n 284: aload 4\n 286: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 289: checkcast #213 // class java/lang/Number\n 292: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 295: ifeq 362\n 298: aload_2\n 299: new #77 // class kotlin/Pair\n 302: dup\n 303: aload_0\n 304: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 307: checkcast #213 // class java/lang/Number\n 310: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 313: aload 4\n 315: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 318: checkcast #213 // class java/lang/Number\n 321: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 324: isub\n 325: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 328: aload_0\n 329: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 332: checkcast #213 // class java/lang/Number\n 335: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 338: aload 4\n 340: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 343: checkcast #213 // class java/lang/Number\n 346: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 349: isub\n 350: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 353: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 356: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 361: pop\n 362: new #77 // class kotlin/Pair\n 365: dup\n 366: aload 4\n 368: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 371: checkcast #213 // class java/lang/Number\n 374: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 377: iconst_1\n 378: iadd\n 379: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 382: aload 4\n 384: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 387: checkcast #213 // class java/lang/Number\n 390: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 393: iconst_1\n 394: isub\n 395: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 398: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 401: astore 4\n 403: aload 4\n 405: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 408: checkcast #213 // class java/lang/Number\n 411: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 414: ifne 50\n 417: aload_2\n 418: areturn\n\n public static final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> getPoints(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>, int);\n Code:\n 0: aload_0\n 1: ldc_w #322 // String start\n 4: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #328 // String end\n 11: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: new #26 // class java/util/ArrayList\n 17: dup\n 18: invokespecial #166 // Method java/util/ArrayList.\"<init>\":()V\n 21: checkcast #79 // class java/util/List\n 24: astore_3\n 25: aload_0\n 26: aload_1\n 27: invokestatic #234 // Method getDistance:(Lkotlin/Pair;Lkotlin/Pair;)I\n 30: istore 4\n 32: iload_2\n 33: iconst_m1\n 34: if_icmpeq 155\n 37: aload_0\n 38: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 41: checkcast #213 // class java/lang/Number\n 44: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 47: iload 4\n 49: isub\n 50: istore 5\n 52: aload_0\n 53: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 56: checkcast #213 // class java/lang/Number\n 59: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 62: iload 4\n 64: iadd\n 65: istore 6\n 67: iload 5\n 69: iload 6\n 71: if_icmpgt 325\n 74: aload_0\n 75: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 78: checkcast #213 // class java/lang/Number\n 81: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 84: iload 5\n 86: isub\n 87: istore 7\n 89: aload_0\n 90: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 93: checkcast #213 // class java/lang/Number\n 96: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 99: iload_2\n 100: isub\n 101: istore 8\n 103: iload 7\n 105: invokestatic #334 // Method java/lang/Math.abs:(I)I\n 108: iload 8\n 110: invokestatic #334 // Method java/lang/Math.abs:(I)I\n 113: iadd\n 114: iload 4\n 116: if_icmpgt 142\n 119: aload_3\n 120: new #77 // class kotlin/Pair\n 123: dup\n 124: iload 5\n 126: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 129: iload_2\n 130: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 133: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 136: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 141: pop\n 142: iload 5\n 144: iload 6\n 146: if_icmpeq 325\n 149: iinc 5, 1\n 152: goto 74\n 155: aload_0\n 156: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 159: checkcast #213 // class java/lang/Number\n 162: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 165: iload 4\n 167: isub\n 168: istore 5\n 170: aload_0\n 171: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 174: checkcast #213 // class java/lang/Number\n 177: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 180: iload 4\n 182: iadd\n 183: istore 6\n 185: iload 5\n 187: iload 6\n 189: if_icmpgt 325\n 192: aload_0\n 193: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 196: checkcast #213 // class java/lang/Number\n 199: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 202: iload 4\n 204: isub\n 205: istore 7\n 207: aload_0\n 208: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 211: checkcast #213 // class java/lang/Number\n 214: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 217: iload 4\n 219: iadd\n 220: istore 8\n 222: iload 7\n 224: iload 8\n 226: if_icmpgt 312\n 229: aload_0\n 230: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 233: checkcast #213 // class java/lang/Number\n 236: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 239: iload 5\n 241: isub\n 242: istore 9\n 244: aload_0\n 245: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 248: checkcast #213 // class java/lang/Number\n 251: invokevirtual #216 // Method java/lang/Number.intValue:()I\n 254: iload 7\n 256: isub\n 257: istore 10\n 259: iload 9\n 261: invokestatic #334 // Method java/lang/Math.abs:(I)I\n 264: iload 10\n 266: invokestatic #334 // Method java/lang/Math.abs:(I)I\n 269: iadd\n 270: iload 4\n 272: if_icmpgt 299\n 275: aload_3\n 276: new #77 // class kotlin/Pair\n 279: dup\n 280: iload 5\n 282: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 285: iload 7\n 287: invokestatic #93 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 290: invokespecial #96 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 293: invokeinterface #223, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 298: pop\n 299: iload 7\n 301: iload 8\n 303: if_icmpeq 312\n 306: iinc 7, 1\n 309: goto 229\n 312: iload 5\n 314: iload 6\n 316: if_icmpeq 325\n 319: iinc 5, 1\n 322: goto 192\n 325: aload_3\n 326: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #346 // Method main:()V\n 3: return\n\n private static final java.lang.Comparable main$lambda$5(kotlin.Pair);\n Code:\n 0: aload_0\n 1: ldc_w #349 // String it\n 4: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #113 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 11: checkcast #351 // class java/lang/Comparable\n 14: areturn\n\n private static final java.lang.Comparable main$lambda$6(kotlin.Pair);\n Code:\n 0: aload_0\n 1: ldc_w #349 // String it\n 4: invokestatic #325 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #116 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 11: checkcast #351 // class java/lang/Comparable\n 14: areturn\n}\n", "javap_err": "" }, { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day15Kt$main$$inlined$sortByDescending$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day15Kt$main$$inlined$sortByDescending$1<T> implements java.util.Comparator {\n public Day15Kt$main$$inlined$sortByDescending$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_2\n 1: checkcast #23 // class kotlin/Pair\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 12: checkcast #29 // class java/lang/Integer\n 15: checkcast #31 // class java/lang/Comparable\n 18: aload_1\n 19: checkcast #23 // class kotlin/Pair\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 32: checkcast #29 // class java/lang/Integer\n 35: aload 5\n 37: swap\n 38: checkcast #31 // class java/lang/Comparable\n 41: invokestatic #37 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" } ]
joshpierce__advent-of-code-22__fd5414c/src/Day13.kt
import java.io.File fun main() { var directions: List<String> = File("Day13.txt").readLines() var pairs = directions.chunked(3).map { Pair(it[0], it[1])} var validIndexes: MutableList<Int> = mutableListOf() var allPackets: MutableList<Any> = mutableListOf() pairs.forEachIndexed { idx, it -> println("== Pair ${idx+1} ==") var left = parseList(it.first.substring(1, it.first.length - 1)) allPackets.add(left) var right = parseList(it.second.substring(1, it.second.length - 1)) allPackets.add(right) println("- Compare ${left.toString()} vs ${right.toString()}") if(compare(left, right, 0) == 1) { validIndexes.add(idx+1) } println("") } //Part 1 println("Sum Of Valid Indexes Is: ${validIndexes.sum()}") //Part 2 val comparator = Comparator { a: Any, b: Any -> return@Comparator compare(a as MutableList<Any>, b as MutableList<Any>, 0) } allPackets.sortWith(comparator) var pkt2Index: Int = 0 var pkt6Index: Int = 0 allPackets.reversed().forEachIndexed { idx, it -> println("${idx+1} - ${it.toString()}") if (it.toString() == "[[2]]") pkt2Index = idx + 1 if (it.toString() == "[[6]]") pkt6Index = idx + 1 } println("The Decoder Key is ${pkt2Index * pkt6Index}") } fun compare(left: MutableList<Any>, right: MutableList<Any>, level: Int): Int { left.forEachIndexed { idx, leftVal -> if (right.size < idx + 1) { println("Right (${right.toString()}) List Is Shorter (${right.size}) Than Left List, Stopping Checks - INVALID ❌❌❌") return -1 } println("${"".padStart(level*2)}- Compare ${leftVal} vs ${right[idx]}") if (leftVal is Int && right[idx] is Int) { // both Values are ints, make sure that left is <= right to continue if (leftVal.toString().toInt() == right[idx].toString().toInt()) { return@forEachIndexed } else if (leftVal.toString().toInt() < right[idx].toString().toInt()) { println("LeftVal: ${leftVal} is < than RightVal: ${right[idx]} - VALID ✅✅✅") return 1 } else { println("LeftVal: ${leftVal} is > than RightVal: ${right[idx]} - INVALID ❌❌❌") return -1 } } else { var leftToCheck: MutableList<Any> = mutableListOf() if (leftVal is Int) { leftToCheck = mutableListOf(leftVal) } else if (leftVal is MutableList<*>) { leftToCheck = leftVal as MutableList<Any> } var rightToCheck: MutableList<Any> = mutableListOf() if (right[idx] is Int) { rightToCheck = mutableListOf(right[idx]) } else if (right[idx] is MutableList<*>) { rightToCheck = right[idx] as MutableList<Any> } // The Right Side is a List, Convert the Left Side To A List and Compare var innerCheck = compare(leftToCheck, rightToCheck, level + 1) if (innerCheck == 0) { return@forEachIndexed } else { return innerCheck } } } // According to the Rules we shouldn't get here as our ultimate check?? if(left.size < right.size) { println("Left List Is Smaller Than Right List, But All Items Are The Same - VALID ✅✅✅") return 1 } else { return 0 } } fun parseList(str: String): MutableList<Any> { //println("Parser Started for | ${str}") var newList: MutableList<Any> = mutableListOf() var idx: Int = 0 while (idx < str.length) { //println("Idx ${idx.toString()} | Char ${str.get(idx).toString()}") if (str.get(idx) == '[') { var endBracketPos = getValidCloseBracket(str.substring(idx, str.length)) //println("Found Valid Close Bracket | Start ${idx} | End ${endBracketPos}") newList.add(parseList(str.substring(idx+1, idx+endBracketPos))) idx = idx+endBracketPos + 1 } else if (listOf(',',']').contains(str.get(idx))) { idx++ } else { // println(str) //grab addl characters var tmpstr = str.get(idx).toString() // println("tmpstr ${tmpstr}") var tmpidx = idx // println("tmpidx ${tmpidx}") while (str.length > tmpidx+1 && !listOf('[',']',',').contains(str.get(tmpidx+1))) { //println("NextChar: ${str.get(tmpidx+1)}") tmpstr += str.get(tmpidx+1).toString() tmpidx++ } newList.add(tmpstr.toInt()) idx++ } } return newList } fun getValidCloseBracket(str: String): Int { //println("Getting Close Bracket Position for ${str}") var brackets: MutableList<Char> = mutableListOf() str.toMutableList().forEachIndexed { idx, char -> if (char == '[') { brackets.add('[') } else if (char == ']') { if (brackets.last() == '[') brackets.removeLast() if (brackets.size == 0) { return idx } } } return -1 }
[ { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day13Kt.class", "javap": "Compiled from \"Day13.kt\"\npublic final class Day13Kt {\n public static final void main();\n Code:\n 0: new #8 // class java/io/File\n 3: dup\n 4: ldc #10 // String Day13.txt\n 6: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: aconst_null\n 10: iconst_1\n 11: aconst_null\n 12: invokestatic #20 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 15: astore_0\n 16: aload_0\n 17: checkcast #22 // class java/lang/Iterable\n 20: iconst_3\n 21: invokestatic #28 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 24: checkcast #22 // class java/lang/Iterable\n 27: astore_2\n 28: iconst_0\n 29: istore_3\n 30: aload_2\n 31: astore 4\n 33: new #30 // class java/util/ArrayList\n 36: dup\n 37: aload_2\n 38: bipush 10\n 40: invokestatic #34 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 43: invokespecial #37 // Method java/util/ArrayList.\"<init>\":(I)V\n 46: checkcast #39 // class java/util/Collection\n 49: astore 5\n 51: iconst_0\n 52: istore 6\n 54: aload 4\n 56: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 61: astore 7\n 63: aload 7\n 65: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 70: ifeq 131\n 73: aload 7\n 75: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 80: astore 8\n 82: aload 5\n 84: aload 8\n 86: checkcast #55 // class java/util/List\n 89: astore 9\n 91: astore 16\n 93: iconst_0\n 94: istore 10\n 96: new #57 // class kotlin/Pair\n 99: dup\n 100: aload 9\n 102: iconst_0\n 103: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 108: aload 9\n 110: iconst_1\n 111: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 116: invokespecial #64 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 119: aload 16\n 121: swap\n 122: invokeinterface #68, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 127: pop\n 128: goto 63\n 131: aload 5\n 133: checkcast #55 // class java/util/List\n 136: nop\n 137: astore_1\n 138: aconst_null\n 139: astore_2\n 140: new #30 // class java/util/ArrayList\n 143: dup\n 144: invokespecial #70 // Method java/util/ArrayList.\"<init>\":()V\n 147: checkcast #55 // class java/util/List\n 150: astore_2\n 151: aconst_null\n 152: astore_3\n 153: new #30 // class java/util/ArrayList\n 156: dup\n 157: invokespecial #70 // Method java/util/ArrayList.\"<init>\":()V\n 160: checkcast #55 // class java/util/List\n 163: astore_3\n 164: aload_1\n 165: checkcast #22 // class java/lang/Iterable\n 168: astore 4\n 170: iconst_0\n 171: istore 5\n 173: iconst_0\n 174: istore 6\n 176: aload 4\n 178: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 183: astore 7\n 185: aload 7\n 187: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 192: ifeq 434\n 195: aload 7\n 197: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 202: astore 8\n 204: iload 6\n 206: iinc 6, 1\n 209: istore 9\n 211: iload 9\n 213: ifge 219\n 216: invokestatic #73 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 219: iload 9\n 221: aload 8\n 223: checkcast #57 // class kotlin/Pair\n 226: astore 10\n 228: istore 11\n 230: iconst_0\n 231: istore 12\n 233: new #75 // class java/lang/StringBuilder\n 236: dup\n 237: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 240: ldc #78 // String == Pair\n 242: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 245: iload 11\n 247: iconst_1\n 248: iadd\n 249: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 252: ldc #87 // String ==\n 254: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 257: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 260: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 263: swap\n 264: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 267: aload 10\n 269: invokevirtual #106 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 272: checkcast #108 // class java/lang/String\n 275: iconst_1\n 276: aload 10\n 278: invokevirtual #106 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 281: checkcast #108 // class java/lang/String\n 284: invokevirtual #112 // Method java/lang/String.length:()I\n 287: iconst_1\n 288: isub\n 289: invokevirtual #116 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 292: dup\n 293: ldc #118 // String substring(...)\n 295: invokestatic #124 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 298: invokestatic #128 // Method parseList:(Ljava/lang/String;)Ljava/util/List;\n 301: astore 13\n 303: aload_3\n 304: aload 13\n 306: invokeinterface #129, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 311: pop\n 312: aload 10\n 314: invokevirtual #132 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 317: checkcast #108 // class java/lang/String\n 320: iconst_1\n 321: aload 10\n 323: invokevirtual #132 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 326: checkcast #108 // class java/lang/String\n 329: invokevirtual #112 // Method java/lang/String.length:()I\n 332: iconst_1\n 333: isub\n 334: invokevirtual #116 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 337: dup\n 338: ldc #118 // String substring(...)\n 340: invokestatic #124 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 343: invokestatic #128 // Method parseList:(Ljava/lang/String;)Ljava/util/List;\n 346: astore 14\n 348: aload_3\n 349: aload 14\n 351: invokeinterface #129, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 356: pop\n 357: new #75 // class java/lang/StringBuilder\n 360: dup\n 361: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 364: ldc #134 // String - Compare\n 366: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 369: aload 13\n 371: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 374: ldc #139 // String vs\n 376: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 379: aload 14\n 381: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 384: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 387: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 390: swap\n 391: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 394: aload 13\n 396: aload 14\n 398: iconst_0\n 399: invokestatic #143 // Method compare:(Ljava/util/List;Ljava/util/List;I)I\n 402: iconst_1\n 403: if_icmpne 420\n 406: aload_2\n 407: iload 11\n 409: iconst_1\n 410: iadd\n 411: invokestatic #149 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 414: invokeinterface #129, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 419: pop\n 420: ldc #151 // String\n 422: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 425: swap\n 426: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 429: nop\n 430: nop\n 431: goto 185\n 434: nop\n 435: new #75 // class java/lang/StringBuilder\n 438: dup\n 439: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 442: ldc #153 // String Sum Of Valid Indexes Is:\n 444: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 447: aload_2\n 448: checkcast #22 // class java/lang/Iterable\n 451: invokestatic #157 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 454: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 457: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 460: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 463: swap\n 464: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 467: invokedynamic #173, 0 // InvokeDynamic #0:compare:()Ljava/util/Comparator;\n 472: astore 4\n 474: aload_3\n 475: aload 4\n 477: invokestatic #177 // Method kotlin/collections/CollectionsKt.sortWith:(Ljava/util/List;Ljava/util/Comparator;)V\n 480: iconst_0\n 481: istore 5\n 483: iconst_0\n 484: istore 6\n 486: aload_3\n 487: checkcast #22 // class java/lang/Iterable\n 490: invokestatic #181 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;\n 493: checkcast #22 // class java/lang/Iterable\n 496: astore 7\n 498: iconst_0\n 499: istore 8\n 501: iconst_0\n 502: istore 9\n 504: aload 7\n 506: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 511: astore 10\n 513: aload 10\n 515: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 520: ifeq 635\n 523: aload 10\n 525: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 530: astore 11\n 532: iload 9\n 534: iinc 9, 1\n 537: istore 12\n 539: iload 12\n 541: ifge 547\n 544: invokestatic #73 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 547: iload 12\n 549: aload 11\n 551: astore 13\n 553: istore 14\n 555: iconst_0\n 556: istore 15\n 558: new #75 // class java/lang/StringBuilder\n 561: dup\n 562: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 565: iload 14\n 567: iconst_1\n 568: iadd\n 569: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 572: ldc #183 // String -\n 574: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 577: aload 13\n 579: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 582: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 585: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 588: swap\n 589: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 592: aload 13\n 594: invokevirtual #184 // Method java/lang/Object.toString:()Ljava/lang/String;\n 597: ldc #186 // String [[2]]\n 599: invokestatic #190 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 602: ifeq 611\n 605: iload 14\n 607: iconst_1\n 608: iadd\n 609: istore 5\n 611: aload 13\n 613: invokevirtual #184 // Method java/lang/Object.toString:()Ljava/lang/String;\n 616: ldc #192 // String [[6]]\n 618: invokestatic #190 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 621: ifeq 630\n 624: iload 14\n 626: iconst_1\n 627: iadd\n 628: istore 6\n 630: nop\n 631: nop\n 632: goto 513\n 635: nop\n 636: new #75 // class java/lang/StringBuilder\n 639: dup\n 640: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 643: ldc #194 // String The Decoder Key is\n 645: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 648: iload 5\n 650: iload 6\n 652: imul\n 653: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 656: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 659: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 662: swap\n 663: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 666: return\n\n public static final int compare(java.util.List<java.lang.Object>, java.util.List<java.lang.Object>, int);\n Code:\n 0: aload_0\n 1: ldc #230 // String left\n 3: invokestatic #233 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #234 // String right\n 9: invokestatic #233 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #22 // class java/lang/Iterable\n 16: astore_3\n 17: iconst_0\n 18: istore 4\n 20: iconst_0\n 21: istore 5\n 23: aload_3\n 24: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 29: astore 6\n 31: aload 6\n 33: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 38: ifeq 577\n 41: aload 6\n 43: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 48: astore 7\n 50: iload 5\n 52: iinc 5, 1\n 55: istore 8\n 57: iload 8\n 59: ifge 65\n 62: invokestatic #73 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 65: iload 8\n 67: aload 7\n 69: astore 9\n 71: istore 10\n 73: iconst_0\n 74: istore 11\n 76: aload_1\n 77: invokeinterface #237, 1 // InterfaceMethod java/util/List.size:()I\n 82: iload 10\n 84: iconst_1\n 85: iadd\n 86: if_icmpge 136\n 89: new #75 // class java/lang/StringBuilder\n 92: dup\n 93: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 96: ldc #239 // String Right (\n 98: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 101: aload_1\n 102: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 105: ldc #241 // String ) List Is Shorter (\n 107: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 110: aload_1\n 111: invokeinterface #237, 1 // InterfaceMethod java/util/List.size:()I\n 116: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 119: ldc #243 // String ) Than Left List, Stopping Checks - INVALID ❌❌❌\n 121: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 124: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 127: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 130: swap\n 131: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 134: iconst_m1\n 135: ireturn\n 136: new #75 // class java/lang/StringBuilder\n 139: dup\n 140: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 143: ldc #151 // String\n 145: iload_2\n 146: iconst_2\n 147: imul\n 148: iconst_0\n 149: iconst_2\n 150: aconst_null\n 151: invokestatic #249 // Method kotlin/text/StringsKt.padStart$default:(Ljava/lang/String;ICILjava/lang/Object;)Ljava/lang/String;\n 154: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 157: ldc #134 // String - Compare\n 159: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 162: aload 9\n 164: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 167: ldc #139 // String vs\n 169: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 172: aload_1\n 173: iload 10\n 175: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 180: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 183: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 186: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 189: swap\n 190: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 193: aload 9\n 195: instanceof #145 // class java/lang/Integer\n 198: ifeq 398\n 201: aload_1\n 202: iload 10\n 204: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 209: instanceof #145 // class java/lang/Integer\n 212: ifeq 398\n 215: aload 9\n 217: checkcast #251 // class java/lang/Number\n 220: invokevirtual #254 // Method java/lang/Number.intValue:()I\n 223: invokestatic #257 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 226: invokestatic #261 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 229: aload_1\n 230: iload 10\n 232: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 237: invokevirtual #184 // Method java/lang/Object.toString:()Ljava/lang/String;\n 240: invokestatic #261 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 243: if_icmpne 249\n 246: goto 573\n 249: aload 9\n 251: checkcast #251 // class java/lang/Number\n 254: invokevirtual #254 // Method java/lang/Number.intValue:()I\n 257: invokestatic #257 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 260: invokestatic #261 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 263: aload_1\n 264: iload 10\n 266: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 271: invokevirtual #184 // Method java/lang/Object.toString:()Ljava/lang/String;\n 274: invokestatic #261 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 277: if_icmpge 339\n 280: new #75 // class java/lang/StringBuilder\n 283: dup\n 284: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 287: ldc_w #263 // String LeftVal:\n 290: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 293: aload 9\n 295: checkcast #251 // class java/lang/Number\n 298: invokevirtual #254 // Method java/lang/Number.intValue:()I\n 301: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 304: ldc_w #265 // String is < than RightVal:\n 307: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 310: aload_1\n 311: iload 10\n 313: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 318: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 321: ldc_w #267 // String - VALID ✅✅✅\n 324: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 327: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 330: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 333: swap\n 334: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 337: iconst_1\n 338: ireturn\n 339: new #75 // class java/lang/StringBuilder\n 342: dup\n 343: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 346: ldc_w #263 // String LeftVal:\n 349: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 352: aload 9\n 354: checkcast #251 // class java/lang/Number\n 357: invokevirtual #254 // Method java/lang/Number.intValue:()I\n 360: invokevirtual #85 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 363: ldc_w #269 // String is > than RightVal:\n 366: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 369: aload_1\n 370: iload 10\n 372: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 377: invokevirtual #137 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 380: ldc_w #271 // String - INVALID ❌❌❌\n 383: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 386: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 389: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 392: swap\n 393: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 396: iconst_m1\n 397: ireturn\n 398: new #30 // class java/util/ArrayList\n 401: dup\n 402: invokespecial #70 // Method java/util/ArrayList.\"<init>\":()V\n 405: checkcast #55 // class java/util/List\n 408: astore 12\n 410: aload 9\n 412: instanceof #145 // class java/lang/Integer\n 415: ifeq 440\n 418: iconst_1\n 419: anewarray #4 // class java/lang/Object\n 422: astore 13\n 424: aload 13\n 426: iconst_0\n 427: aload 9\n 429: aastore\n 430: aload 13\n 432: invokestatic #275 // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;\n 435: astore 12\n 437: goto 462\n 440: aload 9\n 442: invokestatic #280 // Method kotlin/jvm/internal/TypeIntrinsics.isMutableList:(Ljava/lang/Object;)Z\n 445: ifeq 462\n 448: aload 9\n 450: dup\n 451: ldc_w #282 // String null cannot be cast to non-null type kotlin.collections.MutableList<kotlin.Any>\n 454: invokestatic #285 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)V\n 457: invokestatic #289 // Method kotlin/jvm/internal/TypeIntrinsics.asMutableList:(Ljava/lang/Object;)Ljava/util/List;\n 460: astore 12\n 462: new #30 // class java/util/ArrayList\n 465: dup\n 466: invokespecial #70 // Method java/util/ArrayList.\"<init>\":()V\n 469: checkcast #55 // class java/util/List\n 472: astore 13\n 474: aload_1\n 475: iload 10\n 477: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 482: instanceof #145 // class java/lang/Integer\n 485: ifeq 516\n 488: iconst_1\n 489: anewarray #4 // class java/lang/Object\n 492: astore 14\n 494: aload 14\n 496: iconst_0\n 497: aload_1\n 498: iload 10\n 500: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 505: aastore\n 506: aload 14\n 508: invokestatic #275 // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;\n 511: astore 13\n 513: goto 550\n 516: aload_1\n 517: iload 10\n 519: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 524: invokestatic #280 // Method kotlin/jvm/internal/TypeIntrinsics.isMutableList:(Ljava/lang/Object;)Z\n 527: ifeq 550\n 530: aload_1\n 531: iload 10\n 533: invokeinterface #61, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 538: dup\n 539: ldc_w #282 // String null cannot be cast to non-null type kotlin.collections.MutableList<kotlin.Any>\n 542: invokestatic #285 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)V\n 545: invokestatic #289 // Method kotlin/jvm/internal/TypeIntrinsics.asMutableList:(Ljava/lang/Object;)Ljava/util/List;\n 548: astore 13\n 550: aload 12\n 552: aload 13\n 554: iload_2\n 555: iconst_1\n 556: iadd\n 557: invokestatic #143 // Method compare:(Ljava/util/List;Ljava/util/List;I)I\n 560: istore 14\n 562: iload 14\n 564: ifne 570\n 567: goto 573\n 570: iload 14\n 572: ireturn\n 573: nop\n 574: goto 31\n 577: nop\n 578: aload_0\n 579: invokeinterface #237, 1 // InterfaceMethod java/util/List.size:()I\n 584: aload_1\n 585: invokeinterface #237, 1 // InterfaceMethod java/util/List.size:()I\n 590: if_icmpge 605\n 593: ldc_w #291 // String Left List Is Smaller Than Right List, But All Items Are The Same - VALID ✅✅✅\n 596: getstatic #97 // Field java/lang/System.out:Ljava/io/PrintStream;\n 599: swap\n 600: invokevirtual #103 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 603: iconst_1\n 604: ireturn\n 605: iconst_0\n 606: ireturn\n\n public static final java.util.List<java.lang.Object> parseList(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc_w #300 // String str\n 4: invokestatic #233 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: new #30 // class java/util/ArrayList\n 10: dup\n 11: invokespecial #70 // Method java/util/ArrayList.\"<init>\":()V\n 14: checkcast #55 // class java/util/List\n 17: astore_1\n 18: iconst_0\n 19: istore_2\n 20: iload_2\n 21: aload_0\n 22: invokevirtual #112 // Method java/lang/String.length:()I\n 25: if_icmpge 275\n 28: aload_0\n 29: iload_2\n 30: invokevirtual #304 // Method java/lang/String.charAt:(I)C\n 33: bipush 91\n 35: if_icmpne 92\n 38: aload_0\n 39: iload_2\n 40: aload_0\n 41: invokevirtual #112 // Method java/lang/String.length:()I\n 44: invokevirtual #116 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 47: dup\n 48: ldc #118 // String substring(...)\n 50: invokestatic #124 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 53: invokestatic #307 // Method getValidCloseBracket:(Ljava/lang/String;)I\n 56: istore_3\n 57: aload_1\n 58: aload_0\n 59: iload_2\n 60: iconst_1\n 61: iadd\n 62: iload_2\n 63: iload_3\n 64: iadd\n 65: invokevirtual #116 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 68: dup\n 69: ldc #118 // String substring(...)\n 71: invokestatic #124 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 74: invokestatic #128 // Method parseList:(Ljava/lang/String;)Ljava/util/List;\n 77: invokeinterface #129, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 82: pop\n 83: iload_2\n 84: iload_3\n 85: iadd\n 86: iconst_1\n 87: iadd\n 88: istore_2\n 89: goto 20\n 92: iconst_2\n 93: anewarray #309 // class java/lang/Character\n 96: astore_3\n 97: aload_3\n 98: iconst_0\n 99: bipush 44\n 101: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 104: aastore\n 105: aload_3\n 106: iconst_1\n 107: bipush 93\n 109: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 112: aastore\n 113: aload_3\n 114: invokestatic #315 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 117: aload_0\n 118: iload_2\n 119: invokevirtual #304 // Method java/lang/String.charAt:(I)C\n 122: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 125: invokeinterface #318, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 130: ifeq 141\n 133: iload_2\n 134: iinc 2, 1\n 137: pop\n 138: goto 20\n 141: aload_0\n 142: iload_2\n 143: invokevirtual #304 // Method java/lang/String.charAt:(I)C\n 146: invokestatic #321 // Method java/lang/String.valueOf:(C)Ljava/lang/String;\n 149: astore_3\n 150: iload_2\n 151: istore 4\n 153: aload_0\n 154: invokevirtual #112 // Method java/lang/String.length:()I\n 157: iload 4\n 159: iconst_1\n 160: iadd\n 161: if_icmple 253\n 164: iconst_3\n 165: anewarray #309 // class java/lang/Character\n 168: astore 5\n 170: aload 5\n 172: iconst_0\n 173: bipush 91\n 175: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 178: aastore\n 179: aload 5\n 181: iconst_1\n 182: bipush 93\n 184: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 187: aastore\n 188: aload 5\n 190: iconst_2\n 191: bipush 44\n 193: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 196: aastore\n 197: aload 5\n 199: invokestatic #315 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 202: aload_0\n 203: iload 4\n 205: iconst_1\n 206: iadd\n 207: invokevirtual #304 // Method java/lang/String.charAt:(I)C\n 210: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 213: invokeinterface #318, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 218: ifne 253\n 221: new #75 // class java/lang/StringBuilder\n 224: dup\n 225: invokespecial #76 // Method java/lang/StringBuilder.\"<init>\":()V\n 228: aload_3\n 229: invokevirtual #82 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 232: aload_0\n 233: iload 4\n 235: iconst_1\n 236: iadd\n 237: invokevirtual #304 // Method java/lang/String.charAt:(I)C\n 240: invokevirtual #324 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 243: invokevirtual #91 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 246: astore_3\n 247: iinc 4, 1\n 250: goto 153\n 253: aload_1\n 254: aload_3\n 255: invokestatic #261 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 258: invokestatic #149 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 261: invokeinterface #129, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 266: pop\n 267: iload_2\n 268: iinc 2, 1\n 271: pop\n 272: goto 20\n 275: aload_1\n 276: areturn\n\n public static final int getValidCloseBracket(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc_w #300 // String str\n 4: invokestatic #233 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aconst_null\n 8: astore_1\n 9: new #30 // class java/util/ArrayList\n 12: dup\n 13: invokespecial #70 // Method java/util/ArrayList.\"<init>\":()V\n 16: checkcast #55 // class java/util/List\n 19: astore_1\n 20: aload_0\n 21: checkcast #333 // class java/lang/CharSequence\n 24: invokestatic #337 // Method kotlin/text/StringsKt.toMutableList:(Ljava/lang/CharSequence;)Ljava/util/List;\n 27: checkcast #22 // class java/lang/Iterable\n 30: astore_2\n 31: iconst_0\n 32: istore_3\n 33: iconst_0\n 34: istore 4\n 36: aload_2\n 37: invokeinterface #43, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 42: astore 5\n 44: aload 5\n 46: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 51: ifeq 178\n 54: aload 5\n 56: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 6\n 63: iload 4\n 65: iinc 4, 1\n 68: istore 7\n 70: iload 7\n 72: ifge 78\n 75: invokestatic #73 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 78: iload 7\n 80: aload 6\n 82: checkcast #309 // class java/lang/Character\n 85: invokevirtual #341 // Method java/lang/Character.charValue:()C\n 88: istore 8\n 90: istore 9\n 92: iconst_0\n 93: istore 10\n 95: iload 8\n 97: tableswitch { // 91 to 93\n 91: 124\n 92: 173\n 93: 139\n default: 173\n }\n 124: aload_1\n 125: bipush 91\n 127: invokestatic #312 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 130: invokeinterface #129, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 135: pop\n 136: goto 173\n 139: aload_1\n 140: invokestatic #345 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 143: checkcast #309 // class java/lang/Character\n 146: invokevirtual #341 // Method java/lang/Character.charValue:()C\n 149: bipush 91\n 151: if_icmpne 161\n 154: aload_1\n 155: invokeinterface #348, 1 // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;\n 160: pop\n 161: aload_1\n 162: invokeinterface #237, 1 // InterfaceMethod java/util/List.size:()I\n 167: ifne 173\n 170: iload 9\n 172: ireturn\n 173: nop\n 174: nop\n 175: goto 44\n 178: nop\n 179: iconst_m1\n 180: ireturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #355 // Method main:()V\n 3: return\n\n private static final int main$lambda$2(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: ldc_w #359 // String a\n 4: invokestatic #233 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_1\n 8: ldc_w #361 // String b\n 11: invokestatic #233 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_0\n 15: invokestatic #289 // Method kotlin/jvm/internal/TypeIntrinsics.asMutableList:(Ljava/lang/Object;)Ljava/util/List;\n 18: aload_1\n 19: invokestatic #289 // Method kotlin/jvm/internal/TypeIntrinsics.asMutableList:(Ljava/lang/Object;)Ljava/util/List;\n 22: iconst_0\n 23: invokestatic #143 // Method compare:(Ljava/util/List;Ljava/util/List;I)I\n 26: ireturn\n}\n", "javap_err": "" } ]
joshpierce__advent-of-code-22__fd5414c/src/Day03.kt
import java.io.File fun main() { // read the lines from the file var lines: List<String> = File("Day03.txt").readLines() // sum up the total of all priorities var total: Int = lines.map { // Find the priority by intersecting the two lists of items to get the common item // and then running our itemNumber function var priority: Int = it.substring(0, it.length / 2).toCharArray().toList() .intersect(it.substring(it.length / 2).toCharArray().toList()) .elementAt(0).itemNumber() // Return the priority return@map priority }.toMutableList().sum() // Solution to Part 1 println("The total is: " + total.toString()) // Create an Int Array for the total number of groups of elves val groups = IntArray((lines.size / 3)) { it } // Sum up the total of the matching items across each group val sum = groups.map { // Figure out the base index for the group val base = it * 3 // Find the priority by intersecting all three lists of items from the elves return@map lines[base].toCharArray().toList() .intersect(lines[base + 1].toCharArray().toList()) .intersect(lines[base + 2].toCharArray().toList()) .elementAt(0).itemNumber() }.sum() // Solution to Part 2 println("The total of the badge priorities is: " + sum.toString()) } // This extension function finds the index of the Character inside the alphabet fun Char.itemNumber(): Int { val items = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" return items.indexOf(this) + 1 }
[ { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day03Kt.class", "javap": "Compiled from \"Day03.kt\"\npublic final class Day03Kt {\n public static final void main();\n Code:\n 0: aconst_null\n 1: astore_0\n 2: new #8 // class java/io/File\n 5: dup\n 6: ldc #10 // String Day03.txt\n 8: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 11: aconst_null\n 12: iconst_1\n 13: aconst_null\n 14: invokestatic #20 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 17: astore_0\n 18: aload_0\n 19: checkcast #22 // class java/lang/Iterable\n 22: astore_2\n 23: iconst_0\n 24: istore_3\n 25: aload_2\n 26: astore 4\n 28: new #24 // class java/util/ArrayList\n 31: dup\n 32: aload_2\n 33: bipush 10\n 35: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 38: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 41: checkcast #35 // class java/util/Collection\n 44: astore 5\n 46: iconst_0\n 47: istore 6\n 49: aload 4\n 51: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 56: astore 7\n 58: aload 7\n 60: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 65: ifeq 198\n 68: aload 7\n 70: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 75: astore 8\n 77: aload 5\n 79: aload 8\n 81: checkcast #51 // class java/lang/String\n 84: astore 9\n 86: astore 15\n 88: iconst_0\n 89: istore 10\n 91: nop\n 92: aload 9\n 94: iconst_0\n 95: aload 9\n 97: invokevirtual #55 // Method java/lang/String.length:()I\n 100: iconst_2\n 101: idiv\n 102: invokevirtual #59 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 105: dup\n 106: ldc #61 // String substring(...)\n 108: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 111: invokevirtual #71 // Method java/lang/String.toCharArray:()[C\n 114: dup\n 115: ldc #73 // String toCharArray(...)\n 117: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 120: invokestatic #79 // Method kotlin/collections/ArraysKt.toList:([C)Ljava/util/List;\n 123: checkcast #22 // class java/lang/Iterable\n 126: nop\n 127: aload 9\n 129: aload 9\n 131: invokevirtual #55 // Method java/lang/String.length:()I\n 134: iconst_2\n 135: idiv\n 136: invokevirtual #82 // Method java/lang/String.substring:(I)Ljava/lang/String;\n 139: dup\n 140: ldc #61 // String substring(...)\n 142: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 145: invokevirtual #71 // Method java/lang/String.toCharArray:()[C\n 148: dup\n 149: ldc #73 // String toCharArray(...)\n 151: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 154: invokestatic #79 // Method kotlin/collections/ArraysKt.toList:([C)Ljava/util/List;\n 157: checkcast #22 // class java/lang/Iterable\n 160: invokestatic #86 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 163: checkcast #22 // class java/lang/Iterable\n 166: iconst_0\n 167: invokestatic #90 // Method kotlin/collections/CollectionsKt.elementAt:(Ljava/lang/Iterable;I)Ljava/lang/Object;\n 170: checkcast #92 // class java/lang/Character\n 173: invokevirtual #96 // Method java/lang/Character.charValue:()C\n 176: invokestatic #100 // Method itemNumber:(C)I\n 179: istore 11\n 181: iload 11\n 183: invokestatic #106 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 186: aload 15\n 188: swap\n 189: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 194: pop\n 195: goto 58\n 198: aload 5\n 200: checkcast #112 // class java/util/List\n 203: nop\n 204: checkcast #35 // class java/util/Collection\n 207: invokestatic #116 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 210: checkcast #22 // class java/lang/Iterable\n 213: invokestatic #120 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 216: istore_1\n 217: new #122 // class java/lang/StringBuilder\n 220: dup\n 221: invokespecial #124 // Method java/lang/StringBuilder.\"<init>\":()V\n 224: ldc #126 // String The total is:\n 226: invokevirtual #130 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 229: iload_1\n 230: invokevirtual #133 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 233: invokevirtual #137 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 236: getstatic #143 // Field java/lang/System.out:Ljava/io/PrintStream;\n 239: swap\n 240: invokevirtual #149 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 243: iconst_0\n 244: istore_3\n 245: aload_0\n 246: invokeinterface #152, 1 // InterfaceMethod java/util/List.size:()I\n 251: iconst_3\n 252: idiv\n 253: istore 4\n 255: iload 4\n 257: newarray int\n 259: astore 5\n 261: iload_3\n 262: iload 4\n 264: if_icmpge 283\n 267: iload_3\n 268: istore 6\n 270: aload 5\n 272: iload 6\n 274: iload 6\n 276: iastore\n 277: iinc 3, 1\n 280: goto 261\n 283: aload 5\n 285: astore_2\n 286: aload_2\n 287: astore 4\n 289: iconst_0\n 290: istore 5\n 292: aload 4\n 294: astore 6\n 296: new #24 // class java/util/ArrayList\n 299: dup\n 300: aload 4\n 302: arraylength\n 303: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 306: checkcast #35 // class java/util/Collection\n 309: astore 7\n 311: iconst_0\n 312: istore 8\n 314: iconst_0\n 315: istore 9\n 317: aload 6\n 319: arraylength\n 320: istore 10\n 322: iload 9\n 324: iload 10\n 326: if_icmpge 479\n 329: aload 6\n 331: iload 9\n 333: iaload\n 334: istore 11\n 336: aload 7\n 338: iload 11\n 340: istore 12\n 342: astore 15\n 344: iconst_0\n 345: istore 13\n 347: iload 12\n 349: iconst_3\n 350: imul\n 351: istore 14\n 353: aload_0\n 354: iload 14\n 356: invokeinterface #156, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 361: checkcast #51 // class java/lang/String\n 364: invokevirtual #71 // Method java/lang/String.toCharArray:()[C\n 367: dup\n 368: ldc #73 // String toCharArray(...)\n 370: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 373: invokestatic #79 // Method kotlin/collections/ArraysKt.toList:([C)Ljava/util/List;\n 376: checkcast #22 // class java/lang/Iterable\n 379: aload_0\n 380: iload 14\n 382: iconst_1\n 383: iadd\n 384: invokeinterface #156, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 389: checkcast #51 // class java/lang/String\n 392: invokevirtual #71 // Method java/lang/String.toCharArray:()[C\n 395: dup\n 396: ldc #73 // String toCharArray(...)\n 398: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 401: invokestatic #79 // Method kotlin/collections/ArraysKt.toList:([C)Ljava/util/List;\n 404: checkcast #22 // class java/lang/Iterable\n 407: invokestatic #86 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 410: checkcast #22 // class java/lang/Iterable\n 413: aload_0\n 414: iload 14\n 416: iconst_2\n 417: iadd\n 418: invokeinterface #156, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 423: checkcast #51 // class java/lang/String\n 426: invokevirtual #71 // Method java/lang/String.toCharArray:()[C\n 429: dup\n 430: ldc #73 // String toCharArray(...)\n 432: invokestatic #67 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 435: invokestatic #79 // Method kotlin/collections/ArraysKt.toList:([C)Ljava/util/List;\n 438: checkcast #22 // class java/lang/Iterable\n 441: invokestatic #86 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 444: checkcast #22 // class java/lang/Iterable\n 447: iconst_0\n 448: invokestatic #90 // Method kotlin/collections/CollectionsKt.elementAt:(Ljava/lang/Iterable;I)Ljava/lang/Object;\n 451: checkcast #92 // class java/lang/Character\n 454: invokevirtual #96 // Method java/lang/Character.charValue:()C\n 457: invokestatic #100 // Method itemNumber:(C)I\n 460: nop\n 461: invokestatic #106 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 464: aload 15\n 466: swap\n 467: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 472: pop\n 473: iinc 9, 1\n 476: goto 322\n 479: aload 7\n 481: checkcast #112 // class java/util/List\n 484: nop\n 485: checkcast #22 // class java/lang/Iterable\n 488: invokestatic #120 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 491: istore_3\n 492: new #122 // class java/lang/StringBuilder\n 495: dup\n 496: invokespecial #124 // Method java/lang/StringBuilder.\"<init>\":()V\n 499: ldc #158 // String The total of the badge priorities is:\n 501: invokevirtual #130 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 504: iload_3\n 505: invokevirtual #133 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 508: invokevirtual #137 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 511: getstatic #143 // Field java/lang/System.out:Ljava/io/PrintStream;\n 514: swap\n 515: invokevirtual #149 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 518: return\n\n public static final int itemNumber(char);\n Code:\n 0: ldc #182 // String abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n 2: astore_1\n 3: aload_1\n 4: checkcast #184 // class java/lang/CharSequence\n 7: iload_0\n 8: iconst_0\n 9: iconst_0\n 10: bipush 6\n 12: aconst_null\n 13: invokestatic #190 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;CIZILjava/lang/Object;)I\n 16: iconst_1\n 17: iadd\n 18: ireturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #196 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
joshpierce__advent-of-code-22__fd5414c/src/Day02.kt
import java.io.File fun main() { // read the lines from the file var lines: List<String> = File("Day02.txt").readLines() // setup a new list of Games so we can calculate the outcome of each var games: MutableList<Game> = lines.map { var parts = it.split(" ") return@map Game(parts[0].translateRPS(), parts[1].translateRPS()) }.toMutableList() // calculate the outcome of each game, and sum the scores println("The sum of the score of all games is: " + games.sumOf { it.score() }.toString()) // setup a new list of Games so we can calculate the outcome of each based on the new rules in part 2 var gamesNew: MutableList<Game> = lines.map { var parts = it.split(" ") var oppPick = parts[0].translateRPS() var myPick: String // Calculate a Loss if (parts[1] == "X") { myPick = when (oppPick) { "Rock" -> "Scissors" "Paper" -> "Rock" "Scissors" -> "Paper" else -> throw Exception ("Invalid Opponent Pick") } } // Calculate a Draw else if (parts[1] == "Y") { myPick = oppPick } // Calculate a Win else { myPick = when (oppPick) { "Rock" -> "Paper" "Paper" -> "Scissors" "Scissors" -> "Rock" else -> throw Exception ("Invalid Opponent Pick") } } return@map Game(parts[0].translateRPS(), myPick) }.toMutableList() // calculate the outcome of each game, and sum the scores println("The sum of the score of all games with the new rules is: " + gamesNew.sumOf { it.score() }.toString()) } class Game(oppPick: String, yourPick: String) { var oppPick: String = oppPick var yourPick: String = yourPick } fun Game.score(): Int { var currScore: Int = when (this.yourPick) { "Rock" -> 1 "Paper" -> 2 "Scissors" -> 3 else -> throw Exception("Invalid RPS") } if (this.oppPick == this.yourPick) { currScore += 3 } else if (this.oppPick == "Rock" && this.yourPick == "Paper" || this.oppPick == "Paper" && this.yourPick == "Scissors" || this.oppPick == "Scissors" && this.yourPick == "Rock") { currScore += 6 } else { currScore += 0 } return currScore } fun String.translateRPS(): String { return when (this) { "A", "X" -> "Rock" "B", "Y" -> "Paper" "C", "Z" -> "Scissors" else -> throw Exception("Invalid RPS") } }
[ { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day02Kt.class", "javap": "Compiled from \"Day02.kt\"\npublic final class Day02Kt {\n public static final void main();\n Code:\n 0: new #8 // class java/io/File\n 3: dup\n 4: ldc #10 // String Day02.txt\n 6: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: aconst_null\n 10: iconst_1\n 11: aconst_null\n 12: invokestatic #20 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 15: astore_0\n 16: aload_0\n 17: checkcast #22 // class java/lang/Iterable\n 20: astore_2\n 21: iconst_0\n 22: istore_3\n 23: aload_2\n 24: astore 4\n 26: new #24 // class java/util/ArrayList\n 29: dup\n 30: aload_2\n 31: bipush 10\n 33: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 36: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 39: checkcast #35 // class java/util/Collection\n 42: astore 5\n 44: iconst_0\n 45: istore 6\n 47: aload 4\n 49: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 54: astore 7\n 56: aload 7\n 58: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 63: ifeq 165\n 66: aload 7\n 68: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 73: astore 8\n 75: aload 5\n 77: aload 8\n 79: checkcast #51 // class java/lang/String\n 82: astore 9\n 84: astore 16\n 86: iconst_0\n 87: istore 10\n 89: aload 9\n 91: checkcast #53 // class java/lang/CharSequence\n 94: iconst_1\n 95: anewarray #51 // class java/lang/String\n 98: astore 11\n 100: aload 11\n 102: iconst_0\n 103: ldc #55 // String\n 105: aastore\n 106: aload 11\n 108: iconst_0\n 109: iconst_0\n 110: bipush 6\n 112: aconst_null\n 113: invokestatic #61 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 116: astore 12\n 118: new #63 // class Game\n 121: dup\n 122: aload 12\n 124: iconst_0\n 125: invokeinterface #69, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 130: checkcast #51 // class java/lang/String\n 133: invokestatic #73 // Method translateRPS:(Ljava/lang/String;)Ljava/lang/String;\n 136: aload 12\n 138: iconst_1\n 139: invokeinterface #69, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 144: checkcast #51 // class java/lang/String\n 147: invokestatic #73 // Method translateRPS:(Ljava/lang/String;)Ljava/lang/String;\n 150: invokespecial #76 // Method Game.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 153: aload 16\n 155: swap\n 156: invokeinterface #80, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 161: pop\n 162: goto 56\n 165: aload 5\n 167: checkcast #65 // class java/util/List\n 170: nop\n 171: checkcast #35 // class java/util/Collection\n 174: invokestatic #84 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 177: astore_1\n 178: new #86 // class java/lang/StringBuilder\n 181: dup\n 182: invokespecial #88 // Method java/lang/StringBuilder.\"<init>\":()V\n 185: ldc #90 // String The sum of the score of all games is:\n 187: invokevirtual #94 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 190: aload_1\n 191: checkcast #22 // class java/lang/Iterable\n 194: astore_2\n 195: astore 16\n 197: iconst_0\n 198: istore_3\n 199: aload_2\n 200: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 205: astore 4\n 207: aload 4\n 209: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 214: ifeq 255\n 217: aload 4\n 219: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 224: astore 5\n 226: iload_3\n 227: aload 5\n 229: checkcast #63 // class Game\n 232: astore 6\n 234: istore 17\n 236: iconst_0\n 237: istore 7\n 239: aload 6\n 241: invokestatic #98 // Method score:(LGame;)I\n 244: istore 18\n 246: iload 17\n 248: iload 18\n 250: iadd\n 251: istore_3\n 252: goto 207\n 255: iload_3\n 256: istore 17\n 258: aload 16\n 260: iload 17\n 262: invokevirtual #101 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 265: invokevirtual #105 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 268: getstatic #111 // Field java/lang/System.out:Ljava/io/PrintStream;\n 271: swap\n 272: invokevirtual #117 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 275: aload_0\n 276: checkcast #22 // class java/lang/Iterable\n 279: astore_3\n 280: iconst_0\n 281: istore 4\n 283: aload_3\n 284: astore 5\n 286: new #24 // class java/util/ArrayList\n 289: dup\n 290: aload_3\n 291: bipush 10\n 293: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 296: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 299: checkcast #35 // class java/util/Collection\n 302: astore 6\n 304: iconst_0\n 305: istore 7\n 307: aload 5\n 309: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 314: astore 8\n 316: aload 8\n 318: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 323: ifeq 693\n 326: aload 8\n 328: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 333: astore 9\n 335: aload 6\n 337: aload 9\n 339: checkcast #51 // class java/lang/String\n 342: astore 10\n 344: astore 16\n 346: iconst_0\n 347: istore 11\n 349: aload 10\n 351: checkcast #53 // class java/lang/CharSequence\n 354: iconst_1\n 355: anewarray #51 // class java/lang/String\n 358: astore 12\n 360: aload 12\n 362: iconst_0\n 363: ldc #55 // String\n 365: aastore\n 366: aload 12\n 368: iconst_0\n 369: iconst_0\n 370: bipush 6\n 372: aconst_null\n 373: invokestatic #61 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 376: astore 13\n 378: aload 13\n 380: iconst_0\n 381: invokeinterface #69, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 386: checkcast #51 // class java/lang/String\n 389: invokestatic #73 // Method translateRPS:(Ljava/lang/String;)Ljava/lang/String;\n 392: astore 12\n 394: aconst_null\n 395: astore 14\n 397: aload 13\n 399: iconst_1\n 400: invokeinterface #69, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 405: ldc #119 // String X\n 407: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 410: ifeq 525\n 413: aload 12\n 415: astore 15\n 417: aload 15\n 419: invokevirtual #129 // Method java/lang/String.hashCode:()I\n 422: lookupswitch { // 3\n -591277001: 469\n 2552709: 456\n 76882284: 482\n default: 510\n }\n 456: aload 15\n 458: ldc #131 // String Rock\n 460: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 463: ifne 495\n 466: goto 510\n 469: aload 15\n 471: ldc #136 // String Scissors\n 473: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 476: ifne 505\n 479: goto 510\n 482: aload 15\n 484: ldc #138 // String Paper\n 486: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 489: ifne 500\n 492: goto 510\n 495: ldc #136 // String Scissors\n 497: goto 520\n 500: ldc #131 // String Rock\n 502: goto 520\n 505: ldc #138 // String Paper\n 507: goto 520\n 510: new #140 // class java/lang/Exception\n 513: dup\n 514: ldc #142 // String Invalid Opponent Pick\n 516: invokespecial #143 // Method java/lang/Exception.\"<init>\":(Ljava/lang/String;)V\n 519: athrow\n 520: astore 14\n 522: goto 658\n 525: aload 13\n 527: iconst_1\n 528: invokeinterface #69, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 533: ldc #145 // String Y\n 535: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 538: ifeq 548\n 541: aload 12\n 543: astore 14\n 545: goto 658\n 548: aload 12\n 550: astore 15\n 552: aload 15\n 554: invokevirtual #129 // Method java/lang/String.hashCode:()I\n 557: lookupswitch { // 3\n -591277001: 605\n 2552709: 592\n 76882284: 618\n default: 646\n }\n 592: aload 15\n 594: ldc #131 // String Rock\n 596: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 599: ifne 631\n 602: goto 646\n 605: aload 15\n 607: ldc #136 // String Scissors\n 609: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 612: ifne 641\n 615: goto 646\n 618: aload 15\n 620: ldc #138 // String Paper\n 622: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 625: ifne 636\n 628: goto 646\n 631: ldc #138 // String Paper\n 633: goto 656\n 636: ldc #136 // String Scissors\n 638: goto 656\n 641: ldc #131 // String Rock\n 643: goto 656\n 646: new #140 // class java/lang/Exception\n 649: dup\n 650: ldc #142 // String Invalid Opponent Pick\n 652: invokespecial #143 // Method java/lang/Exception.\"<init>\":(Ljava/lang/String;)V\n 655: athrow\n 656: astore 14\n 658: new #63 // class Game\n 661: dup\n 662: aload 13\n 664: iconst_0\n 665: invokeinterface #69, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 670: checkcast #51 // class java/lang/String\n 673: invokestatic #73 // Method translateRPS:(Ljava/lang/String;)Ljava/lang/String;\n 676: aload 14\n 678: invokespecial #76 // Method Game.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 681: aload 16\n 683: swap\n 684: invokeinterface #80, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 689: pop\n 690: goto 316\n 693: aload 6\n 695: checkcast #65 // class java/util/List\n 698: nop\n 699: checkcast #35 // class java/util/Collection\n 702: invokestatic #84 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;\n 705: astore_2\n 706: new #86 // class java/lang/StringBuilder\n 709: dup\n 710: invokespecial #88 // Method java/lang/StringBuilder.\"<init>\":()V\n 713: ldc #147 // String The sum of the score of all games with the new rules is:\n 715: invokevirtual #94 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 718: aload_2\n 719: checkcast #22 // class java/lang/Iterable\n 722: astore_3\n 723: astore 16\n 725: iconst_0\n 726: istore 4\n 728: aload_3\n 729: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 734: astore 5\n 736: aload 5\n 738: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 743: ifeq 786\n 746: aload 5\n 748: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 753: astore 6\n 755: iload 4\n 757: aload 6\n 759: checkcast #63 // class Game\n 762: astore 7\n 764: istore 17\n 766: iconst_0\n 767: istore 8\n 769: aload 7\n 771: invokestatic #98 // Method score:(LGame;)I\n 774: istore 18\n 776: iload 17\n 778: iload 18\n 780: iadd\n 781: istore 4\n 783: goto 736\n 786: iload 4\n 788: istore 17\n 790: aload 16\n 792: iload 17\n 794: invokevirtual #101 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 797: invokevirtual #105 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 800: getstatic #111 // Field java/lang/System.out:Ljava/io/PrintStream;\n 803: swap\n 804: invokevirtual #117 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 807: return\n\n public static final int score(Game);\n Code:\n 0: aload_0\n 1: ldc #174 // String <this>\n 3: invokestatic #178 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #181 // Method Game.getYourPick:()Ljava/lang/String;\n 10: astore_2\n 11: aload_2\n 12: invokevirtual #129 // Method java/lang/String.hashCode:()I\n 15: lookupswitch { // 3\n -591277001: 60\n 2552709: 48\n 76882284: 72\n default: 96\n }\n 48: aload_2\n 49: ldc #131 // String Rock\n 51: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 54: ifne 84\n 57: goto 96\n 60: aload_2\n 61: ldc #136 // String Scissors\n 63: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 66: ifne 92\n 69: goto 96\n 72: aload_2\n 73: ldc #138 // String Paper\n 75: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 78: ifne 88\n 81: goto 96\n 84: iconst_1\n 85: goto 106\n 88: iconst_2\n 89: goto 106\n 92: iconst_3\n 93: goto 106\n 96: new #140 // class java/lang/Exception\n 99: dup\n 100: ldc #183 // String Invalid RPS\n 102: invokespecial #143 // Method java/lang/Exception.\"<init>\":(Ljava/lang/String;)V\n 105: athrow\n 106: istore_1\n 107: aload_0\n 108: invokevirtual #186 // Method Game.getOppPick:()Ljava/lang/String;\n 111: aload_0\n 112: invokevirtual #181 // Method Game.getYourPick:()Ljava/lang/String;\n 115: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 118: ifeq 127\n 121: iinc 1, 3\n 124: goto 208\n 127: aload_0\n 128: invokevirtual #186 // Method Game.getOppPick:()Ljava/lang/String;\n 131: ldc #131 // String Rock\n 133: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 136: ifeq 151\n 139: aload_0\n 140: invokevirtual #181 // Method Game.getYourPick:()Ljava/lang/String;\n 143: ldc #138 // String Paper\n 145: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 148: ifne 199\n 151: aload_0\n 152: invokevirtual #186 // Method Game.getOppPick:()Ljava/lang/String;\n 155: ldc #138 // String Paper\n 157: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 160: ifeq 175\n 163: aload_0\n 164: invokevirtual #181 // Method Game.getYourPick:()Ljava/lang/String;\n 167: ldc #136 // String Scissors\n 169: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 172: ifne 199\n 175: aload_0\n 176: invokevirtual #186 // Method Game.getOppPick:()Ljava/lang/String;\n 179: ldc #136 // String Scissors\n 181: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 184: ifeq 205\n 187: aload_0\n 188: invokevirtual #181 // Method Game.getYourPick:()Ljava/lang/String;\n 191: ldc #131 // String Rock\n 193: invokestatic #125 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 196: ifeq 205\n 199: iinc 1, 6\n 202: goto 208\n 205: iinc 1, 0\n 208: iload_1\n 209: ireturn\n\n public static final java.lang.String translateRPS(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #174 // String <this>\n 3: invokestatic #178 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: astore_1\n 8: aload_1\n 9: invokevirtual #129 // Method java/lang/String.hashCode:()I\n 12: lookupswitch { // 6\n 65: 72\n 66: 84\n 67: 96\n 88: 108\n 89: 120\n 90: 132\n default: 159\n }\n 72: aload_1\n 73: ldc #190 // String A\n 75: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 78: ifne 144\n 81: goto 159\n 84: aload_1\n 85: ldc #192 // String B\n 87: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 90: ifne 149\n 93: goto 159\n 96: aload_1\n 97: ldc #194 // String C\n 99: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 102: ifne 154\n 105: goto 159\n 108: aload_1\n 109: ldc #119 // String X\n 111: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 114: ifne 144\n 117: goto 159\n 120: aload_1\n 121: ldc #145 // String Y\n 123: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 126: ifne 149\n 129: goto 159\n 132: aload_1\n 133: ldc #196 // String Z\n 135: invokevirtual #134 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 138: ifne 154\n 141: goto 159\n 144: ldc #131 // String Rock\n 146: goto 169\n 149: ldc #138 // String Paper\n 151: goto 169\n 154: ldc #136 // String Scissors\n 156: goto 169\n 159: new #140 // class java/lang/Exception\n 162: dup\n 163: ldc #183 // String Invalid RPS\n 165: invokespecial #143 // Method java/lang/Exception.\"<init>\":(Ljava/lang/String;)V\n 168: athrow\n 169: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #200 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
joshpierce__advent-of-code-22__fd5414c/src/Day08.kt
import java.io.File fun main() { var lines: List<String> = File("Day08.txt").readLines() // Setup our Forest List of Lists var forest = lines.map { it.chunked(1) } // Variable for Tracking Tree Score in Part Two var maxTreeScore = 0 // Prints out your forest for you to see //forest.forEach { it.forEach { print(it+" ") }; println() } // Iterate Our Forest Rows var visibleForest = forest.mapIndexed { idx, row -> // Iterate Our Forest Columns row.mapIndexed row@ { idx2, tree -> // Get All Trees Above, Below, Left, and Right of Current Tree var treesLeft = forest[idx].subList(0, idx2).reversed() var treesRight = forest[idx].subList(idx2+1, forest[idx].size) var treesAbove = forest.subList(0, idx).map { it[idx2] }.reversed() var treesBelow = forest.subList(idx+1, forest.size).map { it[idx2] } // For Part Two, we need to know how many trees are visible from each tree var visibleTreesLeft = treesLeft.takeWhileInclusive { it < tree }.count() var visibleTreesRight = treesRight.takeWhileInclusive { it < tree }.count() var visibleTreesAbove = treesAbove.takeWhileInclusive { it < tree }.count() var visibleTreesBelow = treesBelow.takeWhileInclusive { it < tree }.count() //println("Tree: $idx, $idx2 -> $visibleTreesLeft, $visibleTreesRight, $visibleTreesAbove, $visibleTreesBelow") // For Part Two Calculate The Tree Score and see if it's the new Max Tree Score var treeScore = visibleTreesLeft * visibleTreesRight * visibleTreesAbove * visibleTreesBelow if (treeScore > maxTreeScore) { //println("Tree: $idx, $idx2 -> $treeScore [Current Max Tree Score]") maxTreeScore = treeScore } else { //println("Tree: $idx, $idx2 -> $treeScore") } // If this is an edge tree, it's visible if (idx == 0 || idx2 == 0 || idx == forest.size - 1 || idx2 == row.size - 1) { //println("Edge: $idx, $idx2") return@row 1 } else { // If this is not an edge tree, check if it's visible from one of the edges if (tree > treesLeft.sortedDescending()[0] || tree > treesRight.sortedDescending()[0] || tree > treesAbove.sortedDescending()[0] || tree > treesBelow.sortedDescending()[0]) { //println("Not Edge: $idx, $idx2 -> Visible") return@row 1 } else { //println("Not Edge: $idx, $idx2 -> Not Visible") return@row 0 } } } } // Print out the Visible Forest //visibleForest.forEach { it.forEach { print(it.toString() + " ") }; println() } // Display the Total Visible Trees and Max Tree Score println("Total Visible Trees: " + visibleForest.map { it.sum() }.sum().toString()) println("Max Tree Score: " + maxTreeScore.toString()) } // Added this function which I found here: https://stackoverflow.com/questions/56058246/takewhile-which-includes-the-actual-value-matching-the-predicate-takewhileinclu // The existing TakeWhile in Kotlin doesn't include the value that matches the predicate, which is what we need for this problem. fun <T> List<T>.takeWhileInclusive(predicate: (T) -> Boolean) = sequence { with(iterator()) { while (hasNext()) { val next = next() yield(next) if (!predicate(next)) break } } }
[ { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day08Kt.class", "javap": "Compiled from \"Day08.kt\"\npublic final class Day08Kt {\n public static final void main();\n Code:\n 0: new #8 // class java/io/File\n 3: dup\n 4: ldc #10 // String Day08.txt\n 6: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: aconst_null\n 10: iconst_1\n 11: aconst_null\n 12: invokestatic #20 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 15: astore_0\n 16: aconst_null\n 17: astore_1\n 18: aload_0\n 19: checkcast #22 // class java/lang/Iterable\n 22: astore_2\n 23: iconst_0\n 24: istore_3\n 25: aload_2\n 26: astore 4\n 28: new #24 // class java/util/ArrayList\n 31: dup\n 32: aload_2\n 33: bipush 10\n 35: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 38: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 41: checkcast #35 // class java/util/Collection\n 44: astore 5\n 46: iconst_0\n 47: istore 6\n 49: aload 4\n 51: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 56: astore 7\n 58: aload 7\n 60: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 65: ifeq 112\n 68: aload 7\n 70: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 75: astore 8\n 77: aload 5\n 79: aload 8\n 81: checkcast #51 // class java/lang/String\n 84: astore 9\n 86: astore 44\n 88: iconst_0\n 89: istore 10\n 91: aload 9\n 93: checkcast #53 // class java/lang/CharSequence\n 96: iconst_1\n 97: invokestatic #59 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;\n 100: aload 44\n 102: swap\n 103: invokeinterface #63, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 108: pop\n 109: goto 58\n 112: aload 5\n 114: checkcast #65 // class java/util/List\n 117: nop\n 118: astore_1\n 119: iconst_0\n 120: istore_2\n 121: aload_1\n 122: checkcast #22 // class java/lang/Iterable\n 125: astore 4\n 127: iconst_0\n 128: istore 5\n 130: aload 4\n 132: astore 6\n 134: new #24 // class java/util/ArrayList\n 137: dup\n 138: aload 4\n 140: bipush 10\n 142: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 145: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 148: checkcast #35 // class java/util/Collection\n 151: astore 7\n 153: iconst_0\n 154: istore 8\n 156: iconst_0\n 157: istore 9\n 159: aload 6\n 161: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 166: astore 10\n 168: aload 10\n 170: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 175: ifeq 902\n 178: aload 10\n 180: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 185: astore 11\n 187: aload 7\n 189: iload 9\n 191: iinc 9, 1\n 194: istore 12\n 196: iload 12\n 198: ifge 204\n 201: invokestatic #68 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 204: iload 12\n 206: aload 11\n 208: checkcast #65 // class java/util/List\n 211: astore 13\n 213: istore 14\n 215: astore 43\n 217: iconst_0\n 218: istore 15\n 220: aload 13\n 222: checkcast #22 // class java/lang/Iterable\n 225: astore 16\n 227: iconst_0\n 228: istore 17\n 230: aload 16\n 232: astore 18\n 234: new #24 // class java/util/ArrayList\n 237: dup\n 238: aload 16\n 240: bipush 10\n 242: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 245: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 248: checkcast #35 // class java/util/Collection\n 251: astore 19\n 253: iconst_0\n 254: istore 20\n 256: iconst_0\n 257: istore 21\n 259: aload 18\n 261: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 266: astore 22\n 268: aload 22\n 270: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 275: ifeq 883\n 278: aload 22\n 280: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 285: astore 23\n 287: aload 19\n 289: iload 21\n 291: iinc 21, 1\n 294: istore 24\n 296: iload 24\n 298: ifge 304\n 301: invokestatic #68 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 304: iload 24\n 306: aload 23\n 308: checkcast #51 // class java/lang/String\n 311: astore 25\n 313: istore 26\n 315: astore 27\n 317: iconst_0\n 318: istore 28\n 320: aload_1\n 321: iload 14\n 323: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 328: checkcast #65 // class java/util/List\n 331: iconst_0\n 332: iload 26\n 334: invokeinterface #76, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 339: checkcast #22 // class java/lang/Iterable\n 342: invokestatic #80 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;\n 345: astore 29\n 347: aload_1\n 348: iload 14\n 350: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 355: checkcast #65 // class java/util/List\n 358: iload 26\n 360: iconst_1\n 361: iadd\n 362: aload_1\n 363: iload 14\n 365: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 370: checkcast #65 // class java/util/List\n 373: invokeinterface #84, 1 // InterfaceMethod java/util/List.size:()I\n 378: invokeinterface #76, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 383: astore 30\n 385: aload_1\n 386: iconst_0\n 387: iload 14\n 389: invokeinterface #76, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 394: checkcast #22 // class java/lang/Iterable\n 397: astore 31\n 399: iconst_0\n 400: istore 32\n 402: aload 31\n 404: astore 33\n 406: new #24 // class java/util/ArrayList\n 409: dup\n 410: aload 31\n 412: bipush 10\n 414: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 417: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 420: checkcast #35 // class java/util/Collection\n 423: astore 34\n 425: iconst_0\n 426: istore 35\n 428: aload 33\n 430: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 435: astore 36\n 437: aload 36\n 439: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 444: ifeq 494\n 447: aload 36\n 449: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 454: astore 37\n 456: aload 34\n 458: aload 37\n 460: checkcast #65 // class java/util/List\n 463: astore 38\n 465: astore 39\n 467: iconst_0\n 468: istore 40\n 470: aload 38\n 472: iload 26\n 474: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 479: checkcast #51 // class java/lang/String\n 482: aload 39\n 484: swap\n 485: invokeinterface #63, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 490: pop\n 491: goto 437\n 494: aload 34\n 496: checkcast #65 // class java/util/List\n 499: nop\n 500: checkcast #22 // class java/lang/Iterable\n 503: invokestatic #80 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;\n 506: astore 41\n 508: aload_1\n 509: iload 14\n 511: iconst_1\n 512: iadd\n 513: aload_1\n 514: invokeinterface #84, 1 // InterfaceMethod java/util/List.size:()I\n 519: invokeinterface #76, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 524: checkcast #22 // class java/lang/Iterable\n 527: astore 32\n 529: iconst_0\n 530: istore 33\n 532: aload 32\n 534: astore 34\n 536: new #24 // class java/util/ArrayList\n 539: dup\n 540: aload 32\n 542: bipush 10\n 544: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 547: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 550: checkcast #35 // class java/util/Collection\n 553: astore 35\n 555: iconst_0\n 556: istore 36\n 558: aload 34\n 560: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 565: astore 37\n 567: aload 37\n 569: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 574: ifeq 624\n 577: aload 37\n 579: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 584: astore 38\n 586: aload 35\n 588: aload 38\n 590: checkcast #65 // class java/util/List\n 593: astore 40\n 595: astore 39\n 597: iconst_0\n 598: istore 42\n 600: aload 40\n 602: iload 26\n 604: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 609: checkcast #51 // class java/lang/String\n 612: aload 39\n 614: swap\n 615: invokeinterface #63, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 620: pop\n 621: goto 567\n 624: aload 35\n 626: checkcast #65 // class java/util/List\n 629: nop\n 630: astore 31\n 632: aload 29\n 634: aload 25\n 636: invokedynamic #104, 0 // InvokeDynamic #0:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;\n 641: invokestatic #108 // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 644: invokestatic #114 // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I\n 647: istore 32\n 649: aload 30\n 651: aload 25\n 653: invokedynamic #119, 0 // InvokeDynamic #1:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;\n 658: invokestatic #108 // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 661: invokestatic #114 // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I\n 664: istore 33\n 666: aload 41\n 668: aload 25\n 670: invokedynamic #124, 0 // InvokeDynamic #2:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;\n 675: invokestatic #108 // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 678: invokestatic #114 // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I\n 681: istore 34\n 683: aload 31\n 685: aload 25\n 687: invokedynamic #129, 0 // InvokeDynamic #3:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;\n 692: invokestatic #108 // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;\n 695: invokestatic #114 // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I\n 698: istore 35\n 700: iload 32\n 702: iload 33\n 704: imul\n 705: iload 34\n 707: imul\n 708: iload 35\n 710: imul\n 711: istore 36\n 713: iload 36\n 715: iload_2\n 716: if_icmple 722\n 719: iload 36\n 721: istore_2\n 722: iload 14\n 724: ifeq 759\n 727: iload 26\n 729: ifeq 759\n 732: iload 14\n 734: aload_1\n 735: invokeinterface #84, 1 // InterfaceMethod java/util/List.size:()I\n 740: iconst_1\n 741: isub\n 742: if_icmpeq 759\n 745: iload 26\n 747: aload 13\n 749: invokeinterface #84, 1 // InterfaceMethod java/util/List.size:()I\n 754: iconst_1\n 755: isub\n 756: if_icmpne 763\n 759: iconst_1\n 760: goto 868\n 763: aload 25\n 765: aload 29\n 767: checkcast #22 // class java/lang/Iterable\n 770: invokestatic #132 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 773: iconst_0\n 774: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 779: checkcast #51 // class java/lang/String\n 782: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 785: ifgt 863\n 788: aload 25\n 790: aload 30\n 792: checkcast #22 // class java/lang/Iterable\n 795: invokestatic #132 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 798: iconst_0\n 799: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 804: checkcast #51 // class java/lang/String\n 807: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 810: ifgt 863\n 813: aload 25\n 815: aload 41\n 817: checkcast #22 // class java/lang/Iterable\n 820: invokestatic #132 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 823: iconst_0\n 824: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 829: checkcast #51 // class java/lang/String\n 832: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 835: ifgt 863\n 838: aload 25\n 840: aload 31\n 842: checkcast #22 // class java/lang/Iterable\n 845: invokestatic #132 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 848: iconst_0\n 849: invokeinterface #72, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 854: checkcast #51 // class java/lang/String\n 857: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 860: ifle 867\n 863: iconst_1\n 864: goto 868\n 867: iconst_0\n 868: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 871: aload 27\n 873: swap\n 874: invokeinterface #63, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 879: pop\n 880: goto 268\n 883: aload 19\n 885: checkcast #65 // class java/util/List\n 888: nop\n 889: nop\n 890: aload 43\n 892: swap\n 893: invokeinterface #63, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 898: pop\n 899: goto 168\n 902: aload 7\n 904: checkcast #65 // class java/util/List\n 907: nop\n 908: astore_3\n 909: new #144 // class java/lang/StringBuilder\n 912: dup\n 913: invokespecial #146 // Method java/lang/StringBuilder.\"<init>\":()V\n 916: ldc #148 // String Total Visible Trees:\n 918: invokevirtual #152 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 921: aload_3\n 922: checkcast #22 // class java/lang/Iterable\n 925: astore 4\n 927: astore 43\n 929: iconst_0\n 930: istore 5\n 932: aload 4\n 934: astore 6\n 936: new #24 // class java/util/ArrayList\n 939: dup\n 940: aload 4\n 942: bipush 10\n 944: invokestatic #30 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 947: invokespecial #33 // Method java/util/ArrayList.\"<init>\":(I)V\n 950: checkcast #35 // class java/util/Collection\n 953: astore 7\n 955: iconst_0\n 956: istore 8\n 958: aload 6\n 960: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 965: astore 9\n 967: aload 9\n 969: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 974: ifeq 1023\n 977: aload 9\n 979: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 984: astore 10\n 986: aload 7\n 988: aload 10\n 990: checkcast #65 // class java/util/List\n 993: astore 11\n 995: astore 44\n 997: iconst_0\n 998: istore 12\n 1000: aload 11\n 1002: checkcast #22 // class java/lang/Iterable\n 1005: invokestatic #156 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 1008: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1011: aload 44\n 1013: swap\n 1014: invokeinterface #63, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1019: pop\n 1020: goto 967\n 1023: aload 7\n 1025: checkcast #65 // class java/util/List\n 1028: nop\n 1029: aload 43\n 1031: swap\n 1032: checkcast #22 // class java/lang/Iterable\n 1035: invokestatic #156 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 1038: invokevirtual #159 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1041: invokevirtual #163 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1044: getstatic #169 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1047: swap\n 1048: invokevirtual #175 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1051: new #144 // class java/lang/StringBuilder\n 1054: dup\n 1055: invokespecial #146 // Method java/lang/StringBuilder.\"<init>\":()V\n 1058: ldc #177 // String Max Tree Score:\n 1060: invokevirtual #152 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 1063: iload_2\n 1064: invokevirtual #159 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 1067: invokevirtual #163 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 1070: getstatic #169 // Field java/lang/System.out:Ljava/io/PrintStream;\n 1073: swap\n 1074: invokevirtual #175 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 1077: return\n\n public static final <T> kotlin.sequences.Sequence<T> takeWhileInclusive(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: ldc #222 // String <this>\n 3: invokestatic #228 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #230 // String predicate\n 9: invokestatic #228 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #232 // class Day08Kt$takeWhileInclusive$1\n 15: dup\n 16: aload_0\n 17: aload_1\n 18: aconst_null\n 19: invokespecial #235 // Method Day08Kt$takeWhileInclusive$1.\"<init>\":(Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)V\n 22: checkcast #237 // class kotlin/jvm/functions/Function2\n 25: invokestatic #241 // Method kotlin/sequences/SequencesKt.sequence:(Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;\n 28: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #246 // Method main:()V\n 3: return\n\n private static final boolean main$lambda$8$lambda$7$lambda$3(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #249 // String it\n 3: invokestatic #228 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: aload_0\n 8: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 11: ifge 18\n 14: iconst_1\n 15: goto 19\n 18: iconst_0\n 19: ireturn\n\n private static final boolean main$lambda$8$lambda$7$lambda$4(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #249 // String it\n 3: invokestatic #228 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: aload_0\n 8: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 11: ifge 18\n 14: iconst_1\n 15: goto 19\n 18: iconst_0\n 19: ireturn\n\n private static final boolean main$lambda$8$lambda$7$lambda$5(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #249 // String it\n 3: invokestatic #228 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: aload_0\n 8: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 11: ifge 18\n 14: iconst_1\n 15: goto 19\n 18: iconst_0\n 19: ireturn\n\n private static final boolean main$lambda$8$lambda$7$lambda$6(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #249 // String it\n 3: invokestatic #228 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: aload_0\n 8: invokevirtual #136 // Method java/lang/String.compareTo:(Ljava/lang/String;)I\n 11: ifge 18\n 14: iconst_1\n 15: goto 19\n 18: iconst_0\n 19: ireturn\n}\n", "javap_err": "" }, { "class_path": "joshpierce__advent-of-code-22__fd5414c/Day08Kt$takeWhileInclusive$1.class", "javap": "Compiled from \"Day08.kt\"\nfinal class Day08Kt$takeWhileInclusive$1 extends kotlin.coroutines.jvm.internal.RestrictedSuspendLambda implements kotlin.jvm.functions.Function2<kotlin.sequences.SequenceScope<? super T>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {\n java.lang.Object L$1;\n\n java.lang.Object L$2;\n\n java.lang.Object L$3;\n\n int label;\n\n private java.lang.Object L$0;\n\n final java.util.List<T> $this_takeWhileInclusive;\n\n final kotlin.jvm.functions.Function1<T, java.lang.Boolean> $predicate;\n\n Day08Kt$takeWhileInclusive$1(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>, kotlin.coroutines.Continuation<? super Day08Kt$takeWhileInclusive$1>);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #14 // Field $this_takeWhileInclusive:Ljava/util/List;\n 5: aload_0\n 6: aload_2\n 7: putfield #18 // Field $predicate:Lkotlin/jvm/functions/Function1;\n 10: aload_0\n 11: iconst_2\n 12: aload_3\n 13: invokespecial #21 // Method kotlin/coroutines/jvm/internal/RestrictedSuspendLambda.\"<init>\":(ILkotlin/coroutines/Continuation;)V\n 16: return\n\n public final java.lang.Object invokeSuspend(java.lang.Object);\n Code:\n 0: invokestatic #53 // Method kotlin/coroutines/intrinsics/IntrinsicsKt.getCOROUTINE_SUSPENDED:()Ljava/lang/Object;\n 3: astore 8\n 5: aload_0\n 6: getfield #57 // Field label:I\n 9: tableswitch { // 0 to 1\n 0: 32\n 1: 129\n default: 197\n }\n 32: aload_1\n 33: invokestatic #63 // Method kotlin/ResultKt.throwOnFailure:(Ljava/lang/Object;)V\n 36: aload_0\n 37: getfield #65 // Field L$0:Ljava/lang/Object;\n 40: checkcast #67 // class kotlin/sequences/SequenceScope\n 43: astore_2\n 44: aload_0\n 45: getfield #14 // Field $this_takeWhileInclusive:Ljava/util/List;\n 48: invokeinterface #73, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 53: astore_3\n 54: aload_0\n 55: getfield #18 // Field $predicate:Lkotlin/jvm/functions/Function1;\n 58: astore 4\n 60: aload_3\n 61: astore 5\n 63: iconst_0\n 64: istore 6\n 66: aload 5\n 68: invokeinterface #79, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 73: ifeq 191\n 76: aload 5\n 78: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 83: astore 7\n 85: aload_2\n 86: aload 7\n 88: aload_0\n 89: aload_0\n 90: aload_2\n 91: putfield #65 // Field L$0:Ljava/lang/Object;\n 94: aload_0\n 95: aload 4\n 97: putfield #83 // Field L$1:Ljava/lang/Object;\n 100: aload_0\n 101: aload 5\n 103: putfield #85 // Field L$2:Ljava/lang/Object;\n 106: aload_0\n 107: aload 7\n 109: putfield #87 // Field L$3:Ljava/lang/Object;\n 112: aload_0\n 113: iconst_1\n 114: putfield #57 // Field label:I\n 117: invokevirtual #91 // Method kotlin/sequences/SequenceScope.yield:(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\n 120: dup\n 121: aload 8\n 123: if_acmpne 169\n 126: aload 8\n 128: areturn\n 129: iconst_0\n 130: istore 6\n 132: aload_0\n 133: getfield #87 // Field L$3:Ljava/lang/Object;\n 136: astore 7\n 138: aload_0\n 139: getfield #85 // Field L$2:Ljava/lang/Object;\n 142: checkcast #75 // class java/util/Iterator\n 145: astore 5\n 147: aload_0\n 148: getfield #83 // Field L$1:Ljava/lang/Object;\n 151: checkcast #93 // class kotlin/jvm/functions/Function1\n 154: astore 4\n 156: aload_0\n 157: getfield #65 // Field L$0:Ljava/lang/Object;\n 160: checkcast #67 // class kotlin/sequences/SequenceScope\n 163: astore_2\n 164: aload_1\n 165: invokestatic #63 // Method kotlin/ResultKt.throwOnFailure:(Ljava/lang/Object;)V\n 168: aload_1\n 169: pop\n 170: aload 4\n 172: aload 7\n 174: invokeinterface #96, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 179: checkcast #98 // class java/lang/Boolean\n 182: invokevirtual #101 // Method java/lang/Boolean.booleanValue:()Z\n 185: ifne 66\n 188: goto 191\n 191: nop\n 192: nop\n 193: getstatic #107 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 196: areturn\n 197: new #109 // class java/lang/IllegalStateException\n 200: dup\n 201: ldc #111 // String call to \\'resume\\' before \\'invoke\\' with coroutine\n 203: invokespecial #114 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 206: athrow\n\n public final kotlin.coroutines.Continuation<kotlin.Unit> create(java.lang.Object, kotlin.coroutines.Continuation<?>);\n Code:\n 0: new #2 // class Day08Kt$takeWhileInclusive$1\n 3: dup\n 4: aload_0\n 5: getfield #14 // Field $this_takeWhileInclusive:Ljava/util/List;\n 8: aload_0\n 9: getfield #18 // Field $predicate:Lkotlin/jvm/functions/Function1;\n 12: aload_2\n 13: invokespecial #125 // Method \"<init>\":(Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)V\n 16: astore_3\n 17: aload_3\n 18: aload_1\n 19: putfield #65 // Field L$0:Ljava/lang/Object;\n 22: aload_3\n 23: checkcast #127 // class kotlin/coroutines/Continuation\n 26: areturn\n\n public final java.lang.Object invoke(kotlin.sequences.SequenceScope<? super T>, kotlin.coroutines.Continuation<? super kotlin.Unit>);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokevirtual #132 // Method create:(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;\n 6: checkcast #2 // class Day08Kt$takeWhileInclusive$1\n 9: getstatic #107 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 12: invokevirtual #134 // Method invokeSuspend:(Ljava/lang/Object;)Ljava/lang/Object;\n 15: areturn\n\n public java.lang.Object invoke(java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #67 // class kotlin/sequences/SequenceScope\n 5: aload_2\n 6: checkcast #127 // class kotlin/coroutines/Continuation\n 9: invokevirtual #139 // Method invoke:(Lkotlin/sequences/SequenceScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\n 12: areturn\n}\n", "javap_err": "" } ]
ArtyomKopan__Formal_Languages__7aa1075/Практика 1/Coding/src/main/kotlin/Main.kt
import java.nio.file.Files import java.nio.file.Path fun coding(grammar: List<String>): Map<String, Int> { val codes = mutableMapOf( ":" to 1, "(" to 2, ")" to 3, "." to 4, "*" to 5, ";" to 6, "," to 7, "#" to 8, "[" to 9, "]" to 10, "Eofgram" to 1000 ) var terminalNumber = 51 var nonterminalNumber = 11 var semanticNumber = 101 // кодируем нетерминалы for (command in grammar) { if (command == "Eofgram") break val nonterm = command.split(" : ")[0] if (nonterminalNumber <= 50) codes[nonterm] = nonterminalNumber++ else break } // кодируем терминалы и семантики for (command in grammar) { if ("Eofgram" in command) break // кодируем семантики val semantics = command .split(" ") .filter { it.matches(Regex("\\$[a-z]+[0-9]*")) } for (semantic in semantics) { if (semanticNumber >= 1000) { break } if (semantic !in codes.keys) { codes[semantic] = semanticNumber++ } } // кодируем нетерминалы, обозначенные заглавными буквами val nonterminals = command .split(" ") .filter { it.matches(Regex("[A-Z]+")) } for (nonterminal in nonterminals) { if (nonterminalNumber > 50) { break } if (nonterminal !in codes.keys) { codes[nonterminal] = nonterminalNumber++ } } // кодируем терминалы val rightPartCommand = command.split(" : ")[1] val terminals = rightPartCommand .split(" ") .filter { it.matches(Regex("'.+'")) || it.matches(Regex("[a-z]+")) } for (terminal in terminals) { if (terminalNumber > 100) { break } if (terminal !in codes.keys) { codes[terminal] = terminalNumber++ } } } val trash = mutableListOf<String>() for (k in codes) { if ("Eofgram" in k.key && k.value != 1000) trash.add(k.key) } codes.filterKeys { it == "" || " " in it || it in trash } return codes } fun main() { println("Введите путь к файлу с описанием грамматики: ") val pathToInputFile = readlnOrNull() ?: "../expression.txt" val grammarDescription = Files .readString(Path.of(pathToInputFile)) .split(" .") .map { it.trim() } val codes = coding(grammarDescription) codes.forEach { (t, u) -> println("$t $u") } for (line in grammarDescription) { if ("Eofgram" in line) { println(1000) break } var buffer = "" val encodedLine = mutableListOf<Int>() for (ch in line) { if (buffer in codes.keys) { encodedLine.add(codes[buffer] ?: -1) buffer = "" } else if (ch != ' ' && ch != '\n' && ch != '\t') { buffer += ch } } if (buffer in codes.keys) { encodedLine.add(codes[buffer] ?: -1) } encodedLine.forEach { print("$it, ") } println(codes["."]) } }
[ { "class_path": "ArtyomKopan__Formal_Languages__7aa1075/MainKt.class", "javap": "Compiled from \"Main.kt\"\npublic final class MainKt {\n public static final java.util.Map<java.lang.String, java.lang.Integer> coding(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #10 // String grammar\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: bipush 11\n 8: anewarray #18 // class kotlin/Pair\n 11: astore_2\n 12: aload_2\n 13: iconst_0\n 14: ldc #20 // String :\n 16: iconst_1\n 17: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 20: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 23: aastore\n 24: aload_2\n 25: iconst_1\n 26: ldc #34 // String (\n 28: iconst_2\n 29: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 32: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 35: aastore\n 36: aload_2\n 37: iconst_2\n 38: ldc #36 // String )\n 40: iconst_3\n 41: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 44: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 47: aastore\n 48: aload_2\n 49: iconst_3\n 50: ldc #38 // String .\n 52: iconst_4\n 53: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 56: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 59: aastore\n 60: aload_2\n 61: iconst_4\n 62: ldc #40 // String *\n 64: iconst_5\n 65: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 68: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 71: aastore\n 72: aload_2\n 73: iconst_5\n 74: ldc #42 // String ;\n 76: bipush 6\n 78: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 81: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 84: aastore\n 85: aload_2\n 86: bipush 6\n 88: ldc #44 // String ,\n 90: bipush 7\n 92: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 95: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 98: aastore\n 99: aload_2\n 100: bipush 7\n 102: ldc #46 // String #\n 104: bipush 8\n 106: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 109: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 112: aastore\n 113: aload_2\n 114: bipush 8\n 116: ldc #48 // String [\n 118: bipush 9\n 120: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 123: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 126: aastore\n 127: aload_2\n 128: bipush 9\n 130: ldc #50 // String ]\n 132: bipush 10\n 134: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 137: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 140: aastore\n 141: aload_2\n 142: bipush 10\n 144: ldc #52 // String Eofgram\n 146: sipush 1000\n 149: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 152: invokestatic #32 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 155: aastore\n 156: aload_2\n 157: invokestatic #58 // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 160: astore_1\n 161: bipush 51\n 163: istore_2\n 164: bipush 11\n 166: istore_3\n 167: bipush 101\n 169: istore 4\n 171: aload_0\n 172: invokeinterface #64, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 177: astore 5\n 179: aload 5\n 181: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 186: ifeq 280\n 189: aload 5\n 191: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 196: checkcast #76 // class java/lang/String\n 199: astore 6\n 201: aload 6\n 203: ldc #52 // String Eofgram\n 205: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 208: ifeq 214\n 211: goto 280\n 214: aload 6\n 216: checkcast #82 // class java/lang/CharSequence\n 219: iconst_1\n 220: anewarray #76 // class java/lang/String\n 223: astore 8\n 225: aload 8\n 227: iconst_0\n 228: ldc #84 // String :\n 230: aastore\n 231: aload 8\n 233: iconst_0\n 234: iconst_0\n 235: bipush 6\n 237: aconst_null\n 238: invokestatic #90 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 241: iconst_0\n 242: invokeinterface #94, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 247: checkcast #76 // class java/lang/String\n 250: astore 7\n 252: iload_3\n 253: bipush 50\n 255: if_icmpgt 277\n 258: aload_1\n 259: aload 7\n 261: iload_3\n 262: iinc 3, 1\n 265: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 268: invokeinterface #100, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 273: pop\n 274: goto 179\n 277: goto 280\n 280: aload_0\n 281: invokeinterface #64, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 286: astore 5\n 288: aload 5\n 290: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 295: ifeq 1046\n 298: aload 5\n 300: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 305: checkcast #76 // class java/lang/String\n 308: astore 6\n 310: aload 6\n 312: checkcast #82 // class java/lang/CharSequence\n 315: ldc #52 // String Eofgram\n 317: checkcast #82 // class java/lang/CharSequence\n 320: iconst_0\n 321: iconst_2\n 322: aconst_null\n 323: invokestatic #104 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z\n 326: ifeq 332\n 329: goto 1046\n 332: aload 6\n 334: checkcast #82 // class java/lang/CharSequence\n 337: iconst_1\n 338: anewarray #76 // class java/lang/String\n 341: astore 8\n 343: aload 8\n 345: iconst_0\n 346: ldc #106 // String\n 348: aastore\n 349: aload 8\n 351: iconst_0\n 352: iconst_0\n 353: bipush 6\n 355: aconst_null\n 356: invokestatic #90 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 359: checkcast #108 // class java/lang/Iterable\n 362: astore 8\n 364: nop\n 365: iconst_0\n 366: istore 9\n 368: aload 8\n 370: astore 10\n 372: new #110 // class java/util/ArrayList\n 375: dup\n 376: invokespecial #114 // Method java/util/ArrayList.\"<init>\":()V\n 379: checkcast #116 // class java/util/Collection\n 382: astore 11\n 384: iconst_0\n 385: istore 12\n 387: aload 10\n 389: invokeinterface #117, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 394: astore 13\n 396: aload 13\n 398: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 403: ifeq 463\n 406: aload 13\n 408: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 413: astore 14\n 415: aload 14\n 417: checkcast #76 // class java/lang/String\n 420: astore 15\n 422: iconst_0\n 423: istore 16\n 425: aload 15\n 427: checkcast #82 // class java/lang/CharSequence\n 430: astore 17\n 432: new #119 // class kotlin/text/Regex\n 435: dup\n 436: ldc #121 // String \\\\$[a-z]+[0-9]*\n 438: invokespecial #124 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 441: aload 17\n 443: invokevirtual #128 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 446: nop\n 447: ifeq 396\n 450: aload 11\n 452: aload 14\n 454: invokeinterface #132, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 459: pop\n 460: goto 396\n 463: aload 11\n 465: checkcast #60 // class java/util/List\n 468: nop\n 469: astore 7\n 471: aload 7\n 473: invokeinterface #64, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 478: astore 8\n 480: aload 8\n 482: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 487: ifeq 549\n 490: aload 8\n 492: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 497: checkcast #76 // class java/lang/String\n 500: astore 9\n 502: iload 4\n 504: sipush 1000\n 507: if_icmplt 513\n 510: goto 549\n 513: aload_1\n 514: invokeinterface #136, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 519: aload 9\n 521: invokeinterface #141, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 526: ifne 480\n 529: aload_1\n 530: aload 9\n 532: iload 4\n 534: iinc 4, 1\n 537: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 540: invokeinterface #100, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 545: pop\n 546: goto 480\n 549: aload 6\n 551: checkcast #82 // class java/lang/CharSequence\n 554: iconst_1\n 555: anewarray #76 // class java/lang/String\n 558: astore 9\n 560: aload 9\n 562: iconst_0\n 563: ldc #106 // String\n 565: aastore\n 566: aload 9\n 568: iconst_0\n 569: iconst_0\n 570: bipush 6\n 572: aconst_null\n 573: invokestatic #90 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 576: checkcast #108 // class java/lang/Iterable\n 579: astore 9\n 581: nop\n 582: iconst_0\n 583: istore 10\n 585: aload 9\n 587: astore 11\n 589: new #110 // class java/util/ArrayList\n 592: dup\n 593: invokespecial #114 // Method java/util/ArrayList.\"<init>\":()V\n 596: checkcast #116 // class java/util/Collection\n 599: astore 12\n 601: iconst_0\n 602: istore 13\n 604: aload 11\n 606: invokeinterface #117, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 611: astore 14\n 613: aload 14\n 615: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 620: ifeq 680\n 623: aload 14\n 625: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 630: astore 15\n 632: aload 15\n 634: checkcast #76 // class java/lang/String\n 637: astore 16\n 639: iconst_0\n 640: istore 17\n 642: aload 16\n 644: checkcast #82 // class java/lang/CharSequence\n 647: astore 18\n 649: new #119 // class kotlin/text/Regex\n 652: dup\n 653: ldc #143 // String [A-Z]+\n 655: invokespecial #124 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 658: aload 18\n 660: invokevirtual #128 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 663: nop\n 664: ifeq 613\n 667: aload 12\n 669: aload 15\n 671: invokeinterface #132, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 676: pop\n 677: goto 613\n 680: aload 12\n 682: checkcast #60 // class java/util/List\n 685: nop\n 686: astore 8\n 688: aload 8\n 690: invokeinterface #64, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 695: astore 9\n 697: aload 9\n 699: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 704: ifeq 763\n 707: aload 9\n 709: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 714: checkcast #76 // class java/lang/String\n 717: astore 10\n 719: iload_3\n 720: bipush 50\n 722: if_icmple 728\n 725: goto 763\n 728: aload_1\n 729: invokeinterface #136, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 734: aload 10\n 736: invokeinterface #141, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 741: ifne 697\n 744: aload_1\n 745: aload 10\n 747: iload_3\n 748: iinc 3, 1\n 751: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 754: invokeinterface #100, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 759: pop\n 760: goto 697\n 763: aload 6\n 765: checkcast #82 // class java/lang/CharSequence\n 768: iconst_1\n 769: anewarray #76 // class java/lang/String\n 772: astore 10\n 774: aload 10\n 776: iconst_0\n 777: ldc #84 // String :\n 779: aastore\n 780: aload 10\n 782: iconst_0\n 783: iconst_0\n 784: bipush 6\n 786: aconst_null\n 787: invokestatic #90 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 790: iconst_1\n 791: invokeinterface #94, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 796: checkcast #76 // class java/lang/String\n 799: astore 9\n 801: aload 9\n 803: checkcast #82 // class java/lang/CharSequence\n 806: iconst_1\n 807: anewarray #76 // class java/lang/String\n 810: astore 11\n 812: aload 11\n 814: iconst_0\n 815: ldc #106 // String\n 817: aastore\n 818: aload 11\n 820: iconst_0\n 821: iconst_0\n 822: bipush 6\n 824: aconst_null\n 825: invokestatic #90 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 828: checkcast #108 // class java/lang/Iterable\n 831: astore 11\n 833: nop\n 834: iconst_0\n 835: istore 12\n 837: aload 11\n 839: astore 13\n 841: new #110 // class java/util/ArrayList\n 844: dup\n 845: invokespecial #114 // Method java/util/ArrayList.\"<init>\":()V\n 848: checkcast #116 // class java/util/Collection\n 851: astore 14\n 853: iconst_0\n 854: istore 15\n 856: aload 13\n 858: invokeinterface #117, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 863: astore 16\n 865: aload 16\n 867: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 872: ifeq 963\n 875: aload 16\n 877: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 882: astore 17\n 884: aload 17\n 886: checkcast #76 // class java/lang/String\n 889: astore 18\n 891: iconst_0\n 892: istore 19\n 894: aload 18\n 896: checkcast #82 // class java/lang/CharSequence\n 899: astore 20\n 901: new #119 // class kotlin/text/Regex\n 904: dup\n 905: ldc #145 // String \\'.+\\'\n 907: invokespecial #124 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 910: aload 20\n 912: invokevirtual #128 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 915: ifne 942\n 918: aload 18\n 920: checkcast #82 // class java/lang/CharSequence\n 923: astore 20\n 925: new #119 // class kotlin/text/Regex\n 928: dup\n 929: ldc #147 // String [a-z]+\n 931: invokespecial #124 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 934: aload 20\n 936: invokevirtual #128 // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z\n 939: ifeq 946\n 942: iconst_1\n 943: goto 947\n 946: iconst_0\n 947: ifeq 865\n 950: aload 14\n 952: aload 17\n 954: invokeinterface #132, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 959: pop\n 960: goto 865\n 963: aload 14\n 965: checkcast #60 // class java/util/List\n 968: nop\n 969: astore 10\n 971: aload 10\n 973: invokeinterface #64, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 978: astore 11\n 980: aload 11\n 982: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 987: ifeq 288\n 990: aload 11\n 992: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 997: checkcast #76 // class java/lang/String\n 1000: astore 12\n 1002: iload_2\n 1003: bipush 100\n 1005: if_icmple 1011\n 1008: goto 288\n 1011: aload_1\n 1012: invokeinterface #136, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 1017: aload 12\n 1019: invokeinterface #141, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1024: ifne 980\n 1027: aload_1\n 1028: aload 12\n 1030: iload_2\n 1031: iinc 2, 1\n 1034: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1037: invokeinterface #100, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1042: pop\n 1043: goto 980\n 1046: new #110 // class java/util/ArrayList\n 1049: dup\n 1050: invokespecial #114 // Method java/util/ArrayList.\"<init>\":()V\n 1053: checkcast #60 // class java/util/List\n 1056: astore 5\n 1058: aload_1\n 1059: invokeinterface #150, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 1064: invokeinterface #151, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 1069: astore 6\n 1071: aload 6\n 1073: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1078: ifeq 1154\n 1081: aload 6\n 1083: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1088: checkcast #153 // class java/util/Map$Entry\n 1091: astore 7\n 1093: aload 7\n 1095: invokeinterface #156, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 1100: checkcast #82 // class java/lang/CharSequence\n 1103: ldc #52 // String Eofgram\n 1105: checkcast #82 // class java/lang/CharSequence\n 1108: iconst_0\n 1109: iconst_2\n 1110: aconst_null\n 1111: invokestatic #104 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z\n 1114: ifeq 1071\n 1117: aload 7\n 1119: invokeinterface #159, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 1124: checkcast #161 // class java/lang/Number\n 1127: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 1130: sipush 1000\n 1133: if_icmpeq 1071\n 1136: aload 5\n 1138: aload 7\n 1140: invokeinterface #156, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 1145: invokeinterface #166, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 1150: pop\n 1151: goto 1071\n 1154: aload_1\n 1155: astore 6\n 1157: iconst_0\n 1158: istore 7\n 1160: new #168 // class java/util/LinkedHashMap\n 1163: dup\n 1164: invokespecial #169 // Method java/util/LinkedHashMap.\"<init>\":()V\n 1167: astore 8\n 1169: aload 6\n 1171: invokeinterface #150, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 1176: invokeinterface #151, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 1181: astore 9\n 1183: aload 9\n 1185: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1190: ifeq 1292\n 1193: aload 9\n 1195: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1200: checkcast #153 // class java/util/Map$Entry\n 1203: astore 10\n 1205: aload 10\n 1207: invokeinterface #156, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 1212: checkcast #76 // class java/lang/String\n 1215: astore 11\n 1217: iconst_0\n 1218: istore 12\n 1220: aload 11\n 1222: ldc #171 // String\n 1224: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 1227: ifne 1261\n 1230: aload 11\n 1232: checkcast #82 // class java/lang/CharSequence\n 1235: ldc #106 // String\n 1237: checkcast #82 // class java/lang/CharSequence\n 1240: iconst_0\n 1241: iconst_2\n 1242: aconst_null\n 1243: invokestatic #104 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z\n 1246: ifne 1261\n 1249: aload 5\n 1251: aload 11\n 1253: invokeinterface #172, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 1258: ifeq 1265\n 1261: iconst_1\n 1262: goto 1266\n 1265: iconst_0\n 1266: ifeq 1183\n 1269: aload 8\n 1271: aload 10\n 1273: invokeinterface #156, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 1278: aload 10\n 1280: invokeinterface #159, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 1285: invokevirtual #173 // Method java/util/LinkedHashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1288: pop\n 1289: goto 1183\n 1292: aload 8\n 1294: checkcast #96 // class java/util/Map\n 1297: pop\n 1298: aload_1\n 1299: areturn\n\n public static final void main();\n Code:\n 0: ldc #217 // String Введите путь к файлу с описанием грамматики:\n 2: getstatic #223 // Field java/lang/System.out:Ljava/io/PrintStream;\n 5: swap\n 6: invokevirtual #229 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 9: invokestatic #235 // Method kotlin/io/ConsoleKt.readlnOrNull:()Ljava/lang/String;\n 12: dup\n 13: ifnonnull 19\n 16: pop\n 17: ldc #237 // String ../expression.txt\n 19: astore_0\n 20: aload_0\n 21: iconst_0\n 22: anewarray #76 // class java/lang/String\n 25: invokestatic #243 // InterfaceMethod java/nio/file/Path.of:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;\n 28: invokestatic #249 // Method java/nio/file/Files.readString:(Ljava/nio/file/Path;)Ljava/lang/String;\n 31: dup\n 32: ldc #251 // String readString(...)\n 34: invokestatic #254 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 37: checkcast #82 // class java/lang/CharSequence\n 40: iconst_1\n 41: anewarray #76 // class java/lang/String\n 44: astore_2\n 45: aload_2\n 46: iconst_0\n 47: ldc_w #256 // String .\n 50: aastore\n 51: aload_2\n 52: iconst_0\n 53: iconst_0\n 54: bipush 6\n 56: aconst_null\n 57: invokestatic #90 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 60: checkcast #108 // class java/lang/Iterable\n 63: astore_2\n 64: nop\n 65: iconst_0\n 66: istore_3\n 67: aload_2\n 68: astore 4\n 70: new #110 // class java/util/ArrayList\n 73: dup\n 74: aload_2\n 75: bipush 10\n 77: invokestatic #262 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 80: invokespecial #265 // Method java/util/ArrayList.\"<init>\":(I)V\n 83: checkcast #116 // class java/util/Collection\n 86: astore 5\n 88: iconst_0\n 89: istore 6\n 91: aload 4\n 93: invokeinterface #117, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 98: astore 7\n 100: aload 7\n 102: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 107: ifeq 157\n 110: aload 7\n 112: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 117: astore 8\n 119: aload 5\n 121: aload 8\n 123: checkcast #76 // class java/lang/String\n 126: astore 9\n 128: astore 13\n 130: iconst_0\n 131: istore 10\n 133: aload 9\n 135: checkcast #82 // class java/lang/CharSequence\n 138: invokestatic #269 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 141: invokevirtual #272 // Method java/lang/Object.toString:()Ljava/lang/String;\n 144: nop\n 145: aload 13\n 147: swap\n 148: invokeinterface #132, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 153: pop\n 154: goto 100\n 157: aload 5\n 159: checkcast #60 // class java/util/List\n 162: nop\n 163: astore_1\n 164: aload_1\n 165: invokestatic #274 // Method coding:(Ljava/util/List;)Ljava/util/Map;\n 168: astore_2\n 169: aload_2\n 170: astore_3\n 171: iconst_0\n 172: istore 4\n 174: aload_3\n 175: invokeinterface #150, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 180: invokeinterface #151, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 185: astore 5\n 187: aload 5\n 189: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 194: ifeq 280\n 197: aload 5\n 199: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 204: checkcast #153 // class java/util/Map$Entry\n 207: astore 6\n 209: aload 6\n 211: astore 7\n 213: iconst_0\n 214: istore 8\n 216: aload 7\n 218: invokeinterface #156, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 223: checkcast #76 // class java/lang/String\n 226: astore 9\n 228: aload 7\n 230: invokeinterface #159, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 235: checkcast #161 // class java/lang/Number\n 238: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 241: istore 10\n 243: new #276 // class java/lang/StringBuilder\n 246: dup\n 247: invokespecial #277 // Method java/lang/StringBuilder.\"<init>\":()V\n 250: aload 9\n 252: invokevirtual #281 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 255: bipush 32\n 257: invokevirtual #284 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 260: iload 10\n 262: invokevirtual #287 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 265: invokevirtual #288 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 268: getstatic #223 // Field java/lang/System.out:Ljava/io/PrintStream;\n 271: swap\n 272: invokevirtual #229 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 275: nop\n 276: nop\n 277: goto 187\n 280: nop\n 281: aload_1\n 282: invokeinterface #64, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 287: astore_3\n 288: aload_3\n 289: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 294: ifeq 644\n 297: aload_3\n 298: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 303: checkcast #76 // class java/lang/String\n 306: astore 4\n 308: aload 4\n 310: checkcast #82 // class java/lang/CharSequence\n 313: ldc #52 // String Eofgram\n 315: checkcast #82 // class java/lang/CharSequence\n 318: iconst_0\n 319: iconst_2\n 320: aconst_null\n 321: invokestatic #104 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z\n 324: ifeq 343\n 327: sipush 1000\n 330: istore 5\n 332: getstatic #223 // Field java/lang/System.out:Ljava/io/PrintStream;\n 335: iload 5\n 337: invokevirtual #290 // Method java/io/PrintStream.println:(I)V\n 340: goto 644\n 343: ldc #171 // String\n 345: astore 5\n 347: new #110 // class java/util/ArrayList\n 350: dup\n 351: invokespecial #114 // Method java/util/ArrayList.\"<init>\":()V\n 354: checkcast #60 // class java/util/List\n 357: astore 6\n 359: iconst_0\n 360: istore 7\n 362: aload 4\n 364: invokevirtual #293 // Method java/lang/String.length:()I\n 367: istore 8\n 369: iload 7\n 371: iload 8\n 373: if_icmpge 491\n 376: aload 4\n 378: iload 7\n 380: invokevirtual #297 // Method java/lang/String.charAt:(I)C\n 383: istore 9\n 385: aload_2\n 386: invokeinterface #136, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 391: aload 5\n 393: invokeinterface #141, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 398: ifeq 442\n 401: aload 6\n 403: aload_2\n 404: aload 5\n 406: invokeinterface #300, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 411: checkcast #22 // class java/lang/Integer\n 414: dup\n 415: ifnull 424\n 418: invokevirtual #301 // Method java/lang/Integer.intValue:()I\n 421: goto 426\n 424: pop\n 425: iconst_m1\n 426: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 429: invokeinterface #166, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 434: pop\n 435: ldc #171 // String\n 437: astore 5\n 439: goto 485\n 442: iload 9\n 444: bipush 32\n 446: if_icmpeq 485\n 449: iload 9\n 451: bipush 10\n 453: if_icmpeq 485\n 456: iload 9\n 458: bipush 9\n 460: if_icmpeq 485\n 463: new #276 // class java/lang/StringBuilder\n 466: dup\n 467: invokespecial #277 // Method java/lang/StringBuilder.\"<init>\":()V\n 470: aload 5\n 472: invokevirtual #281 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 475: iload 9\n 477: invokevirtual #284 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 480: invokevirtual #288 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 483: astore 5\n 485: iinc 7, 1\n 488: goto 369\n 491: aload_2\n 492: invokeinterface #136, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 497: aload 5\n 499: invokeinterface #141, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 504: ifeq 541\n 507: aload 6\n 509: aload_2\n 510: aload 5\n 512: invokeinterface #300, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 517: checkcast #22 // class java/lang/Integer\n 520: dup\n 521: ifnull 530\n 524: invokevirtual #301 // Method java/lang/Integer.intValue:()I\n 527: goto 532\n 530: pop\n 531: iconst_m1\n 532: invokestatic #26 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 535: invokeinterface #166, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 540: pop\n 541: aload 6\n 543: checkcast #108 // class java/lang/Iterable\n 546: astore 7\n 548: iconst_0\n 549: istore 8\n 551: aload 7\n 553: invokeinterface #117, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 558: astore 9\n 560: aload 9\n 562: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 567: ifeq 625\n 570: aload 9\n 572: invokeinterface #74, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 577: astore 10\n 579: aload 10\n 581: checkcast #161 // class java/lang/Number\n 584: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 587: istore 11\n 589: iconst_0\n 590: istore 12\n 592: new #276 // class java/lang/StringBuilder\n 595: dup\n 596: invokespecial #277 // Method java/lang/StringBuilder.\"<init>\":()V\n 599: iload 11\n 601: invokevirtual #287 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 604: ldc_w #303 // String ,\n 607: invokevirtual #281 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 610: invokevirtual #288 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 613: getstatic #223 // Field java/lang/System.out:Ljava/io/PrintStream;\n 616: swap\n 617: invokevirtual #306 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V\n 620: nop\n 621: nop\n 622: goto 560\n 625: nop\n 626: aload_2\n 627: ldc #38 // String .\n 629: invokeinterface #300, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 634: getstatic #223 // Field java/lang/System.out:Ljava/io/PrintStream;\n 637: swap\n 638: invokevirtual #229 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 641: goto 288\n 644: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #329 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
alexaugustobr__kotlin-exercises__c70e56d/src/main/kotlin/exs/FunWithVowels.kt
val vowelList = listOf<Char>('a', 'e', 'i', 'o', 'u') fun main(args: Array<String>) { val vowel = readLine()!! //val vowel = "aeiouaeiouaeiouaaeeiioouu" println(longestSubsequence(vowel)) } fun longestSubsequence(searchVowel: String): Int { val chars = searchVowel.toCharArray() val lastIndex = chars.size var initialIndex = 0 var lastLongestSequence = 0; while (initialIndex < lastIndex) { var curretLongestSequence = 0 var currentVowelIndex = 0 for (index in initialIndex until lastIndex) { if(isVowel(chars[index])) { val isTheSameVowel = vowelList[currentVowelIndex] == chars[index] val isNextSequence = currentVowelIndex < vowelList.size - 1 && vowelList[currentVowelIndex+1] == chars[index] if (isTheSameVowel) { curretLongestSequence++ } else if (isNextSequence) { currentVowelIndex++ curretLongestSequence++ } } } initialIndex += 1 if (curretLongestSequence > lastLongestSequence) lastLongestSequence = curretLongestSequence } return lastLongestSequence } fun isVowel(c: Char): Boolean { return vowelList.contains(c) }
[ { "class_path": "alexaugustobr__kotlin-exercises__c70e56d/FunWithVowelsKt.class", "javap": "Compiled from \"FunWithVowels.kt\"\npublic final class FunWithVowelsKt {\n private static final java.util.List<java.lang.Character> vowelList;\n\n public static final java.util.List<java.lang.Character> getVowelList();\n Code:\n 0: getstatic #12 // Field vowelList:Ljava/util/List;\n 3: areturn\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #16 // String args\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: invokestatic #28 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;\n 9: dup\n 10: invokestatic #32 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 13: astore_1\n 14: aload_1\n 15: invokestatic #36 // Method longestSubsequence:(Ljava/lang/String;)I\n 18: istore_2\n 19: getstatic #42 // Field java/lang/System.out:Ljava/io/PrintStream;\n 22: iload_2\n 23: invokevirtual #48 // Method java/io/PrintStream.println:(I)V\n 26: return\n\n public static final int longestSubsequence(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #53 // String searchVowel\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #59 // Method java/lang/String.toCharArray:()[C\n 10: dup\n 11: ldc #61 // String toCharArray(...)\n 13: invokestatic #64 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 16: astore_1\n 17: aload_1\n 18: arraylength\n 19: istore_2\n 20: iconst_0\n 21: istore_3\n 22: iconst_0\n 23: istore 4\n 25: iload_3\n 26: iload_2\n 27: if_icmpge 177\n 30: iconst_0\n 31: istore 5\n 33: iconst_0\n 34: istore 6\n 36: iload_3\n 37: istore 7\n 39: iload 7\n 41: iload_2\n 42: if_icmpge 160\n 45: aload_1\n 46: iload 7\n 48: caload\n 49: invokestatic #68 // Method isVowel:(C)Z\n 52: ifeq 154\n 55: getstatic #12 // Field vowelList:Ljava/util/List;\n 58: iload 6\n 60: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 65: checkcast #76 // class java/lang/Character\n 68: invokevirtual #80 // Method java/lang/Character.charValue:()C\n 71: aload_1\n 72: iload 7\n 74: caload\n 75: if_icmpne 82\n 78: iconst_1\n 79: goto 83\n 82: iconst_0\n 83: istore 8\n 85: iload 6\n 87: getstatic #12 // Field vowelList:Ljava/util/List;\n 90: invokeinterface #84, 1 // InterfaceMethod java/util/List.size:()I\n 95: iconst_1\n 96: isub\n 97: if_icmpge 129\n 100: getstatic #12 // Field vowelList:Ljava/util/List;\n 103: iload 6\n 105: iconst_1\n 106: iadd\n 107: invokeinterface #74, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 112: checkcast #76 // class java/lang/Character\n 115: invokevirtual #80 // Method java/lang/Character.charValue:()C\n 118: aload_1\n 119: iload 7\n 121: caload\n 122: if_icmpne 129\n 125: iconst_1\n 126: goto 130\n 129: iconst_0\n 130: istore 9\n 132: iload 8\n 134: ifeq 143\n 137: iinc 5, 1\n 140: goto 154\n 143: iload 9\n 145: ifeq 154\n 148: iinc 6, 1\n 151: iinc 5, 1\n 154: iinc 7, 1\n 157: goto 39\n 160: iinc 3, 1\n 163: iload 5\n 165: iload 4\n 167: if_icmple 25\n 170: iload 5\n 172: istore 4\n 174: goto 25\n 177: iload 4\n 179: ireturn\n\n public static final boolean isVowel(char);\n Code:\n 0: getstatic #12 // Field vowelList:Ljava/util/List;\n 3: iload_0\n 4: invokestatic #101 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 7: invokeinterface #105, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 12: ireturn\n\n static {};\n Code:\n 0: iconst_5\n 1: anewarray #76 // class java/lang/Character\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: bipush 97\n 9: invokestatic #101 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 12: aastore\n 13: aload_0\n 14: iconst_1\n 15: bipush 101\n 17: invokestatic #101 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 20: aastore\n 21: aload_0\n 22: iconst_2\n 23: bipush 105\n 25: invokestatic #101 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 28: aastore\n 29: aload_0\n 30: iconst_3\n 31: bipush 111\n 33: invokestatic #101 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 36: aastore\n 37: aload_0\n 38: iconst_4\n 39: bipush 117\n 41: invokestatic #101 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 44: aastore\n 45: aload_0\n 46: invokestatic #115 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 49: putstatic #12 // Field vowelList:Ljava/util/List;\n 52: return\n}\n", "javap_err": "" } ]
Scholar17__aoc-2022-in-kotlin__d3d79fb/src/Day04.kt
import java.io.File fun main() { fun parseInputCommaAndNewLine(input: String): List<String> { return input.split(",", "\r\n") } fun parseInputDash(input: String): List<Int> { return input.split("-").map { str -> str.toInt() } } val fileName = "src/Day04_sample.txt" // "src/Day04_quiz.txt" val input = File(fileName).readText() val parseComma = parseInputCommaAndNewLine(input) val parseCommaList = parseComma.chunked(1) val parseDashList = mutableListOf<List<Int>>() for (aList in parseCommaList) { for (element in aList) { parseDashList.add(parseInputDash(element)) } } fun comparedList(input: List<Int>): List<Int> { val pairValue = mutableListOf<Int>() if (input.first() == input.last()) { pairValue.add(input.first()) } else if (input.first() < input.last()) { for (i in input.first() until input.last() + 1) { pairValue.add(i) } } return pairValue } val modifiedList = mutableListOf<List<Int>>() for (aList in parseDashList) { modifiedList.add(comparedList(aList)) } fun checkContain(input: List<List<Int>>): Boolean { var isContain = false for (i in input.indices - 1) { if (input[i].containsAll(input[i + 1])) { isContain = true } else if (input[i + 1].containsAll(input[i])) { isContain = true } } return isContain } fun checkOverlap(input: List<List<Int>>): Boolean { var isOverlap = false for (i in input.indices - 1) { if (input[i].intersect(input[i + 1].toSet()).isNotEmpty()) { isOverlap = true } } return isOverlap } val compareListPart1 = modifiedList.chunked(2) val compareListPart2 = modifiedList.chunked(2) var part1Count = 0 var part2Count = 0 for (aList in compareListPart1) { if (checkContain(aList)) { part1Count++ } } for (aList in compareListPart2) { if (checkOverlap(aList)) { part2Count++ } } println(compareListPart1) println(part1Count) println(compareListPart2) println(part2Count) }
[ { "class_path": "Scholar17__aoc-2022-in-kotlin__d3d79fb/Day04Kt.class", "javap": "Compiled from \"Day04.kt\"\npublic final class Day04Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String src/Day04_sample.txt\n 2: astore_0\n 3: new #10 // class java/io/File\n 6: dup\n 7: aload_0\n 8: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 11: aconst_null\n 12: iconst_1\n 13: aconst_null\n 14: invokestatic #20 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;\n 17: astore_1\n 18: aload_1\n 19: invokestatic #24 // Method main$parseInputCommaAndNewLine:(Ljava/lang/String;)Ljava/util/List;\n 22: astore_2\n 23: aload_2\n 24: checkcast #26 // class java/lang/Iterable\n 27: iconst_1\n 28: invokestatic #32 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 31: astore_3\n 32: new #34 // class java/util/ArrayList\n 35: dup\n 36: invokespecial #36 // Method java/util/ArrayList.\"<init>\":()V\n 39: checkcast #38 // class java/util/List\n 42: astore 4\n 44: aload_3\n 45: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 50: astore 5\n 52: aload 5\n 54: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 59: ifeq 121\n 62: aload 5\n 64: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 69: checkcast #38 // class java/util/List\n 72: astore 6\n 74: aload 6\n 76: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 81: astore 7\n 83: aload 7\n 85: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 90: ifeq 52\n 93: aload 7\n 95: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 100: checkcast #54 // class java/lang/String\n 103: astore 8\n 105: aload 4\n 107: aload 8\n 109: invokestatic #57 // Method main$parseInputDash:(Ljava/lang/String;)Ljava/util/List;\n 112: invokeinterface #61, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 117: pop\n 118: goto 83\n 121: new #34 // class java/util/ArrayList\n 124: dup\n 125: invokespecial #36 // Method java/util/ArrayList.\"<init>\":()V\n 128: checkcast #38 // class java/util/List\n 131: astore 5\n 133: aload 4\n 135: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 140: astore 6\n 142: aload 6\n 144: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 149: ifeq 180\n 152: aload 6\n 154: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 159: checkcast #38 // class java/util/List\n 162: astore 7\n 164: aload 5\n 166: aload 7\n 168: invokestatic #65 // Method main$comparedList:(Ljava/util/List;)Ljava/util/List;\n 171: invokeinterface #61, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 176: pop\n 177: goto 142\n 180: aload 5\n 182: checkcast #26 // class java/lang/Iterable\n 185: iconst_2\n 186: invokestatic #32 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 189: astore 6\n 191: aload 5\n 193: checkcast #26 // class java/lang/Iterable\n 196: iconst_2\n 197: invokestatic #32 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 200: astore 7\n 202: iconst_0\n 203: istore 8\n 205: iconst_0\n 206: istore 9\n 208: aload 6\n 210: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 215: astore 10\n 217: aload 10\n 219: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 224: ifeq 253\n 227: aload 10\n 229: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 234: checkcast #38 // class java/util/List\n 237: astore 11\n 239: aload 11\n 241: invokestatic #69 // Method main$checkContain:(Ljava/util/List;)Z\n 244: ifeq 217\n 247: iinc 8, 1\n 250: goto 217\n 253: aload 7\n 255: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 260: astore 10\n 262: aload 10\n 264: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 269: ifeq 298\n 272: aload 10\n 274: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 279: checkcast #38 // class java/util/List\n 282: astore 11\n 284: aload 11\n 286: invokestatic #72 // Method main$checkOverlap:(Ljava/util/List;)Z\n 289: ifeq 262\n 292: iinc 9, 1\n 295: goto 262\n 298: getstatic #78 // Field java/lang/System.out:Ljava/io/PrintStream;\n 301: aload 6\n 303: invokevirtual #84 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 306: getstatic #78 // Field java/lang/System.out:Ljava/io/PrintStream;\n 309: iload 8\n 311: invokevirtual #87 // Method java/io/PrintStream.println:(I)V\n 314: getstatic #78 // Field java/lang/System.out:Ljava/io/PrintStream;\n 317: aload 7\n 319: invokevirtual #84 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 322: getstatic #78 // Field java/lang/System.out:Ljava/io/PrintStream;\n 325: iload 9\n 327: invokevirtual #87 // Method java/io/PrintStream.println:(I)V\n 330: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #105 // Method main:()V\n 3: return\n\n private static final java.util.List<java.lang.String> main$parseInputCommaAndNewLine(java.lang.String);\n Code:\n 0: aload_0\n 1: checkcast #110 // class java/lang/CharSequence\n 4: iconst_2\n 5: anewarray #54 // class java/lang/String\n 8: astore_1\n 9: aload_1\n 10: iconst_0\n 11: ldc #112 // String ,\n 13: aastore\n 14: aload_1\n 15: iconst_1\n 16: ldc #114 // String \\r\\n\n 18: aastore\n 19: aload_1\n 20: iconst_0\n 21: iconst_0\n 22: bipush 6\n 24: aconst_null\n 25: invokestatic #120 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 28: areturn\n\n private static final java.util.List<java.lang.Integer> main$parseInputDash(java.lang.String);\n Code:\n 0: aload_0\n 1: checkcast #110 // class java/lang/CharSequence\n 4: iconst_1\n 5: anewarray #54 // class java/lang/String\n 8: astore_1\n 9: aload_1\n 10: iconst_0\n 11: ldc #123 // String -\n 13: aastore\n 14: aload_1\n 15: iconst_0\n 16: iconst_0\n 17: bipush 6\n 19: aconst_null\n 20: invokestatic #120 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 23: checkcast #26 // class java/lang/Iterable\n 26: astore_1\n 27: iconst_0\n 28: istore_2\n 29: aload_1\n 30: astore_3\n 31: new #34 // class java/util/ArrayList\n 34: dup\n 35: aload_1\n 36: bipush 10\n 38: invokestatic #127 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 41: invokespecial #129 // Method java/util/ArrayList.\"<init>\":(I)V\n 44: checkcast #131 // class java/util/Collection\n 47: astore 4\n 49: iconst_0\n 50: istore 5\n 52: aload_3\n 53: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 58: astore 6\n 60: aload 6\n 62: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 67: ifeq 114\n 70: aload 6\n 72: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 77: astore 7\n 79: aload 4\n 81: aload 7\n 83: checkcast #54 // class java/lang/String\n 86: astore 8\n 88: astore 10\n 90: iconst_0\n 91: istore 9\n 93: aload 8\n 95: invokestatic #138 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 98: nop\n 99: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 102: aload 10\n 104: swap\n 105: invokeinterface #143, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 110: pop\n 111: goto 60\n 114: aload 4\n 116: checkcast #38 // class java/util/List\n 119: nop\n 120: areturn\n\n private static final java.util.List<java.lang.Integer> main$comparedList(java.util.List<java.lang.Integer>);\n Code:\n 0: new #34 // class java/util/ArrayList\n 3: dup\n 4: invokespecial #36 // Method java/util/ArrayList.\"<init>\":()V\n 7: checkcast #38 // class java/util/List\n 10: astore_1\n 11: aload_0\n 12: invokestatic #159 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 15: checkcast #161 // class java/lang/Number\n 18: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 21: aload_0\n 22: invokestatic #168 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 25: checkcast #161 // class java/lang/Number\n 28: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 31: if_icmpne 48\n 34: aload_1\n 35: aload_0\n 36: invokestatic #159 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 39: invokeinterface #61, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 44: pop\n 45: goto 117\n 48: aload_0\n 49: invokestatic #159 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 52: checkcast #161 // class java/lang/Number\n 55: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 58: aload_0\n 59: invokestatic #168 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 62: checkcast #161 // class java/lang/Number\n 65: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 68: if_icmpge 117\n 71: aload_0\n 72: invokestatic #159 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 75: checkcast #161 // class java/lang/Number\n 78: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 81: istore_2\n 82: aload_0\n 83: invokestatic #168 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 86: checkcast #161 // class java/lang/Number\n 89: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 92: iconst_1\n 93: iadd\n 94: istore_3\n 95: iload_2\n 96: iload_3\n 97: if_icmpge 117\n 100: aload_1\n 101: iload_2\n 102: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 105: invokeinterface #61, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 110: pop\n 111: iinc 2, 1\n 114: goto 95\n 117: aload_1\n 118: areturn\n\n private static final boolean main$checkContain(java.util.List<? extends java.util.List<java.lang.Integer>>);\n Code:\n 0: iconst_0\n 1: istore_1\n 2: aload_0\n 3: checkcast #131 // class java/util/Collection\n 6: invokestatic #175 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 9: checkcast #26 // class java/lang/Iterable\n 12: iconst_1\n 13: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 16: invokestatic #179 // Method kotlin/collections/CollectionsKt.minus:(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/util/List;\n 19: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 24: astore_2\n 25: aload_2\n 26: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 31: ifeq 117\n 34: aload_2\n 35: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 40: checkcast #161 // class java/lang/Number\n 43: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 46: istore_3\n 47: aload_0\n 48: iload_3\n 49: invokeinterface #183, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 54: checkcast #38 // class java/util/List\n 57: aload_0\n 58: iload_3\n 59: iconst_1\n 60: iadd\n 61: invokeinterface #183, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 66: checkcast #131 // class java/util/Collection\n 69: invokeinterface #187, 2 // InterfaceMethod java/util/List.containsAll:(Ljava/util/Collection;)Z\n 74: ifeq 82\n 77: iconst_1\n 78: istore_1\n 79: goto 25\n 82: aload_0\n 83: iload_3\n 84: iconst_1\n 85: iadd\n 86: invokeinterface #183, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 91: checkcast #38 // class java/util/List\n 94: aload_0\n 95: iload_3\n 96: invokeinterface #183, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 101: checkcast #131 // class java/util/Collection\n 104: invokeinterface #187, 2 // InterfaceMethod java/util/List.containsAll:(Ljava/util/Collection;)Z\n 109: ifeq 25\n 112: iconst_1\n 113: istore_1\n 114: goto 25\n 117: iload_1\n 118: ireturn\n\n private static final boolean main$checkOverlap(java.util.List<? extends java.util.List<java.lang.Integer>>);\n Code:\n 0: iconst_0\n 1: istore_1\n 2: aload_0\n 3: checkcast #131 // class java/util/Collection\n 6: invokestatic #175 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 9: checkcast #26 // class java/lang/Iterable\n 12: iconst_1\n 13: invokestatic #142 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 16: invokestatic #179 // Method kotlin/collections/CollectionsKt.minus:(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/util/List;\n 19: invokeinterface #42, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 24: astore_2\n 25: aload_2\n 26: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 31: ifeq 102\n 34: aload_2\n 35: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 40: checkcast #161 // class java/lang/Number\n 43: invokevirtual #165 // Method java/lang/Number.intValue:()I\n 46: istore_3\n 47: aload_0\n 48: iload_3\n 49: invokeinterface #183, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 54: checkcast #26 // class java/lang/Iterable\n 57: aload_0\n 58: iload_3\n 59: iconst_1\n 60: iadd\n 61: invokeinterface #183, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 66: checkcast #26 // class java/lang/Iterable\n 69: invokestatic #193 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 72: checkcast #26 // class java/lang/Iterable\n 75: invokestatic #197 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;\n 78: checkcast #131 // class java/util/Collection\n 81: invokeinterface #200, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 86: ifne 93\n 89: iconst_1\n 90: goto 94\n 93: iconst_0\n 94: ifeq 25\n 97: iconst_1\n 98: istore_1\n 99: goto 25\n 102: iload_1\n 103: ireturn\n}\n", "javap_err": "" } ]
Scholar17__aoc-2022-in-kotlin__d3d79fb/src/Day03_2021.kt
import java.io.File fun main() { fun parseInput(input: String): List<List<Int>> { return input.split("\n").map { bit -> bit.map { it.digitToIntOrNull() ?: 0 } } } val filename = "src/Day03_sample_2021.txt" // "src/Day03_quiz_2021.txt" val textInput = File(filename).readText() val nestedIntList = parseInput(textInput) println(nestedIntList) fun maxCounter(input: List<Int>): Int { return input .groupingBy { it } .eachCount() .maxBy { it.value }.key } fun maxCounterValue(input: List<Int>): Int { return input .groupingBy { it } .eachCount() .maxBy { it.value }.value } fun minCounter(input: List<Int>): Int { return input .groupingBy { it } .eachCount() .minBy { it.value }.key } val filterTotalResult = mutableListOf<List<Int>>() for (i in 0 until nestedIntList.first().size - 1) { //for each column to list val columnList = nestedIntList.map { it[i] } filterTotalResult.add(columnList) println(columnList) } val gammaRate = mutableListOf<Int>() val epsilonRate = mutableListOf<Int>() val test = mutableListOf<Int>() for (aList in filterTotalResult) { gammaRate.add(maxCounter(aList)) epsilonRate.add(minCounter(aList)) test.add(maxCounterValue(aList)) } println(test) var gammaRateInString = "" var epsilonRateInString = "" for (s in gammaRate) { gammaRateInString += s } for (s in epsilonRate) { epsilonRateInString += s } println(gammaRateInString) println(epsilonRateInString) val gammaRateInInteger = gammaRateInString.toInt(2) val epsilonRateInInteger = epsilonRateInString.toInt(2) println(gammaRateInInteger) println(epsilonRateInInteger) val powerConsumption = gammaRateInInteger * epsilonRateInInteger println(powerConsumption) }
[ { "class_path": "Scholar17__aoc-2022-in-kotlin__d3d79fb/Day03_2021Kt$main$minCounter$$inlined$groupingBy$1.class", "javap": "Compiled from \"_Collections.kt\"\npublic final class Day03_2021Kt$main$minCounter$$inlined$groupingBy$1 implements kotlin.collections.Grouping<java.lang.Integer, java.lang.Integer> {\n final java.lang.Iterable $this_groupingBy;\n\n public Day03_2021Kt$main$minCounter$$inlined$groupingBy$1(java.lang.Iterable);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #18 // Field $this_groupingBy:Ljava/lang/Iterable;\n 5: aload_0\n 6: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 9: return\n\n public java.util.Iterator<java.lang.Integer> sourceIterator();\n Code:\n 0: aload_0\n 1: getfield #18 // Field $this_groupingBy:Ljava/lang/Iterable;\n 4: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 9: areturn\n\n public java.lang.Integer keyOf(java.lang.Integer);\n Code:\n 0: aload_1\n 1: checkcast #37 // class java/lang/Number\n 4: invokevirtual #41 // Method java/lang/Number.intValue:()I\n 7: istore_2\n 8: iconst_0\n 9: istore_3\n 10: iload_2\n 11: invokestatic #47 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: areturn\n}\n", "javap_err": "" }, { "class_path": "Scholar17__aoc-2022-in-kotlin__d3d79fb/Day03_2021Kt.class", "javap": "Compiled from \"Day03_2021.kt\"\npublic final class Day03_2021Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String src/Day03_sample_2021.txt\n 2: astore_0\n 3: new #10 // class java/io/File\n 6: dup\n 7: aload_0\n 8: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 11: aconst_null\n 12: iconst_1\n 13: aconst_null\n 14: invokestatic #20 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;\n 17: astore_1\n 18: aload_1\n 19: invokestatic #24 // Method main$parseInput:(Ljava/lang/String;)Ljava/util/List;\n 22: astore_2\n 23: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 26: aload_2\n 27: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 30: new #38 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #40 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #42 // class java/util/List\n 40: astore_3\n 41: iconst_0\n 42: istore 4\n 44: aload_2\n 45: invokestatic #48 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 48: checkcast #42 // class java/util/List\n 51: invokeinterface #52, 1 // InterfaceMethod java/util/List.size:()I\n 56: iconst_1\n 57: isub\n 58: istore 5\n 60: iload 4\n 62: iload 5\n 64: if_icmpge 205\n 67: aload_2\n 68: checkcast #54 // class java/lang/Iterable\n 71: astore 7\n 73: iconst_0\n 74: istore 8\n 76: aload 7\n 78: astore 9\n 80: new #38 // class java/util/ArrayList\n 83: dup\n 84: aload 7\n 86: bipush 10\n 88: invokestatic #58 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 91: invokespecial #61 // Method java/util/ArrayList.\"<init>\":(I)V\n 94: checkcast #63 // class java/util/Collection\n 97: astore 10\n 99: iconst_0\n 100: istore 11\n 102: aload 9\n 104: invokeinterface #67, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 109: astore 12\n 111: aload 12\n 113: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 118: ifeq 174\n 121: aload 12\n 123: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 128: astore 13\n 130: aload 10\n 132: aload 13\n 134: checkcast #42 // class java/util/List\n 137: astore 14\n 139: astore 16\n 141: iconst_0\n 142: istore 15\n 144: aload 14\n 146: iload 4\n 148: invokeinterface #81, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 153: checkcast #83 // class java/lang/Number\n 156: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 159: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 162: aload 16\n 164: swap\n 165: invokeinterface #96, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 170: pop\n 171: goto 111\n 174: aload 10\n 176: checkcast #42 // class java/util/List\n 179: nop\n 180: astore 6\n 182: aload_3\n 183: aload 6\n 185: invokeinterface #97, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 190: pop\n 191: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 194: aload 6\n 196: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 199: iinc 4, 1\n 202: goto 60\n 205: new #38 // class java/util/ArrayList\n 208: dup\n 209: invokespecial #40 // Method java/util/ArrayList.\"<init>\":()V\n 212: checkcast #42 // class java/util/List\n 215: astore 4\n 217: new #38 // class java/util/ArrayList\n 220: dup\n 221: invokespecial #40 // Method java/util/ArrayList.\"<init>\":()V\n 224: checkcast #42 // class java/util/List\n 227: astore 5\n 229: new #38 // class java/util/ArrayList\n 232: dup\n 233: invokespecial #40 // Method java/util/ArrayList.\"<init>\":()V\n 236: checkcast #42 // class java/util/List\n 239: astore 6\n 241: aload_3\n 242: invokeinterface #98, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 247: astore 7\n 249: aload 7\n 251: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 256: ifeq 322\n 259: aload 7\n 261: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 266: checkcast #42 // class java/util/List\n 269: astore 8\n 271: aload 4\n 273: aload 8\n 275: invokestatic #102 // Method main$maxCounter:(Ljava/util/List;)I\n 278: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 281: invokeinterface #97, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 286: pop\n 287: aload 5\n 289: aload 8\n 291: invokestatic #105 // Method main$minCounter:(Ljava/util/List;)I\n 294: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 297: invokeinterface #97, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 302: pop\n 303: aload 6\n 305: aload 8\n 307: invokestatic #108 // Method main$maxCounterValue:(Ljava/util/List;)I\n 310: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 313: invokeinterface #97, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 318: pop\n 319: goto 249\n 322: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 325: aload 6\n 327: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 330: ldc #110 // String\n 332: astore 7\n 334: ldc #110 // String\n 336: astore 8\n 338: aload 4\n 340: invokeinterface #98, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 345: astore 9\n 347: aload 9\n 349: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 354: ifeq 397\n 357: aload 9\n 359: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 364: checkcast #83 // class java/lang/Number\n 367: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 370: istore 10\n 372: new #112 // class java/lang/StringBuilder\n 375: dup\n 376: invokespecial #113 // Method java/lang/StringBuilder.\"<init>\":()V\n 379: aload 7\n 381: invokevirtual #117 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 384: iload 10\n 386: invokevirtual #120 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 389: invokevirtual #124 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 392: astore 7\n 394: goto 347\n 397: aload 5\n 399: invokeinterface #98, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 404: astore 9\n 406: aload 9\n 408: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 413: ifeq 456\n 416: aload 9\n 418: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 423: checkcast #83 // class java/lang/Number\n 426: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 429: istore 10\n 431: new #112 // class java/lang/StringBuilder\n 434: dup\n 435: invokespecial #113 // Method java/lang/StringBuilder.\"<init>\":()V\n 438: aload 8\n 440: invokevirtual #117 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 443: iload 10\n 445: invokevirtual #120 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 448: invokevirtual #124 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 451: astore 8\n 453: goto 406\n 456: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 459: aload 7\n 461: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 464: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 467: aload 8\n 469: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 472: aload 7\n 474: iconst_2\n 475: invokestatic #130 // Method kotlin/text/CharsKt.checkRadix:(I)I\n 478: invokestatic #134 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 481: istore 9\n 483: aload 8\n 485: iconst_2\n 486: invokestatic #130 // Method kotlin/text/CharsKt.checkRadix:(I)I\n 489: invokestatic #134 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 492: istore 10\n 494: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 497: iload 9\n 499: invokevirtual #136 // Method java/io/PrintStream.println:(I)V\n 502: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 505: iload 10\n 507: invokevirtual #136 // Method java/io/PrintStream.println:(I)V\n 510: iload 9\n 512: iload 10\n 514: imul\n 515: istore 11\n 517: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 520: iload 11\n 522: invokevirtual #136 // Method java/io/PrintStream.println:(I)V\n 525: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #171 // Method main:()V\n 3: return\n\n private static final java.util.List<java.util.List<java.lang.Integer>> main$parseInput(java.lang.String);\n Code:\n 0: aload_0\n 1: checkcast #176 // class java/lang/CharSequence\n 4: iconst_1\n 5: anewarray #168 // class java/lang/String\n 8: astore_1\n 9: aload_1\n 10: iconst_0\n 11: ldc #178 // String \\n\n 13: aastore\n 14: aload_1\n 15: iconst_0\n 16: iconst_0\n 17: bipush 6\n 19: aconst_null\n 20: invokestatic #184 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 23: checkcast #54 // class java/lang/Iterable\n 26: astore_1\n 27: iconst_0\n 28: istore_2\n 29: aload_1\n 30: astore_3\n 31: new #38 // class java/util/ArrayList\n 34: dup\n 35: aload_1\n 36: bipush 10\n 38: invokestatic #58 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 41: invokespecial #61 // Method java/util/ArrayList.\"<init>\":(I)V\n 44: checkcast #63 // class java/util/Collection\n 47: astore 4\n 49: iconst_0\n 50: istore 5\n 52: aload_3\n 53: invokeinterface #67, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 58: astore 6\n 60: aload 6\n 62: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 67: ifeq 220\n 70: aload 6\n 72: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 77: astore 7\n 79: aload 4\n 81: aload 7\n 83: checkcast #168 // class java/lang/String\n 86: astore 8\n 88: astore 20\n 90: iconst_0\n 91: istore 9\n 93: aload 8\n 95: checkcast #176 // class java/lang/CharSequence\n 98: astore 10\n 100: iconst_0\n 101: istore 11\n 103: aload 10\n 105: astore 12\n 107: new #38 // class java/util/ArrayList\n 110: dup\n 111: aload 10\n 113: invokeinterface #187, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 118: invokespecial #61 // Method java/util/ArrayList.\"<init>\":(I)V\n 121: checkcast #63 // class java/util/Collection\n 124: astore 13\n 126: iconst_0\n 127: istore 14\n 129: iconst_0\n 130: istore 15\n 132: iload 15\n 134: aload 12\n 136: invokeinterface #187, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 141: if_icmpge 201\n 144: aload 12\n 146: iload 15\n 148: invokeinterface #191, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 153: istore 16\n 155: aload 13\n 157: iload 16\n 159: istore 17\n 161: astore 18\n 163: iconst_0\n 164: istore 19\n 166: iload 17\n 168: invokestatic #195 // Method kotlin/text/CharsKt.digitToIntOrNull:(C)Ljava/lang/Integer;\n 171: dup\n 172: ifnull 181\n 175: invokevirtual #196 // Method java/lang/Integer.intValue:()I\n 178: goto 183\n 181: pop\n 182: iconst_0\n 183: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 186: aload 18\n 188: swap\n 189: invokeinterface #96, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 194: pop\n 195: iinc 15, 1\n 198: goto 132\n 201: aload 13\n 203: checkcast #42 // class java/util/List\n 206: nop\n 207: nop\n 208: aload 20\n 210: swap\n 211: invokeinterface #96, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 216: pop\n 217: goto 60\n 220: aload 4\n 222: checkcast #42 // class java/util/List\n 225: nop\n 226: areturn\n\n private static final int main$maxCounter(java.util.List<java.lang.Integer>);\n Code:\n 0: aload_0\n 1: checkcast #54 // class java/lang/Iterable\n 4: astore_1\n 5: nop\n 6: iconst_0\n 7: istore_2\n 8: new #205 // class Day03_2021Kt$main$maxCounter$$inlined$groupingBy$1\n 11: dup\n 12: aload_1\n 13: invokespecial #208 // Method Day03_2021Kt$main$maxCounter$$inlined$groupingBy$1.\"<init>\":(Ljava/lang/Iterable;)V\n 16: checkcast #210 // class kotlin/collections/Grouping\n 19: invokestatic #216 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;\n 22: invokeinterface #222, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 27: checkcast #54 // class java/lang/Iterable\n 30: astore_2\n 31: aload_2\n 32: invokeinterface #67, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 37: astore_3\n 38: aload_3\n 39: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 44: ifne 55\n 47: new #224 // class java/util/NoSuchElementException\n 50: dup\n 51: invokespecial #225 // Method java/util/NoSuchElementException.\"<init>\":()V\n 54: athrow\n 55: aload_3\n 56: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 4\n 63: aload_3\n 64: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 69: ifne 77\n 72: aload 4\n 74: goto 161\n 77: aload 4\n 79: checkcast #227 // class java/util/Map$Entry\n 82: astore 5\n 84: iconst_0\n 85: istore 6\n 87: aload 5\n 89: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 94: checkcast #83 // class java/lang/Number\n 97: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 100: istore 5\n 102: aload_3\n 103: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 108: astore 6\n 110: aload 6\n 112: checkcast #227 // class java/util/Map$Entry\n 115: astore 7\n 117: iconst_0\n 118: istore 8\n 120: aload 7\n 122: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 127: checkcast #83 // class java/lang/Number\n 130: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 133: istore 7\n 135: iload 5\n 137: iload 7\n 139: if_icmpge 150\n 142: aload 6\n 144: astore 4\n 146: iload 7\n 148: istore 5\n 150: aload_3\n 151: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 156: ifne 102\n 159: aload 4\n 161: checkcast #227 // class java/util/Map$Entry\n 164: invokeinterface #233, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 169: checkcast #83 // class java/lang/Number\n 172: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 175: ireturn\n\n private static final int main$maxCounterValue(java.util.List<java.lang.Integer>);\n Code:\n 0: aload_0\n 1: checkcast #54 // class java/lang/Iterable\n 4: astore_1\n 5: nop\n 6: iconst_0\n 7: istore_2\n 8: new #239 // class Day03_2021Kt$main$maxCounterValue$$inlined$groupingBy$1\n 11: dup\n 12: aload_1\n 13: invokespecial #240 // Method Day03_2021Kt$main$maxCounterValue$$inlined$groupingBy$1.\"<init>\":(Ljava/lang/Iterable;)V\n 16: checkcast #210 // class kotlin/collections/Grouping\n 19: invokestatic #216 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;\n 22: invokeinterface #222, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 27: checkcast #54 // class java/lang/Iterable\n 30: astore_2\n 31: aload_2\n 32: invokeinterface #67, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 37: astore_3\n 38: aload_3\n 39: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 44: ifne 55\n 47: new #224 // class java/util/NoSuchElementException\n 50: dup\n 51: invokespecial #225 // Method java/util/NoSuchElementException.\"<init>\":()V\n 54: athrow\n 55: aload_3\n 56: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 4\n 63: aload_3\n 64: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 69: ifne 77\n 72: aload 4\n 74: goto 161\n 77: aload 4\n 79: checkcast #227 // class java/util/Map$Entry\n 82: astore 5\n 84: iconst_0\n 85: istore 6\n 87: aload 5\n 89: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 94: checkcast #83 // class java/lang/Number\n 97: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 100: istore 5\n 102: aload_3\n 103: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 108: astore 6\n 110: aload 6\n 112: checkcast #227 // class java/util/Map$Entry\n 115: astore 7\n 117: iconst_0\n 118: istore 8\n 120: aload 7\n 122: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 127: checkcast #83 // class java/lang/Number\n 130: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 133: istore 7\n 135: iload 5\n 137: iload 7\n 139: if_icmpge 150\n 142: aload 6\n 144: astore 4\n 146: iload 7\n 148: istore 5\n 150: aload_3\n 151: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 156: ifne 102\n 159: aload 4\n 161: checkcast #227 // class java/util/Map$Entry\n 164: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 169: checkcast #83 // class java/lang/Number\n 172: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 175: ireturn\n\n private static final int main$minCounter(java.util.List<java.lang.Integer>);\n Code:\n 0: aload_0\n 1: checkcast #54 // class java/lang/Iterable\n 4: astore_1\n 5: nop\n 6: iconst_0\n 7: istore_2\n 8: new #243 // class Day03_2021Kt$main$minCounter$$inlined$groupingBy$1\n 11: dup\n 12: aload_1\n 13: invokespecial #244 // Method Day03_2021Kt$main$minCounter$$inlined$groupingBy$1.\"<init>\":(Ljava/lang/Iterable;)V\n 16: checkcast #210 // class kotlin/collections/Grouping\n 19: invokestatic #216 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;\n 22: invokeinterface #222, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 27: checkcast #54 // class java/lang/Iterable\n 30: astore_2\n 31: aload_2\n 32: invokeinterface #67, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 37: astore_3\n 38: aload_3\n 39: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 44: ifne 55\n 47: new #224 // class java/util/NoSuchElementException\n 50: dup\n 51: invokespecial #225 // Method java/util/NoSuchElementException.\"<init>\":()V\n 54: athrow\n 55: aload_3\n 56: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 4\n 63: aload_3\n 64: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 69: ifne 77\n 72: aload 4\n 74: goto 161\n 77: aload 4\n 79: checkcast #227 // class java/util/Map$Entry\n 82: astore 5\n 84: iconst_0\n 85: istore 6\n 87: aload 5\n 89: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 94: checkcast #83 // class java/lang/Number\n 97: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 100: istore 5\n 102: aload_3\n 103: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 108: astore 6\n 110: aload 6\n 112: checkcast #227 // class java/util/Map$Entry\n 115: astore 7\n 117: iconst_0\n 118: istore 8\n 120: aload 7\n 122: invokeinterface #230, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 127: checkcast #83 // class java/lang/Number\n 130: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 133: istore 7\n 135: iload 5\n 137: iload 7\n 139: if_icmple 150\n 142: aload 6\n 144: astore 4\n 146: iload 7\n 148: istore 5\n 150: aload_3\n 151: invokeinterface #73, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 156: ifne 102\n 159: aload 4\n 161: checkcast #227 // class java/util/Map$Entry\n 164: invokeinterface #233, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 169: checkcast #83 // class java/lang/Number\n 172: invokevirtual #86 // Method java/lang/Number.intValue:()I\n 175: ireturn\n}\n", "javap_err": "" }, { "class_path": "Scholar17__aoc-2022-in-kotlin__d3d79fb/Day03_2021Kt$main$maxCounterValue$$inlined$groupingBy$1.class", "javap": "Compiled from \"_Collections.kt\"\npublic final class Day03_2021Kt$main$maxCounterValue$$inlined$groupingBy$1 implements kotlin.collections.Grouping<java.lang.Integer, java.lang.Integer> {\n final java.lang.Iterable $this_groupingBy;\n\n public Day03_2021Kt$main$maxCounterValue$$inlined$groupingBy$1(java.lang.Iterable);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #18 // Field $this_groupingBy:Ljava/lang/Iterable;\n 5: aload_0\n 6: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 9: return\n\n public java.util.Iterator<java.lang.Integer> sourceIterator();\n Code:\n 0: aload_0\n 1: getfield #18 // Field $this_groupingBy:Ljava/lang/Iterable;\n 4: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 9: areturn\n\n public java.lang.Integer keyOf(java.lang.Integer);\n Code:\n 0: aload_1\n 1: checkcast #37 // class java/lang/Number\n 4: invokevirtual #41 // Method java/lang/Number.intValue:()I\n 7: istore_2\n 8: iconst_0\n 9: istore_3\n 10: iload_2\n 11: invokestatic #47 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: areturn\n}\n", "javap_err": "" }, { "class_path": "Scholar17__aoc-2022-in-kotlin__d3d79fb/Day03_2021Kt$main$maxCounter$$inlined$groupingBy$1.class", "javap": "Compiled from \"_Collections.kt\"\npublic final class Day03_2021Kt$main$maxCounter$$inlined$groupingBy$1 implements kotlin.collections.Grouping<java.lang.Integer, java.lang.Integer> {\n final java.lang.Iterable $this_groupingBy;\n\n public Day03_2021Kt$main$maxCounter$$inlined$groupingBy$1(java.lang.Iterable);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #18 // Field $this_groupingBy:Ljava/lang/Iterable;\n 5: aload_0\n 6: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 9: return\n\n public java.util.Iterator<java.lang.Integer> sourceIterator();\n Code:\n 0: aload_0\n 1: getfield #18 // Field $this_groupingBy:Ljava/lang/Iterable;\n 4: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 9: areturn\n\n public java.lang.Integer keyOf(java.lang.Integer);\n Code:\n 0: aload_1\n 1: checkcast #37 // class java/lang/Number\n 4: invokevirtual #41 // Method java/lang/Number.intValue:()I\n 7: istore_2\n 8: iconst_0\n 9: istore_3\n 10: iload_2\n 11: invokestatic #47 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: areturn\n}\n", "javap_err": "" } ]
Scholar17__aoc-2022-in-kotlin__d3d79fb/src/Day03.kt
import java.io.File import kotlin.math.absoluteValue fun main() { fun parseInput(input: String): List<String> { return input.split("\r\n").map { value -> value } } val fileName = // "src/Day03_sample.txt" "src/Day03_quiz.txt" val inputText = File(fileName).readText() val inputList = parseInput(input = inputText) println(inputList) println() val part1ChunkList = mutableListOf<List<String>>() for (aList in inputList) { part1ChunkList.add(aList.chunked(aList.length / 2)) } var part2ChunkList: List<List<String>> = inputList.chunked(3) println(part2ChunkList) fun findCommonWord(inputList: List<String>): String { val first = inputList.first().toCharArray() val second = inputList.last().toCharArray() var index = "" for (aList in first) { if (second.contains(aList)) { index = aList.toString() } } return index } fun findCommonWordPart2(inputList: List<String>): String { println(inputList) val result = inputList.map { it.chunked(1) } var commonResult = "" for (aList in result) { for (element in aList) { if (result.all { it.contains(element) }) commonResult = element } } println("result") println(result) return commonResult } val commonResultList = mutableListOf<String>() for (aList in part2ChunkList) { commonResultList.add(findCommonWordPart2(aList)) } println(commonResultList) val resultList = mutableListOf<String>() for (aList in part1ChunkList) { resultList.add(findCommonWord(aList)) } println() // println(resultList) fun findNumericPosition(input: String): Int { val charArray = input.toCharArray() var position = 0 for (aList in charArray) { val temp = aList.code val lowerMinus = 96 //for lower case val upperMinus = 38 //for upper case position = if ((temp <= 122) and (temp >= 97)) temp - lowerMinus else temp - upperMinus } return position } var sumNumberPart1 = 0 for (aList in resultList) { sumNumberPart1 += findNumericPosition(aList) } println(sumNumberPart1) var sumNumberPart2 = 0 for (aList in commonResultList) { sumNumberPart2 += findNumericPosition(aList) } println(sumNumberPart2) }
[ { "class_path": "Scholar17__aoc-2022-in-kotlin__d3d79fb/Day03Kt.class", "javap": "Compiled from \"Day03.kt\"\npublic final class Day03Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String src/Day03_quiz.txt\n 2: astore_0\n 3: new #10 // class java/io/File\n 6: dup\n 7: aload_0\n 8: invokespecial #14 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 11: aconst_null\n 12: iconst_1\n 13: aconst_null\n 14: invokestatic #20 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;\n 17: astore_1\n 18: aload_1\n 19: invokestatic #24 // Method main$parseInput:(Ljava/lang/String;)Ljava/util/List;\n 22: astore_2\n 23: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 26: aload_2\n 27: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 30: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 33: invokevirtual #38 // Method java/io/PrintStream.println:()V\n 36: new #40 // class java/util/ArrayList\n 39: dup\n 40: invokespecial #42 // Method java/util/ArrayList.\"<init>\":()V\n 43: checkcast #44 // class java/util/List\n 46: astore_3\n 47: aload_2\n 48: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 53: astore 4\n 55: aload 4\n 57: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 62: ifeq 102\n 65: aload 4\n 67: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 72: checkcast #60 // class java/lang/String\n 75: astore 5\n 77: aload_3\n 78: aload 5\n 80: checkcast #62 // class java/lang/CharSequence\n 83: aload 5\n 85: invokevirtual #66 // Method java/lang/String.length:()I\n 88: iconst_2\n 89: idiv\n 90: invokestatic #72 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;\n 93: invokeinterface #76, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 98: pop\n 99: goto 55\n 102: aload_2\n 103: checkcast #78 // class java/lang/Iterable\n 106: iconst_3\n 107: invokestatic #83 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 110: astore 4\n 112: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 115: aload 4\n 117: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 120: new #40 // class java/util/ArrayList\n 123: dup\n 124: invokespecial #42 // Method java/util/ArrayList.\"<init>\":()V\n 127: checkcast #44 // class java/util/List\n 130: astore 5\n 132: aload 4\n 134: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 139: astore 6\n 141: aload 6\n 143: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 148: ifeq 179\n 151: aload 6\n 153: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 158: checkcast #44 // class java/util/List\n 161: astore 7\n 163: aload 5\n 165: aload 7\n 167: invokestatic #87 // Method main$findCommonWordPart2:(Ljava/util/List;)Ljava/lang/String;\n 170: invokeinterface #76, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 175: pop\n 176: goto 141\n 179: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 182: aload 5\n 184: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 187: new #40 // class java/util/ArrayList\n 190: dup\n 191: invokespecial #42 // Method java/util/ArrayList.\"<init>\":()V\n 194: checkcast #44 // class java/util/List\n 197: astore 6\n 199: aload_3\n 200: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 205: astore 7\n 207: aload 7\n 209: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 214: ifeq 245\n 217: aload 7\n 219: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 224: checkcast #44 // class java/util/List\n 227: astore 8\n 229: aload 6\n 231: aload 8\n 233: invokestatic #90 // Method main$findCommonWord:(Ljava/util/List;)Ljava/lang/String;\n 236: invokeinterface #76, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 241: pop\n 242: goto 207\n 245: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 248: invokevirtual #38 // Method java/io/PrintStream.println:()V\n 251: iconst_0\n 252: istore 7\n 254: aload 6\n 256: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 261: astore 8\n 263: aload 8\n 265: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 270: ifeq 298\n 273: aload 8\n 275: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 280: checkcast #60 // class java/lang/String\n 283: astore 9\n 285: iload 7\n 287: aload 9\n 289: invokestatic #94 // Method main$findNumericPosition:(Ljava/lang/String;)I\n 292: iadd\n 293: istore 7\n 295: goto 263\n 298: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 301: iload 7\n 303: invokevirtual #97 // Method java/io/PrintStream.println:(I)V\n 306: iconst_0\n 307: istore 8\n 309: aload 5\n 311: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 316: astore 9\n 318: aload 9\n 320: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 325: ifeq 353\n 328: aload 9\n 330: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 335: checkcast #60 // class java/lang/String\n 338: astore 10\n 340: iload 8\n 342: aload 10\n 344: invokestatic #94 // Method main$findNumericPosition:(Ljava/lang/String;)I\n 347: iadd\n 348: istore 8\n 350: goto 318\n 353: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 356: iload 8\n 358: invokevirtual #97 // Method java/io/PrintStream.println:(I)V\n 361: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #113 // Method main:()V\n 3: return\n\n private static final java.util.List<java.lang.String> main$parseInput(java.lang.String);\n Code:\n 0: aload_0\n 1: checkcast #62 // class java/lang/CharSequence\n 4: iconst_1\n 5: anewarray #60 // class java/lang/String\n 8: astore_1\n 9: aload_1\n 10: iconst_0\n 11: ldc #118 // String \\r\\n\n 13: aastore\n 14: aload_1\n 15: iconst_0\n 16: iconst_0\n 17: bipush 6\n 19: aconst_null\n 20: invokestatic #122 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 23: checkcast #78 // class java/lang/Iterable\n 26: astore_1\n 27: iconst_0\n 28: istore_2\n 29: aload_1\n 30: astore_3\n 31: new #40 // class java/util/ArrayList\n 34: dup\n 35: aload_1\n 36: bipush 10\n 38: invokestatic #126 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 41: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 44: checkcast #130 // class java/util/Collection\n 47: astore 4\n 49: iconst_0\n 50: istore 5\n 52: aload_3\n 53: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 58: astore 6\n 60: aload 6\n 62: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 67: ifeq 107\n 70: aload 6\n 72: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 77: astore 7\n 79: aload 4\n 81: aload 7\n 83: checkcast #60 // class java/lang/String\n 86: astore 8\n 88: astore 10\n 90: iconst_0\n 91: istore 9\n 93: aload 8\n 95: aload 10\n 97: swap\n 98: invokeinterface #132, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 103: pop\n 104: goto 60\n 107: aload 4\n 109: checkcast #44 // class java/util/List\n 112: nop\n 113: areturn\n\n private static final java.lang.String main$findCommonWord(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: invokestatic #149 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 4: checkcast #60 // class java/lang/String\n 7: invokevirtual #153 // Method java/lang/String.toCharArray:()[C\n 10: dup\n 11: ldc #155 // String toCharArray(...)\n 13: invokestatic #161 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 16: astore_1\n 17: aload_0\n 18: invokestatic #164 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 21: checkcast #60 // class java/lang/String\n 24: invokevirtual #153 // Method java/lang/String.toCharArray:()[C\n 27: dup\n 28: ldc #155 // String toCharArray(...)\n 30: invokestatic #161 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 33: astore_2\n 34: ldc #166 // String\n 36: astore_3\n 37: iconst_0\n 38: istore 4\n 40: aload_1\n 41: arraylength\n 42: istore 5\n 44: iload 4\n 46: iload 5\n 48: if_icmpge 78\n 51: aload_1\n 52: iload 4\n 54: caload\n 55: istore 6\n 57: aload_2\n 58: iload 6\n 60: invokestatic #172 // Method kotlin/collections/ArraysKt.contains:([CC)Z\n 63: ifeq 72\n 66: iload 6\n 68: invokestatic #176 // Method java/lang/String.valueOf:(C)Ljava/lang/String;\n 71: astore_3\n 72: iinc 4, 1\n 75: goto 44\n 78: aload_3\n 79: areturn\n\n private static final java.lang.String main$findCommonWordPart2(java.util.List<java.lang.String>);\n Code:\n 0: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 3: aload_0\n 4: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 7: aload_0\n 8: checkcast #78 // class java/lang/Iterable\n 11: astore_2\n 12: iconst_0\n 13: istore_3\n 14: aload_2\n 15: astore 4\n 17: new #40 // class java/util/ArrayList\n 20: dup\n 21: aload_2\n 22: bipush 10\n 24: invokestatic #126 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 27: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 30: checkcast #130 // class java/util/Collection\n 33: astore 5\n 35: iconst_0\n 36: istore 6\n 38: aload 4\n 40: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 7\n 47: aload 7\n 49: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 101\n 57: aload 7\n 59: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 8\n 66: aload 5\n 68: aload 8\n 70: checkcast #60 // class java/lang/String\n 73: astore 9\n 75: astore 13\n 77: iconst_0\n 78: istore 10\n 80: aload 9\n 82: checkcast #62 // class java/lang/CharSequence\n 85: iconst_1\n 86: invokestatic #72 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;\n 89: aload 13\n 91: swap\n 92: invokeinterface #132, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 97: pop\n 98: goto 47\n 101: aload 5\n 103: checkcast #44 // class java/util/List\n 106: nop\n 107: astore_1\n 108: ldc #166 // String\n 110: astore_2\n 111: aload_1\n 112: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 117: astore_3\n 118: aload_3\n 119: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 124: ifeq 267\n 127: aload_3\n 128: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 133: checkcast #44 // class java/util/List\n 136: astore 4\n 138: aload 4\n 140: invokeinterface #48, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 145: astore 5\n 147: aload 5\n 149: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 154: ifeq 118\n 157: aload 5\n 159: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 164: checkcast #60 // class java/lang/String\n 167: astore 6\n 169: aload_1\n 170: checkcast #78 // class java/lang/Iterable\n 173: astore 7\n 175: iconst_0\n 176: istore 8\n 178: aload 7\n 180: instanceof #130 // class java/util/Collection\n 183: ifeq 203\n 186: aload 7\n 188: checkcast #130 // class java/util/Collection\n 191: invokeinterface #184, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 196: ifeq 203\n 199: iconst_1\n 200: goto 258\n 203: aload 7\n 205: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 210: astore 9\n 212: aload 9\n 214: invokeinterface #54, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 219: ifeq 257\n 222: aload 9\n 224: invokeinterface #58, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 229: astore 10\n 231: aload 10\n 233: checkcast #44 // class java/util/List\n 236: astore 11\n 238: iconst_0\n 239: istore 12\n 241: aload 11\n 243: aload 6\n 245: invokeinterface #186, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 250: ifne 212\n 253: iconst_0\n 254: goto 258\n 257: iconst_1\n 258: ifeq 147\n 261: aload 6\n 263: astore_2\n 264: goto 147\n 267: ldc #188 // String result\n 269: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 272: swap\n 273: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 276: getstatic #30 // Field java/lang/System.out:Ljava/io/PrintStream;\n 279: aload_1\n 280: invokevirtual #36 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 283: aload_2\n 284: areturn\n\n private static final int main$findNumericPosition(java.lang.String);\n Code:\n 0: aload_0\n 1: invokevirtual #153 // Method java/lang/String.toCharArray:()[C\n 4: dup\n 5: ldc #155 // String toCharArray(...)\n 7: invokestatic #161 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: iconst_0\n 14: istore_3\n 15: aload_1\n 16: arraylength\n 17: istore 4\n 19: iload_3\n 20: iload 4\n 22: if_icmpge 90\n 25: aload_1\n 26: iload_3\n 27: caload\n 28: istore 5\n 30: iload 5\n 32: istore 6\n 34: bipush 96\n 36: istore 7\n 38: bipush 38\n 40: istore 8\n 42: iload 6\n 44: bipush 122\n 46: if_icmpgt 53\n 49: iconst_1\n 50: goto 54\n 53: iconst_0\n 54: iload 6\n 56: bipush 97\n 58: if_icmplt 65\n 61: iconst_1\n 62: goto 66\n 65: iconst_0\n 66: iand\n 67: ifeq 78\n 70: iload 6\n 72: iload 7\n 74: isub\n 75: goto 83\n 78: iload 6\n 80: iload 8\n 82: isub\n 83: istore_2\n 84: iinc 3, 1\n 87: goto 19\n 90: iload_2\n 91: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day15.kt
import kotlin.String import kotlin.collections.List object Day15 { fun part1(input: List<String>): String { val steps = input[0].split(",").map { it.trim() } return steps.sumOf { hash(it) }.toString() } private fun hash(it: String): Int { return it.toCharArray().fold(0) { acc, c -> ((acc + c.code) * 17) % 256 } } fun part2(input: List<String>): String { val steps = input[0].split(",").map { it.trim() } val boxes = mutableMapOf<Int, LinkedHashMap<String, Int>>() steps.forEach { if (it.contains("-")) { val label = it.substring(0, it.length - 1) val box = hash(label) boxes.getOrPut(box) { linkedMapOf() }.remove(label) } else { val (label, focusLength) = it.split("=") val box = hash(label) boxes.getOrPut(box) { linkedMapOf() }[label] = focusLength.toInt() } } return boxes.toList().sumOf { (boxNumber, lenses) -> lenses.values.withIndex().sumOf { (idx, value) -> (idx + 1) * value * (boxNumber + 1) } }.toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day15.class", "javap": "Compiled from \"Day15.kt\"\npublic final class Day15 {\n public static final Day15 INSTANCE;\n\n private Day15();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: iconst_0\n 8: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #30 // class java/lang/CharSequence\n 16: iconst_1\n 17: anewarray #32 // class java/lang/String\n 20: astore_3\n 21: aload_3\n 22: iconst_0\n 23: ldc #34 // String ,\n 25: aastore\n 26: aload_3\n 27: iconst_0\n 28: iconst_0\n 29: bipush 6\n 31: aconst_null\n 32: invokestatic #40 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 35: checkcast #42 // class java/lang/Iterable\n 38: astore_3\n 39: iconst_0\n 40: istore 4\n 42: aload_3\n 43: astore 5\n 45: new #44 // class java/util/ArrayList\n 48: dup\n 49: aload_3\n 50: bipush 10\n 52: invokestatic #50 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 55: invokespecial #53 // Method java/util/ArrayList.\"<init>\":(I)V\n 58: checkcast #55 // class java/util/Collection\n 61: astore 6\n 63: iconst_0\n 64: istore 7\n 66: aload 5\n 68: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 73: astore 8\n 75: aload 8\n 77: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 82: ifeq 132\n 85: aload 8\n 87: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 92: astore 9\n 94: aload 6\n 96: aload 9\n 98: checkcast #32 // class java/lang/String\n 101: astore 10\n 103: astore 12\n 105: iconst_0\n 106: istore 11\n 108: aload 10\n 110: checkcast #30 // class java/lang/CharSequence\n 113: invokestatic #73 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 116: invokevirtual #77 // Method java/lang/Object.toString:()Ljava/lang/String;\n 119: nop\n 120: aload 12\n 122: swap\n 123: invokeinterface #81, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 128: pop\n 129: goto 75\n 132: aload 6\n 134: checkcast #24 // class java/util/List\n 137: nop\n 138: astore_2\n 139: aload_2\n 140: checkcast #42 // class java/lang/Iterable\n 143: astore_3\n 144: iconst_0\n 145: istore 4\n 147: aload_3\n 148: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 153: astore 5\n 155: aload 5\n 157: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 162: ifeq 208\n 165: aload 5\n 167: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 172: astore 6\n 174: iload 4\n 176: aload 6\n 178: checkcast #32 // class java/lang/String\n 181: astore 7\n 183: istore 12\n 185: iconst_0\n 186: istore 8\n 188: getstatic #84 // Field INSTANCE:LDay15;\n 191: aload 7\n 193: invokespecial #88 // Method hash:(Ljava/lang/String;)I\n 196: istore 13\n 198: iload 12\n 200: iload 13\n 202: iadd\n 203: istore 4\n 205: goto 155\n 208: iload 4\n 210: invokestatic #92 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 213: areturn\n\n private final int hash(java.lang.String);\n Code:\n 0: aload_1\n 1: invokevirtual #112 // Method java/lang/String.toCharArray:()[C\n 4: dup\n 5: ldc #114 // String toCharArray(...)\n 7: invokestatic #117 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 10: astore_2\n 11: iconst_0\n 12: istore_3\n 13: iconst_0\n 14: istore 4\n 16: iload_3\n 17: istore 5\n 19: iconst_0\n 20: istore 6\n 22: aload_2\n 23: arraylength\n 24: istore 7\n 26: iload 6\n 28: iload 7\n 30: if_icmpge 70\n 33: aload_2\n 34: iload 6\n 36: caload\n 37: istore 8\n 39: iload 5\n 41: iload 8\n 43: istore 9\n 45: istore 10\n 47: iconst_0\n 48: istore 11\n 50: iload 10\n 52: iload 9\n 54: iadd\n 55: bipush 17\n 57: imul\n 58: sipush 256\n 61: irem\n 62: istore 5\n 64: iinc 6, 1\n 67: goto 26\n 70: iload 5\n 72: ireturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: iconst_0\n 8: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #30 // class java/lang/CharSequence\n 16: iconst_1\n 17: anewarray #32 // class java/lang/String\n 20: astore_3\n 21: aload_3\n 22: iconst_0\n 23: ldc #34 // String ,\n 25: aastore\n 26: aload_3\n 27: iconst_0\n 28: iconst_0\n 29: bipush 6\n 31: aconst_null\n 32: invokestatic #40 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 35: checkcast #42 // class java/lang/Iterable\n 38: astore_3\n 39: iconst_0\n 40: istore 4\n 42: aload_3\n 43: astore 5\n 45: new #44 // class java/util/ArrayList\n 48: dup\n 49: aload_3\n 50: bipush 10\n 52: invokestatic #50 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 55: invokespecial #53 // Method java/util/ArrayList.\"<init>\":(I)V\n 58: checkcast #55 // class java/util/Collection\n 61: astore 6\n 63: iconst_0\n 64: istore 7\n 66: aload 5\n 68: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 73: astore 8\n 75: aload 8\n 77: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 82: ifeq 132\n 85: aload 8\n 87: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 92: astore 9\n 94: aload 6\n 96: aload 9\n 98: checkcast #32 // class java/lang/String\n 101: astore 10\n 103: astore 22\n 105: iconst_0\n 106: istore 11\n 108: aload 10\n 110: checkcast #30 // class java/lang/CharSequence\n 113: invokestatic #73 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 116: invokevirtual #77 // Method java/lang/Object.toString:()Ljava/lang/String;\n 119: nop\n 120: aload 22\n 122: swap\n 123: invokeinterface #81, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 128: pop\n 129: goto 75\n 132: aload 6\n 134: checkcast #24 // class java/util/List\n 137: nop\n 138: astore_2\n 139: new #131 // class java/util/LinkedHashMap\n 142: dup\n 143: invokespecial #132 // Method java/util/LinkedHashMap.\"<init>\":()V\n 146: checkcast #134 // class java/util/Map\n 149: astore_3\n 150: aload_2\n 151: checkcast #42 // class java/lang/Iterable\n 154: astore 4\n 156: iconst_0\n 157: istore 5\n 159: aload 4\n 161: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 166: astore 6\n 168: aload 6\n 170: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 175: ifeq 480\n 178: aload 6\n 180: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 185: astore 7\n 187: aload 7\n 189: checkcast #32 // class java/lang/String\n 192: astore 8\n 194: iconst_0\n 195: istore 9\n 197: aload 8\n 199: checkcast #30 // class java/lang/CharSequence\n 202: ldc #136 // String -\n 204: checkcast #30 // class java/lang/CharSequence\n 207: iconst_0\n 208: iconst_2\n 209: aconst_null\n 210: invokestatic #140 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z\n 213: ifeq 321\n 216: aload 8\n 218: iconst_0\n 219: aload 8\n 221: invokevirtual #144 // Method java/lang/String.length:()I\n 224: iconst_1\n 225: isub\n 226: invokevirtual #148 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 229: dup\n 230: ldc #150 // String substring(...)\n 232: invokestatic #117 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 235: astore 10\n 237: getstatic #84 // Field INSTANCE:LDay15;\n 240: aload 10\n 242: invokespecial #88 // Method hash:(Ljava/lang/String;)I\n 245: istore 11\n 247: aload_3\n 248: astore 12\n 250: iload 11\n 252: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 255: astore 13\n 257: iconst_0\n 258: istore 14\n 260: aload 12\n 262: aload 13\n 264: invokeinterface #158, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 269: astore 15\n 271: aload 15\n 273: ifnonnull 306\n 276: iconst_0\n 277: istore 16\n 279: new #131 // class java/util/LinkedHashMap\n 282: dup\n 283: invokespecial #132 // Method java/util/LinkedHashMap.\"<init>\":()V\n 286: nop\n 287: astore 16\n 289: aload 12\n 291: aload 13\n 293: aload 16\n 295: invokeinterface #162, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 300: pop\n 301: aload 16\n 303: goto 308\n 306: aload 15\n 308: nop\n 309: checkcast #131 // class java/util/LinkedHashMap\n 312: aload 10\n 314: invokevirtual #165 // Method java/util/LinkedHashMap.remove:(Ljava/lang/Object;)Ljava/lang/Object;\n 317: pop\n 318: goto 475\n 321: aload 8\n 323: checkcast #30 // class java/lang/CharSequence\n 326: iconst_1\n 327: anewarray #32 // class java/lang/String\n 330: astore 11\n 332: aload 11\n 334: iconst_0\n 335: ldc #167 // String =\n 337: aastore\n 338: aload 11\n 340: iconst_0\n 341: iconst_0\n 342: bipush 6\n 344: aconst_null\n 345: invokestatic #40 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 348: astore 10\n 350: aload 10\n 352: iconst_0\n 353: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 358: checkcast #32 // class java/lang/String\n 361: astore 11\n 363: aload 10\n 365: iconst_1\n 366: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 371: checkcast #32 // class java/lang/String\n 374: astore 12\n 376: getstatic #84 // Field INSTANCE:LDay15;\n 379: aload 11\n 381: invokespecial #88 // Method hash:(Ljava/lang/String;)I\n 384: istore 13\n 386: aload_3\n 387: astore 14\n 389: iload 13\n 391: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 394: astore 15\n 396: iconst_0\n 397: istore 16\n 399: aload 14\n 401: aload 15\n 403: invokeinterface #158, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 408: astore 17\n 410: aload 17\n 412: ifnonnull 445\n 415: iconst_0\n 416: istore 18\n 418: new #131 // class java/util/LinkedHashMap\n 421: dup\n 422: invokespecial #132 // Method java/util/LinkedHashMap.\"<init>\":()V\n 425: nop\n 426: astore 18\n 428: aload 14\n 430: aload 15\n 432: aload 18\n 434: invokeinterface #162, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 439: pop\n 440: aload 18\n 442: goto 447\n 445: aload 17\n 447: nop\n 448: checkcast #134 // class java/util/Map\n 451: astore 14\n 453: aload 12\n 455: invokestatic #170 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 458: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 461: astore 15\n 463: aload 14\n 465: aload 11\n 467: aload 15\n 469: invokeinterface #162, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 474: pop\n 475: nop\n 476: nop\n 477: goto 168\n 480: nop\n 481: aload_3\n 482: invokestatic #176 // Method kotlin/collections/MapsKt.toList:(Ljava/util/Map;)Ljava/util/List;\n 485: checkcast #42 // class java/lang/Iterable\n 488: astore 4\n 490: iconst_0\n 491: istore 5\n 493: aload 4\n 495: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 500: astore 6\n 502: aload 6\n 504: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 509: ifeq 687\n 512: aload 6\n 514: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 519: astore 7\n 521: iload 5\n 523: aload 7\n 525: checkcast #178 // class kotlin/Pair\n 528: astore 8\n 530: istore 22\n 532: iconst_0\n 533: istore 9\n 535: aload 8\n 537: invokevirtual #181 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 540: checkcast #183 // class java/lang/Number\n 543: invokevirtual #186 // Method java/lang/Number.intValue:()I\n 546: istore 10\n 548: aload 8\n 550: invokevirtual #189 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 553: checkcast #131 // class java/util/LinkedHashMap\n 556: astore 11\n 558: aload 11\n 560: invokevirtual #193 // Method java/util/LinkedHashMap.values:()Ljava/util/Collection;\n 563: dup\n 564: ldc #195 // String <get-values>(...)\n 566: invokestatic #117 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 569: checkcast #42 // class java/lang/Iterable\n 572: invokestatic #199 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 575: astore 12\n 577: iconst_0\n 578: istore 13\n 580: aload 12\n 582: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 587: astore 14\n 589: aload 14\n 591: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 596: ifeq 672\n 599: aload 14\n 601: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 606: astore 15\n 608: iload 13\n 610: aload 15\n 612: checkcast #201 // class kotlin/collections/IndexedValue\n 615: astore 16\n 617: istore 17\n 619: iconst_0\n 620: istore 18\n 622: aload 16\n 624: invokevirtual #203 // Method kotlin/collections/IndexedValue.component1:()I\n 627: istore 19\n 629: aload 16\n 631: invokevirtual #204 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 634: dup\n 635: ldc #206 // String component2(...)\n 637: invokestatic #117 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 640: checkcast #152 // class java/lang/Integer\n 643: astore 20\n 645: iload 19\n 647: iconst_1\n 648: iadd\n 649: aload 20\n 651: invokevirtual #207 // Method java/lang/Integer.intValue:()I\n 654: imul\n 655: iload 10\n 657: iconst_1\n 658: iadd\n 659: imul\n 660: istore 21\n 662: iload 17\n 664: iload 21\n 666: iadd\n 667: istore 13\n 669: goto 589\n 672: iload 13\n 674: nop\n 675: istore 23\n 677: iload 22\n 679: iload 23\n 681: iadd\n 682: istore 5\n 684: goto 502\n 687: iload 5\n 689: invokestatic #92 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 692: areturn\n\n static {};\n Code:\n 0: new #2 // class Day15\n 3: dup\n 4: invokespecial #233 // Method \"<init>\":()V\n 7: putstatic #84 // Field INSTANCE:LDay15;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day1.kt
import kotlin.String import kotlin.collections.List object Day1 { fun part1(input: List<String>): String = input.sumOf(::findFirstAndLastDigit).toString() private fun findFirstAndLastDigit(i: String): Int { val digits = i.filter { it.isDigit() } return (digits.take(1) + digits.takeLast(1)).toInt() } fun part2(input: List<String>): String = input.sumOf(::findFirstAndLastDigitV2).toString() private fun findFirstAndLastDigitV2(i: String): Int { val words = listOf("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine") val newI = words.zip(words.indices) .map { (word, index) -> word to word.first() + index.toString() + word.last() } .fold(i) { acc, (word, replacement) -> acc.replace(word, replacement) } return findFirstAndLastDigit(newI) } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day1.class", "javap": "Compiled from \"Day1.kt\"\npublic final class Day1 {\n public static final Day1 INSTANCE;\n\n private Day1();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_2\n 11: iconst_0\n 12: istore_3\n 13: aload_2\n 14: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 19: astore 4\n 21: aload 4\n 23: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 28: ifeq 70\n 31: aload 4\n 33: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 38: astore 5\n 40: iload_3\n 41: aload 5\n 43: checkcast #40 // class java/lang/String\n 46: astore 6\n 48: istore 8\n 50: iconst_0\n 51: istore 7\n 53: aload_0\n 54: aload 6\n 56: invokespecial #44 // Method findFirstAndLastDigit:(Ljava/lang/String;)I\n 59: istore 9\n 61: iload 8\n 63: iload 9\n 65: iadd\n 66: istore_3\n 67: goto 21\n 70: iload_3\n 71: invokestatic #48 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 74: areturn\n\n private final int findFirstAndLastDigit(java.lang.String);\n Code:\n 0: aload_1\n 1: astore_3\n 2: iconst_0\n 3: istore 4\n 5: aload_3\n 6: checkcast #55 // class java/lang/CharSequence\n 9: astore 5\n 11: new #57 // class java/lang/StringBuilder\n 14: dup\n 15: invokespecial #58 // Method java/lang/StringBuilder.\"<init>\":()V\n 18: checkcast #60 // class java/lang/Appendable\n 21: astore 6\n 23: iconst_0\n 24: istore 7\n 26: iconst_0\n 27: istore 8\n 29: aload 5\n 31: invokeinterface #64, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 36: istore 9\n 38: iload 8\n 40: iload 9\n 42: if_icmpge 88\n 45: aload 5\n 47: iload 8\n 49: invokeinterface #68, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 54: istore 10\n 56: iload 10\n 58: istore 11\n 60: iconst_0\n 61: istore 12\n 63: iload 11\n 65: invokestatic #74 // Method java/lang/Character.isDigit:(C)Z\n 68: nop\n 69: ifeq 82\n 72: aload 6\n 74: iload 10\n 76: invokeinterface #78, 2 // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;\n 81: pop\n 82: iinc 8, 1\n 85: goto 38\n 88: aload 6\n 90: checkcast #57 // class java/lang/StringBuilder\n 93: invokevirtual #82 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 96: astore_2\n 97: new #57 // class java/lang/StringBuilder\n 100: dup\n 101: invokespecial #58 // Method java/lang/StringBuilder.\"<init>\":()V\n 104: aload_2\n 105: iconst_1\n 106: invokestatic #88 // Method kotlin/text/StringsKt.take:(Ljava/lang/String;I)Ljava/lang/String;\n 109: invokevirtual #91 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 112: aload_2\n 113: iconst_1\n 114: invokestatic #94 // Method kotlin/text/StringsKt.takeLast:(Ljava/lang/String;I)Ljava/lang/String;\n 117: invokevirtual #91 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 120: invokevirtual #82 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 123: invokestatic #99 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 126: ireturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_2\n 11: iconst_0\n 12: istore_3\n 13: aload_2\n 14: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 19: astore 4\n 21: aload 4\n 23: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 28: ifeq 70\n 31: aload 4\n 33: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 38: astore 5\n 40: iload_3\n 41: aload 5\n 43: checkcast #40 // class java/lang/String\n 46: astore 6\n 48: istore 8\n 50: iconst_0\n 51: istore 7\n 53: aload_0\n 54: aload 6\n 56: invokespecial #117 // Method findFirstAndLastDigitV2:(Ljava/lang/String;)I\n 59: istore 9\n 61: iload 8\n 63: iload 9\n 65: iadd\n 66: istore_3\n 67: goto 21\n 70: iload_3\n 71: invokestatic #48 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 74: areturn\n\n private final int findFirstAndLastDigitV2(java.lang.String);\n Code:\n 0: bipush 10\n 2: anewarray #40 // class java/lang/String\n 5: astore_3\n 6: aload_3\n 7: iconst_0\n 8: ldc #120 // String zero\n 10: aastore\n 11: aload_3\n 12: iconst_1\n 13: ldc #122 // String one\n 15: aastore\n 16: aload_3\n 17: iconst_2\n 18: ldc #124 // String two\n 20: aastore\n 21: aload_3\n 22: iconst_3\n 23: ldc #126 // String three\n 25: aastore\n 26: aload_3\n 27: iconst_4\n 28: ldc #128 // String four\n 30: aastore\n 31: aload_3\n 32: iconst_5\n 33: ldc #130 // String five\n 35: aastore\n 36: aload_3\n 37: bipush 6\n 39: ldc #132 // String six\n 41: aastore\n 42: aload_3\n 43: bipush 7\n 45: ldc #134 // String seven\n 47: aastore\n 48: aload_3\n 49: bipush 8\n 51: ldc #136 // String eight\n 53: aastore\n 54: aload_3\n 55: bipush 9\n 57: ldc #138 // String nine\n 59: aastore\n 60: aload_3\n 61: invokestatic #144 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 64: astore_2\n 65: aload_2\n 66: checkcast #24 // class java/lang/Iterable\n 69: aload_2\n 70: checkcast #146 // class java/util/Collection\n 73: invokestatic #150 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 76: checkcast #24 // class java/lang/Iterable\n 79: invokestatic #154 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 82: checkcast #24 // class java/lang/Iterable\n 85: astore 4\n 87: nop\n 88: iconst_0\n 89: istore 5\n 91: aload 4\n 93: astore 6\n 95: new #156 // class java/util/ArrayList\n 98: dup\n 99: aload 4\n 101: bipush 10\n 103: invokestatic #160 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 106: invokespecial #163 // Method java/util/ArrayList.\"<init>\":(I)V\n 109: checkcast #146 // class java/util/Collection\n 112: astore 7\n 114: iconst_0\n 115: istore 8\n 117: aload 6\n 119: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 124: astore 9\n 126: aload 9\n 128: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 133: ifeq 260\n 136: aload 9\n 138: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 143: astore 10\n 145: aload 7\n 147: aload 10\n 149: checkcast #165 // class kotlin/Pair\n 152: astore 11\n 154: astore 17\n 156: iconst_0\n 157: istore 12\n 159: aload 11\n 161: invokevirtual #168 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 164: checkcast #40 // class java/lang/String\n 167: astore 13\n 169: aload 11\n 171: invokevirtual #171 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 174: checkcast #173 // class java/lang/Number\n 177: invokevirtual #176 // Method java/lang/Number.intValue:()I\n 180: istore 14\n 182: aload 13\n 184: new #57 // class java/lang/StringBuilder\n 187: dup\n 188: invokespecial #58 // Method java/lang/StringBuilder.\"<init>\":()V\n 191: aload 13\n 193: checkcast #55 // class java/lang/CharSequence\n 196: invokestatic #180 // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C\n 199: istore 15\n 201: iload 14\n 203: invokestatic #48 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 206: astore 16\n 208: new #57 // class java/lang/StringBuilder\n 211: dup\n 212: invokespecial #58 // Method java/lang/StringBuilder.\"<init>\":()V\n 215: iload 15\n 217: invokevirtual #183 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 220: aload 16\n 222: invokevirtual #91 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 225: invokevirtual #82 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 228: invokevirtual #91 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 231: aload 13\n 233: checkcast #55 // class java/lang/CharSequence\n 236: invokestatic #186 // Method kotlin/text/StringsKt.last:(Ljava/lang/CharSequence;)C\n 239: invokevirtual #183 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 242: invokevirtual #82 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 245: invokestatic #192 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 248: aload 17\n 250: swap\n 251: invokeinterface #196, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 256: pop\n 257: goto 126\n 260: aload 7\n 262: checkcast #198 // class java/util/List\n 265: nop\n 266: checkcast #24 // class java/lang/Iterable\n 269: astore 4\n 271: nop\n 272: iconst_0\n 273: istore 5\n 275: aload_1\n 276: astore 6\n 278: aload 4\n 280: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 285: astore 7\n 287: aload 7\n 289: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 294: ifeq 357\n 297: aload 7\n 299: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 304: astore 8\n 306: aload 6\n 308: aload 8\n 310: checkcast #165 // class kotlin/Pair\n 313: astore 9\n 315: astore 10\n 317: iconst_0\n 318: istore 11\n 320: aload 9\n 322: invokevirtual #168 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 325: checkcast #40 // class java/lang/String\n 328: astore 12\n 330: aload 9\n 332: invokevirtual #171 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 335: checkcast #40 // class java/lang/String\n 338: astore 13\n 340: aload 10\n 342: aload 12\n 344: aload 13\n 346: iconst_0\n 347: iconst_4\n 348: aconst_null\n 349: invokestatic #202 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 352: astore 6\n 354: goto 287\n 357: aload 6\n 359: astore_3\n 360: aload_0\n 361: aload_3\n 362: invokespecial #44 // Method findFirstAndLastDigit:(Ljava/lang/String;)I\n 365: ireturn\n\n static {};\n Code:\n 0: new #2 // class Day1\n 3: dup\n 4: invokespecial #226 // Method \"<init>\":()V\n 7: putstatic #229 // Field INSTANCE:LDay1;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day20.kt
object Day20 { enum class ModuleType { BROADCASTER, CONJUNCTION, FLIP_FLOP } enum class PulseType { HIGH, LOW } data class Pulse(val type: PulseType, val sender: String) data class Module( val id: String, val type: ModuleType, val destinations: List<String>, var on: Boolean, val inputs: MutableSet<String> = mutableSetOf(), val lastPulses: MutableMap<String, PulseType> = mutableMapOf() ) { fun process(pulse: Pulse): List<Pair<String, Pulse>> { lastPulses[pulse.sender] = pulse.type return when (type) { ModuleType.BROADCASTER -> destinations.map { it to pulse } ModuleType.CONJUNCTION -> { val typeToSend = if (inputs.map { lastPulses[it] ?: PulseType.LOW }.all { it == PulseType.HIGH }) { PulseType.LOW } else { PulseType.HIGH } destinations.map { it to Pulse(typeToSend, id) } } ModuleType.FLIP_FLOP -> { if (pulse.type == PulseType.HIGH) { emptyList() } else { val typeToSend = if (on) { PulseType.LOW } else { PulseType.HIGH } on = !on destinations.map { it to Pulse(typeToSend, id) } } } } } companion object { fun parse(input: String): Module { val (moduleIdAndType, destinations) = input.split(" -> ") if (moduleIdAndType == "broadcaster") { return Module( "broadcaster", ModuleType.BROADCASTER, destinations.split(", "), true ) } val type = moduleIdAndType.take(1) val id = moduleIdAndType.drop(1) return Module( id, when (type) { "%" -> ModuleType.FLIP_FLOP "&" -> ModuleType.CONJUNCTION else -> throw IllegalArgumentException("Unknown module type: $type") }, destinations.split(", "), type == "&" ) } } } fun part1(input: List<String>): String { val modules = input.map { Module.parse(it) }.associateBy { it.id } modules.forEach { key, value -> value.destinations.forEach { modules[it]?.inputs?.add(key) } } val presses = (1..1000).map { pushButton(modules) }.flatMap { it.values }.reduce { acc, map -> (acc.toList() + map.toList()) .groupBy { it.first } .mapValues { it.value.map { it.second }.sum() } } return presses.values.reduce(Long::times).toString() } private fun pushButton(modules: Map<String, Module>): Map<String, Map<PulseType, Long>> { val initialModule = modules["broadcaster"]!! val initialPulse = Pulse(PulseType.LOW, "broadcaster") val queue = ArrayDeque<Pair<Module?, Pulse>>(listOf(initialModule to initialPulse)) val pulseTypeMap = mutableMapOf<String, MutableMap<PulseType, Long>>() pulseTypeMap["broadcaster"] = mutableMapOf(PulseType.LOW to 1L) while (queue.isNotEmpty()) { val (module, pulse) = queue.removeFirst() val destinations = module?.process(pulse) ?: emptyList() destinations.forEach { (destination, pulse) -> val moduleMap = pulseTypeMap.getOrPut(destination) { mutableMapOf() } moduleMap[pulse.type] = moduleMap.getOrDefault(pulse.type, 0) + 1 } queue.addAll(destinations.map { (destination, pulse) -> modules[destination] to pulse }) } return pulseTypeMap } private fun numberOfButtonPushesUntilLowState(modules: Map<String, Module>, key: String): Long { val initialModule = modules["broadcaster"]!! val initialPulse = Pulse(PulseType.LOW, "broadcaster") val queue = ArrayDeque<Pair<Module?, Pulse>>(listOf(initialModule to initialPulse)) var count = 1L // We know the input to the target is a cond, so we can just find when the inputs to the cond are all high val targetInput = modules.values.find { it.destinations.contains(key) } ?: throw IllegalStateException("Invalid input: $key") val inputsOfTargetInput = targetInput.inputs.toSet() val countWhenHighPulse = mutableMapOf<String, Long>() while (true) { if (countWhenHighPulse.size == inputsOfTargetInput.size) { return countWhenHighPulse.values.reduce(Long::times) } val (module, pulse) = queue.removeFirst() val destinations = module?.process(pulse) ?: emptyList() val destinationsToPulses = destinations.map { (destination, pulse) -> modules[destination] to pulse } destinationsToPulses.forEach { (desination, pulse) -> if ((desination?.id ?: "") == targetInput.id) if (pulse.type == PulseType.HIGH && !countWhenHighPulse.containsKey(module?.id)) { countWhenHighPulse[module!!.id] = count } } queue.addAll(destinationsToPulses) if (queue.isEmpty()) { queue.add(initialModule to initialPulse) count++ } } } fun part2(input: List<String>): String { val modules = input.map { Module.parse(it) }.associateBy { it.id } return numberOfButtonPushesUntilLowState(modules, "rx").toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20$Module.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20$Module {\n public static final Day20$Module$Companion Companion;\n\n private final java.lang.String id;\n\n private final Day20$ModuleType type;\n\n private final java.util.List<java.lang.String> destinations;\n\n private boolean on;\n\n private final java.util.Set<java.lang.String> inputs;\n\n private final java.util.Map<java.lang.String, Day20$PulseType> lastPulses;\n\n public Day20$Module(java.lang.String, Day20$ModuleType, java.util.List<java.lang.String>, boolean, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, Day20$PulseType>);\n Code:\n 0: aload_1\n 1: ldc #10 // String id\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String type\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_3\n 13: ldc #20 // String destinations\n 15: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload 5\n 20: ldc #22 // String inputs\n 22: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 25: aload 6\n 27: ldc #24 // String lastPulses\n 29: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 32: aload_0\n 33: invokespecial #27 // Method java/lang/Object.\"<init>\":()V\n 36: aload_0\n 37: aload_1\n 38: putfield #30 // Field id:Ljava/lang/String;\n 41: aload_0\n 42: aload_2\n 43: putfield #33 // Field type:LDay20$ModuleType;\n 46: aload_0\n 47: aload_3\n 48: putfield #36 // Field destinations:Ljava/util/List;\n 51: aload_0\n 52: iload 4\n 54: putfield #40 // Field on:Z\n 57: aload_0\n 58: aload 5\n 60: putfield #43 // Field inputs:Ljava/util/Set;\n 63: aload_0\n 64: aload 6\n 66: putfield #46 // Field lastPulses:Ljava/util/Map;\n 69: return\n\n public Day20$Module(java.lang.String, Day20$ModuleType, java.util.List, boolean, java.util.Set, java.util.Map, int, kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: iload 7\n 2: bipush 16\n 4: iand\n 5: ifeq 20\n 8: new #51 // class java/util/LinkedHashSet\n 11: dup\n 12: invokespecial #52 // Method java/util/LinkedHashSet.\"<init>\":()V\n 15: checkcast #54 // class java/util/Set\n 18: astore 5\n 20: iload 7\n 22: bipush 32\n 24: iand\n 25: ifeq 40\n 28: new #56 // class java/util/LinkedHashMap\n 31: dup\n 32: invokespecial #57 // Method java/util/LinkedHashMap.\"<init>\":()V\n 35: checkcast #59 // class java/util/Map\n 38: astore 6\n 40: aload_0\n 41: aload_1\n 42: aload_2\n 43: aload_3\n 44: iload 4\n 46: aload 5\n 48: aload 6\n 50: invokespecial #61 // Method \"<init>\":(Ljava/lang/String;LDay20$ModuleType;Ljava/util/List;ZLjava/util/Set;Ljava/util/Map;)V\n 53: return\n\n public final java.lang.String getId();\n Code:\n 0: aload_0\n 1: getfield #30 // Field id:Ljava/lang/String;\n 4: areturn\n\n public final Day20$ModuleType getType();\n Code:\n 0: aload_0\n 1: getfield #33 // Field type:LDay20$ModuleType;\n 4: areturn\n\n public final java.util.List<java.lang.String> getDestinations();\n Code:\n 0: aload_0\n 1: getfield #36 // Field destinations:Ljava/util/List;\n 4: areturn\n\n public final boolean getOn();\n Code:\n 0: aload_0\n 1: getfield #40 // Field on:Z\n 4: ireturn\n\n public final void setOn(boolean);\n Code:\n 0: aload_0\n 1: iload_1\n 2: putfield #40 // Field on:Z\n 5: return\n\n public final java.util.Set<java.lang.String> getInputs();\n Code:\n 0: aload_0\n 1: getfield #43 // Field inputs:Ljava/util/Set;\n 4: areturn\n\n public final java.util.Map<java.lang.String, Day20$PulseType> getLastPulses();\n Code:\n 0: aload_0\n 1: getfield #46 // Field lastPulses:Ljava/util/Map;\n 4: areturn\n\n public final java.util.List<kotlin.Pair<java.lang.String, Day20$Pulse>> process(Day20$Pulse);\n Code:\n 0: aload_1\n 1: ldc #84 // String pulse\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #46 // Field lastPulses:Ljava/util/Map;\n 10: aload_1\n 11: invokevirtual #89 // Method Day20$Pulse.getSender:()Ljava/lang/String;\n 14: aload_1\n 15: invokevirtual #92 // Method Day20$Pulse.getType:()LDay20$PulseType;\n 18: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 23: pop\n 24: aload_0\n 25: getfield #33 // Field type:LDay20$ModuleType;\n 28: getstatic #102 // Field Day20$Module$WhenMappings.$EnumSwitchMapping$0:[I\n 31: swap\n 32: invokevirtual #108 // Method Day20$ModuleType.ordinal:()I\n 35: iaload\n 36: tableswitch { // 1 to 3\n 1: 64\n 2: 167\n 3: 500\n default: 664\n }\n 64: aload_0\n 65: getfield #36 // Field destinations:Ljava/util/List;\n 68: checkcast #110 // class java/lang/Iterable\n 71: astore_2\n 72: iconst_0\n 73: istore_3\n 74: aload_2\n 75: astore 4\n 77: new #112 // class java/util/ArrayList\n 80: dup\n 81: aload_2\n 82: bipush 10\n 84: invokestatic #118 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 87: invokespecial #121 // Method java/util/ArrayList.\"<init>\":(I)V\n 90: checkcast #123 // class java/util/Collection\n 93: astore 5\n 95: iconst_0\n 96: istore 6\n 98: aload 4\n 100: invokeinterface #127, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 105: astore 7\n 107: aload 7\n 109: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 114: ifeq 158\n 117: aload 7\n 119: invokeinterface #136, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 124: astore 8\n 126: aload 5\n 128: aload 8\n 130: checkcast #138 // class java/lang/String\n 133: astore 9\n 135: astore 12\n 137: iconst_0\n 138: istore 10\n 140: aload 9\n 142: aload_1\n 143: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 146: aload 12\n 148: swap\n 149: invokeinterface #148, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 154: pop\n 155: goto 107\n 158: aload 5\n 160: checkcast #150 // class java/util/List\n 163: nop\n 164: goto 672\n 167: aload_0\n 168: getfield #43 // Field inputs:Ljava/util/Set;\n 171: checkcast #110 // class java/lang/Iterable\n 174: astore_3\n 175: iconst_0\n 176: istore 4\n 178: aload_3\n 179: astore 5\n 181: new #112 // class java/util/ArrayList\n 184: dup\n 185: aload_3\n 186: bipush 10\n 188: invokestatic #118 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 191: invokespecial #121 // Method java/util/ArrayList.\"<init>\":(I)V\n 194: checkcast #123 // class java/util/Collection\n 197: astore 6\n 199: iconst_0\n 200: istore 7\n 202: aload 5\n 204: invokeinterface #127, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 209: astore 8\n 211: aload 8\n 213: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 218: ifeq 278\n 221: aload 8\n 223: invokeinterface #136, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 228: astore 9\n 230: aload 6\n 232: aload 9\n 234: checkcast #138 // class java/lang/String\n 237: astore 10\n 239: astore 12\n 241: iconst_0\n 242: istore 11\n 244: aload_0\n 245: getfield #46 // Field lastPulses:Ljava/util/Map;\n 248: aload 10\n 250: invokeinterface #154, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 255: checkcast #156 // class Day20$PulseType\n 258: dup\n 259: ifnonnull 266\n 262: pop\n 263: getstatic #160 // Field Day20$PulseType.LOW:LDay20$PulseType;\n 266: aload 12\n 268: swap\n 269: invokeinterface #148, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 274: pop\n 275: goto 211\n 278: aload 6\n 280: checkcast #150 // class java/util/List\n 283: nop\n 284: checkcast #110 // class java/lang/Iterable\n 287: astore_3\n 288: iconst_0\n 289: istore 4\n 291: aload_3\n 292: instanceof #123 // class java/util/Collection\n 295: ifeq 314\n 298: aload_3\n 299: checkcast #123 // class java/util/Collection\n 302: invokeinterface #163, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 307: ifeq 314\n 310: iconst_1\n 311: goto 372\n 314: aload_3\n 315: invokeinterface #127, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 320: astore 5\n 322: aload 5\n 324: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 329: ifeq 371\n 332: aload 5\n 334: invokeinterface #136, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 339: astore 6\n 341: aload 6\n 343: checkcast #156 // class Day20$PulseType\n 346: astore 7\n 348: iconst_0\n 349: istore 8\n 351: aload 7\n 353: getstatic #166 // Field Day20$PulseType.HIGH:LDay20$PulseType;\n 356: if_acmpne 363\n 359: iconst_1\n 360: goto 364\n 363: iconst_0\n 364: ifne 322\n 367: iconst_0\n 368: goto 372\n 371: iconst_1\n 372: ifeq 381\n 375: getstatic #160 // Field Day20$PulseType.LOW:LDay20$PulseType;\n 378: goto 384\n 381: getstatic #166 // Field Day20$PulseType.HIGH:LDay20$PulseType;\n 384: astore_2\n 385: aload_0\n 386: getfield #36 // Field destinations:Ljava/util/List;\n 389: checkcast #110 // class java/lang/Iterable\n 392: astore_3\n 393: iconst_0\n 394: istore 4\n 396: aload_3\n 397: astore 5\n 399: new #112 // class java/util/ArrayList\n 402: dup\n 403: aload_3\n 404: bipush 10\n 406: invokestatic #118 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 409: invokespecial #121 // Method java/util/ArrayList.\"<init>\":(I)V\n 412: checkcast #123 // class java/util/Collection\n 415: astore 6\n 417: iconst_0\n 418: istore 7\n 420: aload 5\n 422: invokeinterface #127, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 427: astore 8\n 429: aload 8\n 431: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 436: ifeq 491\n 439: aload 8\n 441: invokeinterface #136, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 446: astore 9\n 448: aload 6\n 450: aload 9\n 452: checkcast #138 // class java/lang/String\n 455: astore 10\n 457: astore 12\n 459: iconst_0\n 460: istore 11\n 462: aload 10\n 464: new #86 // class Day20$Pulse\n 467: dup\n 468: aload_2\n 469: aload_0\n 470: getfield #30 // Field id:Ljava/lang/String;\n 473: invokespecial #169 // Method Day20$Pulse.\"<init>\":(LDay20$PulseType;Ljava/lang/String;)V\n 476: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 479: aload 12\n 481: swap\n 482: invokeinterface #148, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 487: pop\n 488: goto 429\n 491: aload 6\n 493: checkcast #150 // class java/util/List\n 496: nop\n 497: goto 672\n 500: aload_1\n 501: invokevirtual #92 // Method Day20$Pulse.getType:()LDay20$PulseType;\n 504: getstatic #166 // Field Day20$PulseType.HIGH:LDay20$PulseType;\n 507: if_acmpne 516\n 510: invokestatic #172 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 513: goto 672\n 516: aload_0\n 517: getfield #40 // Field on:Z\n 520: ifeq 529\n 523: getstatic #160 // Field Day20$PulseType.LOW:LDay20$PulseType;\n 526: goto 532\n 529: getstatic #166 // Field Day20$PulseType.HIGH:LDay20$PulseType;\n 532: astore_2\n 533: aload_0\n 534: aload_0\n 535: getfield #40 // Field on:Z\n 538: ifne 545\n 541: iconst_1\n 542: goto 546\n 545: iconst_0\n 546: putfield #40 // Field on:Z\n 549: aload_0\n 550: getfield #36 // Field destinations:Ljava/util/List;\n 553: checkcast #110 // class java/lang/Iterable\n 556: astore_3\n 557: iconst_0\n 558: istore 4\n 560: aload_3\n 561: astore 5\n 563: new #112 // class java/util/ArrayList\n 566: dup\n 567: aload_3\n 568: bipush 10\n 570: invokestatic #118 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 573: invokespecial #121 // Method java/util/ArrayList.\"<init>\":(I)V\n 576: checkcast #123 // class java/util/Collection\n 579: astore 6\n 581: iconst_0\n 582: istore 7\n 584: aload 5\n 586: invokeinterface #127, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 591: astore 8\n 593: aload 8\n 595: invokeinterface #132, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 600: ifeq 655\n 603: aload 8\n 605: invokeinterface #136, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 610: astore 9\n 612: aload 6\n 614: aload 9\n 616: checkcast #138 // class java/lang/String\n 619: astore 10\n 621: astore 12\n 623: iconst_0\n 624: istore 11\n 626: aload 10\n 628: new #86 // class Day20$Pulse\n 631: dup\n 632: aload_2\n 633: aload_0\n 634: getfield #30 // Field id:Ljava/lang/String;\n 637: invokespecial #169 // Method Day20$Pulse.\"<init>\":(LDay20$PulseType;Ljava/lang/String;)V\n 640: invokestatic #144 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 643: aload 12\n 645: swap\n 646: invokeinterface #148, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 651: pop\n 652: goto 593\n 655: aload 6\n 657: checkcast #150 // class java/util/List\n 660: nop\n 661: goto 672\n 664: new #174 // class kotlin/NoWhenBranchMatchedException\n 667: dup\n 668: invokespecial #175 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 671: athrow\n 672: areturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #30 // Field id:Ljava/lang/String;\n 4: areturn\n\n public final Day20$ModuleType component2();\n Code:\n 0: aload_0\n 1: getfield #33 // Field type:LDay20$ModuleType;\n 4: areturn\n\n public final java.util.List<java.lang.String> component3();\n Code:\n 0: aload_0\n 1: getfield #36 // Field destinations:Ljava/util/List;\n 4: areturn\n\n public final boolean component4();\n Code:\n 0: aload_0\n 1: getfield #40 // Field on:Z\n 4: ireturn\n\n public final java.util.Set<java.lang.String> component5();\n Code:\n 0: aload_0\n 1: getfield #43 // Field inputs:Ljava/util/Set;\n 4: areturn\n\n public final java.util.Map<java.lang.String, Day20$PulseType> component6();\n Code:\n 0: aload_0\n 1: getfield #46 // Field lastPulses:Ljava/util/Map;\n 4: areturn\n\n public final Day20$Module copy(java.lang.String, Day20$ModuleType, java.util.List<java.lang.String>, boolean, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, Day20$PulseType>);\n Code:\n 0: aload_1\n 1: ldc #10 // String id\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String type\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_3\n 13: ldc #20 // String destinations\n 15: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload 5\n 20: ldc #22 // String inputs\n 22: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 25: aload 6\n 27: ldc #24 // String lastPulses\n 29: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 32: new #2 // class Day20$Module\n 35: dup\n 36: aload_1\n 37: aload_2\n 38: aload_3\n 39: iload 4\n 41: aload 5\n 43: aload 6\n 45: invokespecial #61 // Method \"<init>\":(Ljava/lang/String;LDay20$ModuleType;Ljava/util/List;ZLjava/util/Set;Ljava/util/Map;)V\n 48: areturn\n\n public static Day20$Module copy$default(Day20$Module, java.lang.String, Day20$ModuleType, java.util.List, boolean, java.util.Set, java.util.Map, int, java.lang.Object);\n Code:\n 0: iload 7\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #30 // Field id:Ljava/lang/String;\n 11: astore_1\n 12: iload 7\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #33 // Field type:LDay20$ModuleType;\n 23: astore_2\n 24: iload 7\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #36 // Field destinations:Ljava/util/List;\n 35: astore_3\n 36: iload 7\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #40 // Field on:Z\n 48: istore 4\n 50: iload 7\n 52: bipush 16\n 54: iand\n 55: ifeq 64\n 58: aload_0\n 59: getfield #43 // Field inputs:Ljava/util/Set;\n 62: astore 5\n 64: iload 7\n 66: bipush 32\n 68: iand\n 69: ifeq 78\n 72: aload_0\n 73: getfield #46 // Field lastPulses:Ljava/util/Map;\n 76: astore 6\n 78: aload_0\n 79: aload_1\n 80: aload_2\n 81: aload_3\n 82: iload 4\n 84: aload 5\n 86: aload 6\n 88: invokevirtual #209 // Method copy:(Ljava/lang/String;LDay20$ModuleType;Ljava/util/List;ZLjava/util/Set;Ljava/util/Map;)LDay20$Module;\n 91: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #212 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #213 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #215 // String Module(id=\n 9: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #30 // Field id:Ljava/lang/String;\n 16: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #221 // String , type=\n 21: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #33 // Field type:LDay20$ModuleType;\n 28: invokevirtual #224 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #226 // String , destinations=\n 33: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #36 // Field destinations:Ljava/util/List;\n 40: invokevirtual #224 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 43: ldc #228 // String , on=\n 45: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #40 // Field on:Z\n 52: invokevirtual #231 // Method java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;\n 55: ldc #233 // String , inputs=\n 57: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 60: aload_0\n 61: getfield #43 // Field inputs:Ljava/util/Set;\n 64: invokevirtual #224 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 67: ldc #235 // String , lastPulses=\n 69: invokevirtual #219 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 72: aload_0\n 73: getfield #46 // Field lastPulses:Ljava/util/Map;\n 76: invokevirtual #224 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 79: bipush 41\n 81: invokevirtual #238 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 84: invokevirtual #240 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 87: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #30 // Field id:Ljava/lang/String;\n 4: invokevirtual #243 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #33 // Field type:LDay20$ModuleType;\n 16: invokevirtual #244 // Method Day20$ModuleType.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #36 // Field destinations:Ljava/util/List;\n 29: invokevirtual #245 // Method java/lang/Object.hashCode:()I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #40 // Field on:Z\n 42: invokestatic #250 // Method java/lang/Boolean.hashCode:(Z)I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: bipush 31\n 50: imul\n 51: aload_0\n 52: getfield #43 // Field inputs:Ljava/util/Set;\n 55: invokevirtual #245 // Method java/lang/Object.hashCode:()I\n 58: iadd\n 59: istore_1\n 60: iload_1\n 61: bipush 31\n 63: imul\n 64: aload_0\n 65: getfield #46 // Field lastPulses:Ljava/util/Map;\n 68: invokevirtual #245 // Method java/lang/Object.hashCode:()I\n 71: iadd\n 72: istore_1\n 73: iload_1\n 74: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day20$Module\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day20$Module\n 20: astore_2\n 21: aload_0\n 22: getfield #30 // Field id:Ljava/lang/String;\n 25: aload_2\n 26: getfield #30 // Field id:Ljava/lang/String;\n 29: invokestatic #257 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #33 // Field type:LDay20$ModuleType;\n 41: aload_2\n 42: getfield #33 // Field type:LDay20$ModuleType;\n 45: if_acmpeq 50\n 48: iconst_0\n 49: ireturn\n 50: aload_0\n 51: getfield #36 // Field destinations:Ljava/util/List;\n 54: aload_2\n 55: getfield #36 // Field destinations:Ljava/util/List;\n 58: invokestatic #257 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 61: ifne 66\n 64: iconst_0\n 65: ireturn\n 66: aload_0\n 67: getfield #40 // Field on:Z\n 70: aload_2\n 71: getfield #40 // Field on:Z\n 74: if_icmpeq 79\n 77: iconst_0\n 78: ireturn\n 79: aload_0\n 80: getfield #43 // Field inputs:Ljava/util/Set;\n 83: aload_2\n 84: getfield #43 // Field inputs:Ljava/util/Set;\n 87: invokestatic #257 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 90: ifne 95\n 93: iconst_0\n 94: ireturn\n 95: aload_0\n 96: getfield #46 // Field lastPulses:Ljava/util/Map;\n 99: aload_2\n 100: getfield #46 // Field lastPulses:Ljava/util/Map;\n 103: invokestatic #257 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 106: ifne 111\n 109: iconst_0\n 110: ireturn\n 111: iconst_1\n 112: ireturn\n\n static {};\n Code:\n 0: new #261 // class Day20$Module$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #264 // Method Day20$Module$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #268 // Field Companion:LDay20$Module$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20$Pulse.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20$Pulse {\n private final Day20$PulseType type;\n\n private final java.lang.String sender;\n\n public Day20$Pulse(Day20$PulseType, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #9 // String type\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String sender\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #23 // Field type:LDay20$PulseType;\n 21: aload_0\n 22: aload_2\n 23: putfield #26 // Field sender:Ljava/lang/String;\n 26: return\n\n public final Day20$PulseType getType();\n Code:\n 0: aload_0\n 1: getfield #23 // Field type:LDay20$PulseType;\n 4: areturn\n\n public final java.lang.String getSender();\n Code:\n 0: aload_0\n 1: getfield #26 // Field sender:Ljava/lang/String;\n 4: areturn\n\n public final Day20$PulseType component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field type:LDay20$PulseType;\n 4: areturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #26 // Field sender:Ljava/lang/String;\n 4: areturn\n\n public final Day20$Pulse copy(Day20$PulseType, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #9 // String type\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String sender\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day20$Pulse\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: invokespecial #38 // Method \"<init>\":(LDay20$PulseType;Ljava/lang/String;)V\n 21: areturn\n\n public static Day20$Pulse copy$default(Day20$Pulse, Day20$PulseType, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #23 // Field type:LDay20$PulseType;\n 10: astore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #26 // Field sender:Ljava/lang/String;\n 21: astore_2\n 22: aload_0\n 23: aload_1\n 24: aload_2\n 25: invokevirtual #42 // Method copy:(LDay20$PulseType;Ljava/lang/String;)LDay20$Pulse;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #45 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #46 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #48 // String Pulse(type=\n 9: invokevirtual #52 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field type:LDay20$PulseType;\n 16: invokevirtual #55 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #57 // String , sender=\n 21: invokevirtual #52 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #26 // Field sender:Ljava/lang/String;\n 28: invokevirtual #52 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #60 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #62 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field type:LDay20$PulseType;\n 4: invokevirtual #68 // Method Day20$PulseType.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #26 // Field sender:Ljava/lang/String;\n 16: invokevirtual #71 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day20$Pulse\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day20$Pulse\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field type:LDay20$PulseType;\n 25: aload_2\n 26: getfield #23 // Field type:LDay20$PulseType;\n 29: if_acmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #26 // Field sender:Ljava/lang/String;\n 38: aload_2\n 39: getfield #26 // Field sender:Ljava/lang/String;\n 42: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: iconst_1\n 51: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20$ModuleType.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20$ModuleType extends java.lang.Enum<Day20$ModuleType> {\n public static final Day20$ModuleType BROADCASTER;\n\n public static final Day20$ModuleType CONJUNCTION;\n\n public static final Day20$ModuleType FLIP_FLOP;\n\n private static final Day20$ModuleType[] $VALUES;\n\n private static final kotlin.enums.EnumEntries $ENTRIES;\n\n private Day20$ModuleType();\n Code:\n 0: aload_0\n 1: aload_1\n 2: iload_2\n 3: invokespecial #10 // Method java/lang/Enum.\"<init>\":(Ljava/lang/String;I)V\n 6: return\n\n public static Day20$ModuleType[] values();\n Code:\n 0: getstatic #22 // Field $VALUES:[LDay20$ModuleType;\n 3: invokevirtual #28 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 6: checkcast #29 // class \"[LDay20$ModuleType;\"\n 9: areturn\n\n public static Day20$ModuleType valueOf(java.lang.String);\n Code:\n 0: ldc #2 // class Day20$ModuleType\n 2: aload_0\n 3: invokestatic #34 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;\n 6: checkcast #2 // class Day20$ModuleType\n 9: areturn\n\n public static kotlin.enums.EnumEntries<Day20$ModuleType> getEntries();\n Code:\n 0: getstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 3: areturn\n\n private static final Day20$ModuleType[] $values();\n Code:\n 0: iconst_3\n 1: anewarray #2 // class Day20$ModuleType\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: getstatic #47 // Field BROADCASTER:LDay20$ModuleType;\n 10: aastore\n 11: aload_0\n 12: iconst_1\n 13: getstatic #50 // Field CONJUNCTION:LDay20$ModuleType;\n 16: aastore\n 17: aload_0\n 18: iconst_2\n 19: getstatic #53 // Field FLIP_FLOP:LDay20$ModuleType;\n 22: aastore\n 23: aload_0\n 24: areturn\n\n static {};\n Code:\n 0: new #2 // class Day20$ModuleType\n 3: dup\n 4: ldc #55 // String BROADCASTER\n 6: iconst_0\n 7: invokespecial #56 // Method \"<init>\":(Ljava/lang/String;I)V\n 10: putstatic #47 // Field BROADCASTER:LDay20$ModuleType;\n 13: new #2 // class Day20$ModuleType\n 16: dup\n 17: ldc #57 // String CONJUNCTION\n 19: iconst_1\n 20: invokespecial #56 // Method \"<init>\":(Ljava/lang/String;I)V\n 23: putstatic #50 // Field CONJUNCTION:LDay20$ModuleType;\n 26: new #2 // class Day20$ModuleType\n 29: dup\n 30: ldc #58 // String FLIP_FLOP\n 32: iconst_2\n 33: invokespecial #56 // Method \"<init>\":(Ljava/lang/String;I)V\n 36: putstatic #53 // Field FLIP_FLOP:LDay20$ModuleType;\n 39: invokestatic #60 // Method $values:()[LDay20$ModuleType;\n 42: putstatic #22 // Field $VALUES:[LDay20$ModuleType;\n 45: getstatic #22 // Field $VALUES:[LDay20$ModuleType;\n 48: checkcast #62 // class \"[Ljava/lang/Enum;\"\n 51: invokestatic #68 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;\n 54: putstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 57: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20$Module$WhenMappings.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20$Module$WhenMappings {\n public static final int[] $EnumSwitchMapping$0;\n\n static {};\n Code:\n 0: invokestatic #14 // Method Day20$ModuleType.values:()[LDay20$ModuleType;\n 3: arraylength\n 4: newarray int\n 6: astore_0\n 7: nop\n 8: aload_0\n 9: getstatic #18 // Field Day20$ModuleType.BROADCASTER:LDay20$ModuleType;\n 12: invokevirtual #22 // Method Day20$ModuleType.ordinal:()I\n 15: iconst_1\n 16: iastore\n 17: goto 21\n 20: astore_1\n 21: nop\n 22: aload_0\n 23: getstatic #25 // Field Day20$ModuleType.CONJUNCTION:LDay20$ModuleType;\n 26: invokevirtual #22 // Method Day20$ModuleType.ordinal:()I\n 29: iconst_2\n 30: iastore\n 31: goto 35\n 34: astore_1\n 35: nop\n 36: aload_0\n 37: getstatic #28 // Field Day20$ModuleType.FLIP_FLOP:LDay20$ModuleType;\n 40: invokevirtual #22 // Method Day20$ModuleType.ordinal:()I\n 43: iconst_3\n 44: iastore\n 45: goto 49\n 48: astore_1\n 49: aload_0\n 50: putstatic #32 // Field $EnumSwitchMapping$0:[I\n 53: return\n Exception table:\n from to target type\n 7 17 20 Class java/lang/NoSuchFieldError\n 21 31 34 Class java/lang/NoSuchFieldError\n 35 45 48 Class java/lang/NoSuchFieldError\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20$PulseType.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20$PulseType extends java.lang.Enum<Day20$PulseType> {\n public static final Day20$PulseType HIGH;\n\n public static final Day20$PulseType LOW;\n\n private static final Day20$PulseType[] $VALUES;\n\n private static final kotlin.enums.EnumEntries $ENTRIES;\n\n private Day20$PulseType();\n Code:\n 0: aload_0\n 1: aload_1\n 2: iload_2\n 3: invokespecial #10 // Method java/lang/Enum.\"<init>\":(Ljava/lang/String;I)V\n 6: return\n\n public static Day20$PulseType[] values();\n Code:\n 0: getstatic #22 // Field $VALUES:[LDay20$PulseType;\n 3: invokevirtual #28 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 6: checkcast #29 // class \"[LDay20$PulseType;\"\n 9: areturn\n\n public static Day20$PulseType valueOf(java.lang.String);\n Code:\n 0: ldc #2 // class Day20$PulseType\n 2: aload_0\n 3: invokestatic #34 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;\n 6: checkcast #2 // class Day20$PulseType\n 9: areturn\n\n public static kotlin.enums.EnumEntries<Day20$PulseType> getEntries();\n Code:\n 0: getstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 3: areturn\n\n private static final Day20$PulseType[] $values();\n Code:\n 0: iconst_2\n 1: anewarray #2 // class Day20$PulseType\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: getstatic #47 // Field HIGH:LDay20$PulseType;\n 10: aastore\n 11: aload_0\n 12: iconst_1\n 13: getstatic #50 // Field LOW:LDay20$PulseType;\n 16: aastore\n 17: aload_0\n 18: areturn\n\n static {};\n Code:\n 0: new #2 // class Day20$PulseType\n 3: dup\n 4: ldc #52 // String HIGH\n 6: iconst_0\n 7: invokespecial #53 // Method \"<init>\":(Ljava/lang/String;I)V\n 10: putstatic #47 // Field HIGH:LDay20$PulseType;\n 13: new #2 // class Day20$PulseType\n 16: dup\n 17: ldc #54 // String LOW\n 19: iconst_1\n 20: invokespecial #53 // Method \"<init>\":(Ljava/lang/String;I)V\n 23: putstatic #50 // Field LOW:LDay20$PulseType;\n 26: invokestatic #56 // Method $values:()[LDay20$PulseType;\n 29: putstatic #22 // Field $VALUES:[LDay20$PulseType;\n 32: getstatic #22 // Field $VALUES:[LDay20$PulseType;\n 35: checkcast #58 // class \"[Ljava/lang/Enum;\"\n 38: invokestatic #64 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;\n 41: putstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 44: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20 {\n public static final Day20 INSTANCE;\n\n private Day20();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_3\n 11: iconst_0\n 12: istore 4\n 14: aload_3\n 15: astore 5\n 17: new #26 // class java/util/ArrayList\n 20: dup\n 21: aload_3\n 22: bipush 10\n 24: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 27: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 30: checkcast #37 // class java/util/Collection\n 33: astore 6\n 35: iconst_0\n 36: istore 7\n 38: aload 5\n 40: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 8\n 47: aload 8\n 49: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 100\n 57: aload 8\n 59: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 9\n 66: aload 6\n 68: aload 9\n 70: checkcast #53 // class java/lang/String\n 73: astore 10\n 75: astore 38\n 77: iconst_0\n 78: istore 11\n 80: getstatic #59 // Field Day20$Module.Companion:LDay20$Module$Companion;\n 83: aload 10\n 85: invokevirtual #65 // Method Day20$Module$Companion.parse:(Ljava/lang/String;)LDay20$Module;\n 88: aload 38\n 90: swap\n 91: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 96: pop\n 97: goto 47\n 100: aload 6\n 102: checkcast #71 // class java/util/List\n 105: nop\n 106: checkcast #24 // class java/lang/Iterable\n 109: astore_3\n 110: nop\n 111: iconst_0\n 112: istore 4\n 114: aload_3\n 115: bipush 10\n 117: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 120: invokestatic #77 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 123: bipush 16\n 125: invokestatic #83 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 128: istore 5\n 130: aload_3\n 131: astore 6\n 133: new #85 // class java/util/LinkedHashMap\n 136: dup\n 137: iload 5\n 139: invokespecial #86 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 142: checkcast #88 // class java/util/Map\n 145: astore 7\n 147: iconst_0\n 148: istore 8\n 150: aload 6\n 152: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 157: astore 9\n 159: aload 9\n 161: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 166: ifeq 211\n 169: aload 9\n 171: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 176: astore 10\n 178: aload 7\n 180: aload 10\n 182: checkcast #55 // class Day20$Module\n 185: astore 11\n 187: astore 38\n 189: iconst_0\n 190: istore 12\n 192: aload 11\n 194: invokevirtual #92 // Method Day20$Module.getId:()Ljava/lang/String;\n 197: aload 38\n 199: swap\n 200: aload 10\n 202: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 207: pop\n 208: goto 159\n 211: aload 7\n 213: nop\n 214: astore_2\n 215: aload_2\n 216: aload_2\n 217: invokedynamic #115, 0 // InvokeDynamic #0:invoke:(Ljava/util/Map;)Lkotlin/jvm/functions/Function2;\n 222: invokedynamic #126, 0 // InvokeDynamic #1:accept:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiConsumer;\n 227: invokeinterface #130, 2 // InterfaceMethod java/util/Map.forEach:(Ljava/util/function/BiConsumer;)V\n 232: new #132 // class kotlin/ranges/IntRange\n 235: dup\n 236: iconst_1\n 237: sipush 1000\n 240: invokespecial #135 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 243: checkcast #24 // class java/lang/Iterable\n 246: astore 4\n 248: iconst_0\n 249: istore 5\n 251: aload 4\n 253: astore 6\n 255: new #26 // class java/util/ArrayList\n 258: dup\n 259: aload 4\n 261: bipush 10\n 263: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 266: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 269: checkcast #37 // class java/util/Collection\n 272: astore 7\n 274: iconst_0\n 275: istore 8\n 277: aload 6\n 279: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 284: astore 9\n 286: aload 9\n 288: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 293: ifeq 336\n 296: aload 9\n 298: checkcast #137 // class kotlin/collections/IntIterator\n 301: invokevirtual #141 // Method kotlin/collections/IntIterator.nextInt:()I\n 304: istore 10\n 306: aload 7\n 308: iload 10\n 310: istore 11\n 312: astore 38\n 314: iconst_0\n 315: istore 12\n 317: getstatic #144 // Field INSTANCE:LDay20;\n 320: aload_2\n 321: invokespecial #148 // Method pushButton:(Ljava/util/Map;)Ljava/util/Map;\n 324: aload 38\n 326: swap\n 327: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 332: pop\n 333: goto 286\n 336: aload 7\n 338: checkcast #71 // class java/util/List\n 341: nop\n 342: checkcast #24 // class java/lang/Iterable\n 345: astore 4\n 347: nop\n 348: iconst_0\n 349: istore 5\n 351: aload 4\n 353: astore 6\n 355: new #26 // class java/util/ArrayList\n 358: dup\n 359: invokespecial #149 // Method java/util/ArrayList.\"<init>\":()V\n 362: checkcast #37 // class java/util/Collection\n 365: astore 7\n 367: iconst_0\n 368: istore 8\n 370: aload 6\n 372: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 377: astore 9\n 379: aload 9\n 381: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 386: ifeq 431\n 389: aload 9\n 391: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 396: astore 10\n 398: aload 10\n 400: checkcast #88 // class java/util/Map\n 403: astore 11\n 405: iconst_0\n 406: istore 12\n 408: aload 11\n 410: invokeinterface #153, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 415: checkcast #24 // class java/lang/Iterable\n 418: astore 11\n 420: aload 7\n 422: aload 11\n 424: invokestatic #157 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 427: pop\n 428: goto 379\n 431: aload 7\n 433: checkcast #71 // class java/util/List\n 436: nop\n 437: checkcast #24 // class java/lang/Iterable\n 440: astore 4\n 442: nop\n 443: iconst_0\n 444: istore 5\n 446: aload 4\n 448: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 453: astore 6\n 455: aload 6\n 457: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 462: ifne 475\n 465: new #159 // class java/lang/UnsupportedOperationException\n 468: dup\n 469: ldc #161 // String Empty collection can\\'t be reduced.\n 471: invokespecial #164 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 474: athrow\n 475: aload 6\n 477: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 482: astore 7\n 484: aload 6\n 486: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 491: ifeq 957\n 494: aload 7\n 496: aload 6\n 498: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 503: checkcast #88 // class java/util/Map\n 506: astore 8\n 508: checkcast #88 // class java/util/Map\n 511: astore 9\n 513: iconst_0\n 514: istore 10\n 516: aload 9\n 518: invokestatic #168 // Method kotlin/collections/MapsKt.toList:(Ljava/util/Map;)Ljava/util/List;\n 521: checkcast #37 // class java/util/Collection\n 524: aload 8\n 526: invokestatic #168 // Method kotlin/collections/MapsKt.toList:(Ljava/util/Map;)Ljava/util/List;\n 529: checkcast #24 // class java/lang/Iterable\n 532: invokestatic #172 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 535: checkcast #24 // class java/lang/Iterable\n 538: astore 11\n 540: nop\n 541: iconst_0\n 542: istore 12\n 544: aload 11\n 546: astore 13\n 548: new #85 // class java/util/LinkedHashMap\n 551: dup\n 552: invokespecial #173 // Method java/util/LinkedHashMap.\"<init>\":()V\n 555: checkcast #88 // class java/util/Map\n 558: astore 14\n 560: iconst_0\n 561: istore 15\n 563: aload 13\n 565: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 570: astore 16\n 572: aload 16\n 574: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 579: ifeq 687\n 582: aload 16\n 584: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 589: astore 17\n 591: aload 17\n 593: checkcast #175 // class kotlin/Pair\n 596: astore 18\n 598: iconst_0\n 599: istore 19\n 601: aload 18\n 603: invokevirtual #178 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 606: checkcast #180 // class Day20$PulseType\n 609: astore 20\n 611: aload 14\n 613: astore 21\n 615: iconst_0\n 616: istore 22\n 618: aload 21\n 620: aload 20\n 622: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 627: astore 23\n 629: aload 23\n 631: ifnonnull 666\n 634: iconst_0\n 635: istore 24\n 637: new #26 // class java/util/ArrayList\n 640: dup\n 641: invokespecial #149 // Method java/util/ArrayList.\"<init>\":()V\n 644: checkcast #71 // class java/util/List\n 647: astore 24\n 649: aload 21\n 651: aload 20\n 653: aload 24\n 655: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 660: pop\n 661: aload 24\n 663: goto 668\n 666: aload 23\n 668: nop\n 669: checkcast #71 // class java/util/List\n 672: astore 18\n 674: aload 18\n 676: aload 17\n 678: invokeinterface #185, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 683: pop\n 684: goto 572\n 687: aload 14\n 689: nop\n 690: astore 11\n 692: nop\n 693: iconst_0\n 694: istore 12\n 696: aload 11\n 698: astore 13\n 700: new #85 // class java/util/LinkedHashMap\n 703: dup\n 704: aload 11\n 706: invokeinterface #188, 1 // InterfaceMethod java/util/Map.size:()I\n 711: invokestatic #77 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 714: invokespecial #86 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 717: checkcast #88 // class java/util/Map\n 720: astore 14\n 722: iconst_0\n 723: istore 15\n 725: aload 13\n 727: invokeinterface #192, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 732: checkcast #24 // class java/lang/Iterable\n 735: astore 16\n 737: iconst_0\n 738: istore 17\n 740: aload 16\n 742: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 747: astore 18\n 749: aload 18\n 751: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 756: ifeq 947\n 759: aload 18\n 761: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 766: astore 19\n 768: aload 14\n 770: aload 19\n 772: checkcast #194 // class java/util/Map$Entry\n 775: astore 20\n 777: astore 21\n 779: iconst_0\n 780: istore 22\n 782: aload 20\n 784: invokeinterface #197, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 789: aload 21\n 791: swap\n 792: aload 19\n 794: checkcast #194 // class java/util/Map$Entry\n 797: astore 23\n 799: astore 25\n 801: astore 26\n 803: iconst_0\n 804: istore 24\n 806: aload 23\n 808: invokeinterface #200, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 813: checkcast #24 // class java/lang/Iterable\n 816: astore 27\n 818: iconst_0\n 819: istore 28\n 821: aload 27\n 823: astore 29\n 825: new #26 // class java/util/ArrayList\n 828: dup\n 829: aload 27\n 831: bipush 10\n 833: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 836: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 839: checkcast #37 // class java/util/Collection\n 842: astore 30\n 844: iconst_0\n 845: istore 31\n 847: aload 29\n 849: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 854: astore 32\n 856: aload 32\n 858: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 863: ifeq 915\n 866: aload 32\n 868: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 873: astore 33\n 875: aload 30\n 877: aload 33\n 879: checkcast #175 // class kotlin/Pair\n 882: astore 34\n 884: astore 35\n 886: iconst_0\n 887: istore 36\n 889: aload 34\n 891: invokevirtual #203 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 894: checkcast #205 // class java/lang/Number\n 897: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 900: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 903: aload 35\n 905: swap\n 906: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 911: pop\n 912: goto 856\n 915: aload 30\n 917: checkcast #71 // class java/util/List\n 920: nop\n 921: checkcast #24 // class java/lang/Iterable\n 924: invokestatic #219 // Method kotlin/collections/CollectionsKt.sumOfLong:(Ljava/lang/Iterable;)J\n 927: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 930: astore 37\n 932: aload 26\n 934: aload 25\n 936: aload 37\n 938: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 943: pop\n 944: goto 749\n 947: aload 14\n 949: nop\n 950: nop\n 951: nop\n 952: astore 7\n 954: goto 484\n 957: aload 7\n 959: checkcast #88 // class java/util/Map\n 962: astore_3\n 963: aload_3\n 964: invokeinterface #153, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 969: checkcast #24 // class java/lang/Iterable\n 972: astore 4\n 974: iconst_0\n 975: istore 5\n 977: aload 4\n 979: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 984: astore 6\n 986: aload 6\n 988: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 993: ifne 1006\n 996: new #159 // class java/lang/UnsupportedOperationException\n 999: dup\n 1000: ldc #161 // String Empty collection can\\'t be reduced.\n 1002: invokespecial #164 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 1005: athrow\n 1006: aload 6\n 1008: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1013: astore 7\n 1015: aload 6\n 1017: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1022: ifeq 1066\n 1025: aload 7\n 1027: aload 6\n 1029: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1034: checkcast #205 // class java/lang/Number\n 1037: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 1040: lstore 8\n 1042: checkcast #205 // class java/lang/Number\n 1045: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 1048: lstore 10\n 1050: iconst_0\n 1051: istore 12\n 1053: lload 10\n 1055: lload 8\n 1057: lmul\n 1058: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 1061: astore 7\n 1063: goto 1015\n 1066: aload 7\n 1068: checkcast #205 // class java/lang/Number\n 1071: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 1074: invokestatic #222 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 1077: areturn\n\n private final java.util.Map<java.lang.String, java.util.Map<Day20$PulseType, java.lang.Long>> pushButton(java.util.Map<java.lang.String, Day20$Module>);\n Code:\n 0: aload_1\n 1: ldc_w #292 // String broadcaster\n 4: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 9: dup\n 10: invokestatic #296 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 13: checkcast #55 // class Day20$Module\n 16: astore_2\n 17: new #298 // class Day20$Pulse\n 20: dup\n 21: getstatic #302 // Field Day20$PulseType.LOW:LDay20$PulseType;\n 24: ldc_w #292 // String broadcaster\n 27: invokespecial #305 // Method Day20$Pulse.\"<init>\":(LDay20$PulseType;Ljava/lang/String;)V\n 30: astore_3\n 31: new #307 // class kotlin/collections/ArrayDeque\n 34: dup\n 35: aload_2\n 36: aload_3\n 37: invokestatic #313 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 40: invokestatic #317 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 43: checkcast #37 // class java/util/Collection\n 46: invokespecial #320 // Method kotlin/collections/ArrayDeque.\"<init>\":(Ljava/util/Collection;)V\n 49: astore 4\n 51: new #85 // class java/util/LinkedHashMap\n 54: dup\n 55: invokespecial #173 // Method java/util/LinkedHashMap.\"<init>\":()V\n 58: checkcast #88 // class java/util/Map\n 61: astore 5\n 63: aload 5\n 65: astore 6\n 67: ldc_w #292 // String broadcaster\n 70: astore 7\n 72: iconst_1\n 73: anewarray #175 // class kotlin/Pair\n 76: astore 8\n 78: aload 8\n 80: iconst_0\n 81: getstatic #302 // Field Day20$PulseType.LOW:LDay20$PulseType;\n 84: lconst_1\n 85: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 88: invokestatic #313 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 91: aastore\n 92: aload 8\n 94: invokestatic #324 // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 97: astore 8\n 99: aload 6\n 101: aload 7\n 103: aload 8\n 105: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 110: pop\n 111: aload 4\n 113: checkcast #37 // class java/util/Collection\n 116: invokeinterface #327, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 121: ifne 128\n 124: iconst_1\n 125: goto 129\n 128: iconst_0\n 129: ifeq 507\n 132: aload 4\n 134: invokevirtual #330 // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;\n 137: checkcast #175 // class kotlin/Pair\n 140: astore 6\n 142: aload 6\n 144: invokevirtual #333 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 147: checkcast #55 // class Day20$Module\n 150: astore 7\n 152: aload 6\n 154: invokevirtual #336 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 157: checkcast #298 // class Day20$Pulse\n 160: astore 8\n 162: aload 7\n 164: dup\n 165: ifnull 177\n 168: aload 8\n 170: invokevirtual #340 // Method Day20$Module.process:(LDay20$Pulse;)Ljava/util/List;\n 173: dup\n 174: ifnonnull 181\n 177: pop\n 178: invokestatic #344 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 181: astore 9\n 183: aload 9\n 185: checkcast #24 // class java/lang/Iterable\n 188: astore 10\n 190: iconst_0\n 191: istore 11\n 193: aload 10\n 195: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 200: astore 12\n 202: aload 12\n 204: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 209: ifeq 360\n 212: aload 12\n 214: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 219: astore 13\n 221: aload 13\n 223: checkcast #175 // class kotlin/Pair\n 226: astore 14\n 228: iconst_0\n 229: istore 15\n 231: aload 14\n 233: invokevirtual #333 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 236: checkcast #53 // class java/lang/String\n 239: astore 16\n 241: aload 14\n 243: invokevirtual #336 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 246: checkcast #298 // class Day20$Pulse\n 249: astore 17\n 251: aload 5\n 253: astore 18\n 255: iconst_0\n 256: istore 19\n 258: aload 18\n 260: aload 16\n 262: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 267: astore 20\n 269: aload 20\n 271: ifnonnull 307\n 274: iconst_0\n 275: istore 21\n 277: new #85 // class java/util/LinkedHashMap\n 280: dup\n 281: invokespecial #173 // Method java/util/LinkedHashMap.\"<init>\":()V\n 284: checkcast #88 // class java/util/Map\n 287: nop\n 288: astore 21\n 290: aload 18\n 292: aload 16\n 294: aload 21\n 296: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 301: pop\n 302: aload 21\n 304: goto 309\n 307: aload 20\n 309: nop\n 310: checkcast #88 // class java/util/Map\n 313: astore 22\n 315: aload 22\n 317: aload 17\n 319: invokevirtual #348 // Method Day20$Pulse.getType:()LDay20$PulseType;\n 322: aload 22\n 324: aload 17\n 326: invokevirtual #348 // Method Day20$Pulse.getType:()LDay20$PulseType;\n 329: lconst_0\n 330: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 333: invokeinterface #351, 3 // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 338: checkcast #205 // class java/lang/Number\n 341: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 344: lconst_1\n 345: ladd\n 346: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 349: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 354: pop\n 355: nop\n 356: nop\n 357: goto 202\n 360: nop\n 361: aload 4\n 363: aload 9\n 365: checkcast #24 // class java/lang/Iterable\n 368: astore 10\n 370: astore 23\n 372: iconst_0\n 373: istore 11\n 375: aload 10\n 377: astore 12\n 379: new #26 // class java/util/ArrayList\n 382: dup\n 383: aload 10\n 385: bipush 10\n 387: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 390: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 393: checkcast #37 // class java/util/Collection\n 396: astore 13\n 398: iconst_0\n 399: istore 14\n 401: aload 12\n 403: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 408: astore 15\n 410: aload 15\n 412: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 417: ifeq 488\n 420: aload 15\n 422: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 427: astore 16\n 429: aload 13\n 431: aload 16\n 433: checkcast #175 // class kotlin/Pair\n 436: astore 17\n 438: astore 24\n 440: iconst_0\n 441: istore 18\n 443: aload 17\n 445: invokevirtual #333 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 448: checkcast #53 // class java/lang/String\n 451: astore 19\n 453: aload 17\n 455: invokevirtual #336 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 458: checkcast #298 // class Day20$Pulse\n 461: astore 20\n 463: aload_1\n 464: aload 19\n 466: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 471: aload 20\n 473: invokestatic #313 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 476: aload 24\n 478: swap\n 479: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 484: pop\n 485: goto 410\n 488: aload 13\n 490: checkcast #71 // class java/util/List\n 493: nop\n 494: aload 23\n 496: swap\n 497: checkcast #37 // class java/util/Collection\n 500: invokevirtual #354 // Method kotlin/collections/ArrayDeque.addAll:(Ljava/util/Collection;)Z\n 503: pop\n 504: goto 111\n 507: aload 5\n 509: areturn\n\n private final long numberOfButtonPushesUntilLowState(java.util.Map<java.lang.String, Day20$Module>, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc_w #292 // String broadcaster\n 4: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 9: dup\n 10: invokestatic #296 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 13: checkcast #55 // class Day20$Module\n 16: astore_3\n 17: new #298 // class Day20$Pulse\n 20: dup\n 21: getstatic #302 // Field Day20$PulseType.LOW:LDay20$PulseType;\n 24: ldc_w #292 // String broadcaster\n 27: invokespecial #305 // Method Day20$Pulse.\"<init>\":(LDay20$PulseType;Ljava/lang/String;)V\n 30: astore 4\n 32: new #307 // class kotlin/collections/ArrayDeque\n 35: dup\n 36: aload_3\n 37: aload 4\n 39: invokestatic #313 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 42: invokestatic #317 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 45: checkcast #37 // class java/util/Collection\n 48: invokespecial #320 // Method kotlin/collections/ArrayDeque.\"<init>\":(Ljava/util/Collection;)V\n 51: astore 5\n 53: lconst_0\n 54: lstore 26\n 56: lconst_1\n 57: lstore 26\n 59: aload_1\n 60: invokeinterface #153, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 65: checkcast #24 // class java/lang/Iterable\n 68: astore 9\n 70: aload 9\n 72: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 77: astore 10\n 79: aload 10\n 81: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 86: ifeq 127\n 89: aload 10\n 91: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 96: astore 11\n 98: aload 11\n 100: checkcast #55 // class Day20$Module\n 103: astore 12\n 105: iconst_0\n 106: istore 13\n 108: aload 12\n 110: invokevirtual #380 // Method Day20$Module.getDestinations:()Ljava/util/List;\n 113: aload_2\n 114: invokeinterface #383, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 119: ifeq 79\n 122: aload 11\n 124: goto 128\n 127: aconst_null\n 128: checkcast #55 // class Day20$Module\n 131: dup\n 132: ifnonnull 164\n 135: pop\n 136: new #385 // class java/lang/IllegalStateException\n 139: dup\n 140: new #387 // class java/lang/StringBuilder\n 143: dup\n 144: invokespecial #388 // Method java/lang/StringBuilder.\"<init>\":()V\n 147: ldc_w #390 // String Invalid input:\n 150: invokevirtual #394 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 153: aload_2\n 154: invokevirtual #394 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 157: invokevirtual #397 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 160: invokespecial #398 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 163: athrow\n 164: astore 6\n 166: aload 6\n 168: invokevirtual #401 // Method Day20$Module.getInputs:()Ljava/util/Set;\n 171: checkcast #24 // class java/lang/Iterable\n 174: invokestatic #405 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 177: astore 7\n 179: new #85 // class java/util/LinkedHashMap\n 182: dup\n 183: invokespecial #173 // Method java/util/LinkedHashMap.\"<init>\":()V\n 186: checkcast #88 // class java/util/Map\n 189: astore 8\n 191: nop\n 192: aload 8\n 194: invokeinterface #188, 1 // InterfaceMethod java/util/Map.size:()I\n 199: aload 7\n 201: invokeinterface #408, 1 // InterfaceMethod java/util/Set.size:()I\n 206: if_icmpne 322\n 209: aload 8\n 211: invokeinterface #153, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 216: checkcast #24 // class java/lang/Iterable\n 219: astore 9\n 221: iconst_0\n 222: istore 10\n 224: aload 9\n 226: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 231: astore 11\n 233: aload 11\n 235: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 240: ifne 253\n 243: new #159 // class java/lang/UnsupportedOperationException\n 246: dup\n 247: ldc #161 // String Empty collection can\\'t be reduced.\n 249: invokespecial #164 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 252: athrow\n 253: aload 11\n 255: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 260: astore 12\n 262: aload 11\n 264: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 269: ifeq 313\n 272: aload 12\n 274: aload 11\n 276: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 281: checkcast #205 // class java/lang/Number\n 284: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 287: lstore 13\n 289: checkcast #205 // class java/lang/Number\n 292: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 295: lstore 15\n 297: iconst_0\n 298: istore 17\n 300: lload 15\n 302: lload 13\n 304: lmul\n 305: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 308: astore 12\n 310: goto 262\n 313: aload 12\n 315: checkcast #205 // class java/lang/Number\n 318: invokevirtual #209 // Method java/lang/Number.longValue:()J\n 321: lreturn\n 322: aload 5\n 324: invokevirtual #330 // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;\n 327: checkcast #175 // class kotlin/Pair\n 330: astore 9\n 332: aload 9\n 334: invokevirtual #333 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 337: checkcast #55 // class Day20$Module\n 340: astore 10\n 342: aload 9\n 344: invokevirtual #336 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 347: checkcast #298 // class Day20$Pulse\n 350: astore 11\n 352: aload 10\n 354: dup\n 355: ifnull 367\n 358: aload 11\n 360: invokevirtual #340 // Method Day20$Module.process:(LDay20$Pulse;)Ljava/util/List;\n 363: dup\n 364: ifnonnull 371\n 367: pop\n 368: invokestatic #344 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 371: astore 12\n 373: aload 12\n 375: checkcast #24 // class java/lang/Iterable\n 378: astore 14\n 380: iconst_0\n 381: istore 15\n 383: aload 14\n 385: astore 16\n 387: new #26 // class java/util/ArrayList\n 390: dup\n 391: aload 14\n 393: bipush 10\n 395: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 398: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 401: checkcast #37 // class java/util/Collection\n 404: astore 17\n 406: iconst_0\n 407: istore 18\n 409: aload 16\n 411: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 416: astore 19\n 418: aload 19\n 420: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 425: ifeq 496\n 428: aload 19\n 430: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 435: astore 20\n 437: aload 17\n 439: aload 20\n 441: checkcast #175 // class kotlin/Pair\n 444: astore 21\n 446: astore 25\n 448: iconst_0\n 449: istore 22\n 451: aload 21\n 453: invokevirtual #333 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 456: checkcast #53 // class java/lang/String\n 459: astore 23\n 461: aload 21\n 463: invokevirtual #336 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 466: checkcast #298 // class Day20$Pulse\n 469: astore 24\n 471: aload_1\n 472: aload 23\n 474: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 479: aload 24\n 481: invokestatic #313 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 484: aload 25\n 486: swap\n 487: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 492: pop\n 493: goto 418\n 496: aload 17\n 498: checkcast #71 // class java/util/List\n 501: nop\n 502: astore 13\n 504: aload 13\n 506: checkcast #24 // class java/lang/Iterable\n 509: astore 14\n 511: iconst_0\n 512: istore 15\n 514: aload 14\n 516: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 521: astore 16\n 523: aload 16\n 525: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 530: ifeq 662\n 533: aload 16\n 535: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 540: astore 17\n 542: aload 17\n 544: checkcast #175 // class kotlin/Pair\n 547: astore 18\n 549: iconst_0\n 550: istore 19\n 552: aload 18\n 554: invokevirtual #333 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 557: checkcast #55 // class Day20$Module\n 560: astore 20\n 562: aload 18\n 564: invokevirtual #336 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 567: checkcast #298 // class Day20$Pulse\n 570: astore 21\n 572: aload 20\n 574: dup\n 575: ifnull 585\n 578: invokevirtual #92 // Method Day20$Module.getId:()Ljava/lang/String;\n 581: dup\n 582: ifnonnull 589\n 585: pop\n 586: ldc_w #410 // String\n 589: aload 6\n 591: invokevirtual #92 // Method Day20$Module.getId:()Ljava/lang/String;\n 594: invokestatic #414 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 597: ifeq 657\n 600: aload 21\n 602: invokevirtual #348 // Method Day20$Pulse.getType:()LDay20$PulseType;\n 605: getstatic #417 // Field Day20$PulseType.HIGH:LDay20$PulseType;\n 608: if_acmpne 657\n 611: aload 8\n 613: aload 10\n 615: dup\n 616: ifnull 625\n 619: invokevirtual #92 // Method Day20$Module.getId:()Ljava/lang/String;\n 622: goto 627\n 625: pop\n 626: aconst_null\n 627: invokeinterface #420, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 632: ifne 657\n 635: aload 8\n 637: aload 10\n 639: dup\n 640: invokestatic #296 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 643: invokevirtual #92 // Method Day20$Module.getId:()Ljava/lang/String;\n 646: lload 26\n 648: invokestatic #215 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 651: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 656: pop\n 657: nop\n 658: nop\n 659: goto 523\n 662: nop\n 663: aload 5\n 665: aload 13\n 667: checkcast #37 // class java/util/Collection\n 670: invokevirtual #354 // Method kotlin/collections/ArrayDeque.addAll:(Ljava/util/Collection;)Z\n 673: pop\n 674: aload 5\n 676: invokevirtual #421 // Method kotlin/collections/ArrayDeque.isEmpty:()Z\n 679: ifeq 191\n 682: aload 5\n 684: aload_3\n 685: aload 4\n 687: invokestatic #313 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 690: invokevirtual #422 // Method kotlin/collections/ArrayDeque.add:(Ljava/lang/Object;)Z\n 693: pop\n 694: lload 26\n 696: lstore 14\n 698: lload 14\n 700: lconst_1\n 701: ladd\n 702: lstore 26\n 704: goto 191\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_3\n 11: iconst_0\n 12: istore 4\n 14: aload_3\n 15: astore 5\n 17: new #26 // class java/util/ArrayList\n 20: dup\n 21: aload_3\n 22: bipush 10\n 24: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 27: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 30: checkcast #37 // class java/util/Collection\n 33: astore 6\n 35: iconst_0\n 36: istore 7\n 38: aload 5\n 40: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 8\n 47: aload 8\n 49: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 100\n 57: aload 8\n 59: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 9\n 66: aload 6\n 68: aload 9\n 70: checkcast #53 // class java/lang/String\n 73: astore 10\n 75: astore 13\n 77: iconst_0\n 78: istore 11\n 80: getstatic #59 // Field Day20$Module.Companion:LDay20$Module$Companion;\n 83: aload 10\n 85: invokevirtual #65 // Method Day20$Module$Companion.parse:(Ljava/lang/String;)LDay20$Module;\n 88: aload 13\n 90: swap\n 91: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 96: pop\n 97: goto 47\n 100: aload 6\n 102: checkcast #71 // class java/util/List\n 105: nop\n 106: checkcast #24 // class java/lang/Iterable\n 109: astore_3\n 110: nop\n 111: iconst_0\n 112: istore 4\n 114: aload_3\n 115: bipush 10\n 117: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 120: invokestatic #77 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 123: bipush 16\n 125: invokestatic #83 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 128: istore 5\n 130: aload_3\n 131: astore 6\n 133: new #85 // class java/util/LinkedHashMap\n 136: dup\n 137: iload 5\n 139: invokespecial #86 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 142: checkcast #88 // class java/util/Map\n 145: astore 7\n 147: iconst_0\n 148: istore 8\n 150: aload 6\n 152: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 157: astore 9\n 159: aload 9\n 161: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 166: ifeq 211\n 169: aload 9\n 171: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 176: astore 10\n 178: aload 7\n 180: aload 10\n 182: checkcast #55 // class Day20$Module\n 185: astore 11\n 187: astore 13\n 189: iconst_0\n 190: istore 12\n 192: aload 11\n 194: invokevirtual #92 // Method Day20$Module.getId:()Ljava/lang/String;\n 197: aload 13\n 199: swap\n 200: aload 10\n 202: invokeinterface #96, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 207: pop\n 208: goto 159\n 211: aload 7\n 213: nop\n 214: astore_2\n 215: aload_0\n 216: aload_2\n 217: ldc_w #437 // String rx\n 220: invokespecial #439 // Method numberOfButtonPushesUntilLowState:(Ljava/util/Map;Ljava/lang/String;)J\n 223: invokestatic #222 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 226: areturn\n\n private static final kotlin.Unit part1$lambda$3(java.util.Map, java.lang.String, Day20$Module);\n Code:\n 0: aload_1\n 1: ldc_w #442 // String key\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc_w #444 // String value\n 11: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_2\n 15: invokevirtual #380 // Method Day20$Module.getDestinations:()Ljava/util/List;\n 18: checkcast #24 // class java/lang/Iterable\n 21: astore_3\n 22: iconst_0\n 23: istore 4\n 25: aload_3\n 26: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 31: astore 5\n 33: aload 5\n 35: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 40: ifeq 99\n 43: aload 5\n 45: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 50: astore 6\n 52: aload 6\n 54: checkcast #53 // class java/lang/String\n 57: astore 7\n 59: iconst_0\n 60: istore 8\n 62: aload_0\n 63: aload 7\n 65: invokeinterface #184, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 70: checkcast #55 // class Day20$Module\n 73: dup\n 74: ifnull 94\n 77: invokevirtual #401 // Method Day20$Module.getInputs:()Ljava/util/Set;\n 80: dup\n 81: ifnull 94\n 84: aload_1\n 85: invokeinterface #445, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 90: pop\n 91: goto 95\n 94: pop\n 95: nop\n 96: goto 33\n 99: nop\n 100: getstatic #450 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 103: areturn\n\n private static final void part1$lambda$4(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #456, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: pop\n 9: return\n\n static {};\n Code:\n 0: new #2 // class Day20\n 3: dup\n 4: invokespecial #460 // Method \"<init>\":()V\n 7: putstatic #144 // Field INSTANCE:LDay20;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day20$Module$Companion.class", "javap": "Compiled from \"Day20.kt\"\npublic final class Day20$Module$Companion {\n private Day20$Module$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day20$Module parse(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #23 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #25 // class java/lang/String\n 14: astore_3\n 15: aload_3\n 16: iconst_0\n 17: ldc #27 // String ->\n 19: aastore\n 20: aload_3\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: astore_2\n 30: aload_2\n 31: iconst_0\n 32: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 37: checkcast #25 // class java/lang/String\n 40: astore_3\n 41: aload_2\n 42: iconst_1\n 43: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 48: checkcast #25 // class java/lang/String\n 51: astore 4\n 53: aload_3\n 54: ldc #41 // String broadcaster\n 56: invokestatic #45 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 59: ifeq 108\n 62: new #47 // class Day20$Module\n 65: dup\n 66: ldc #41 // String broadcaster\n 68: getstatic #53 // Field Day20$ModuleType.BROADCASTER:LDay20$ModuleType;\n 71: aload 4\n 73: checkcast #23 // class java/lang/CharSequence\n 76: iconst_1\n 77: anewarray #25 // class java/lang/String\n 80: astore 5\n 82: aload 5\n 84: iconst_0\n 85: ldc #55 // String ,\n 87: aastore\n 88: aload 5\n 90: iconst_0\n 91: iconst_0\n 92: bipush 6\n 94: aconst_null\n 95: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 98: iconst_1\n 99: aconst_null\n 100: aconst_null\n 101: bipush 48\n 103: aconst_null\n 104: invokespecial #58 // Method Day20$Module.\"<init>\":(Ljava/lang/String;LDay20$ModuleType;Ljava/util/List;ZLjava/util/Set;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 107: areturn\n 108: aload_3\n 109: iconst_1\n 110: invokestatic #62 // Method kotlin/text/StringsKt.take:(Ljava/lang/String;I)Ljava/lang/String;\n 113: astore 5\n 115: aload_3\n 116: iconst_1\n 117: invokestatic #65 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;\n 120: astore 6\n 122: new #47 // class Day20$Module\n 125: dup\n 126: aload 6\n 128: aload 5\n 130: astore 7\n 132: aload 7\n 134: ldc #67 // String %\n 136: invokestatic #45 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 139: ifeq 148\n 142: getstatic #70 // Field Day20$ModuleType.FLIP_FLOP:LDay20$ModuleType;\n 145: goto 192\n 148: aload 7\n 150: ldc #72 // String &\n 152: invokestatic #45 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 155: ifeq 164\n 158: getstatic #75 // Field Day20$ModuleType.CONJUNCTION:LDay20$ModuleType;\n 161: goto 192\n 164: new #77 // class java/lang/IllegalArgumentException\n 167: dup\n 168: new #79 // class java/lang/StringBuilder\n 171: dup\n 172: invokespecial #80 // Method java/lang/StringBuilder.\"<init>\":()V\n 175: ldc #82 // String Unknown module type:\n 177: invokevirtual #86 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 180: aload 5\n 182: invokevirtual #86 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 185: invokevirtual #90 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 188: invokespecial #93 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 191: athrow\n 192: aload 4\n 194: checkcast #23 // class java/lang/CharSequence\n 197: iconst_1\n 198: anewarray #25 // class java/lang/String\n 201: astore 7\n 203: aload 7\n 205: iconst_0\n 206: ldc #55 // String ,\n 208: aastore\n 209: aload 7\n 211: iconst_0\n 212: iconst_0\n 213: bipush 6\n 215: aconst_null\n 216: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 219: aload 5\n 221: ldc #72 // String &\n 223: invokestatic #45 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 226: aconst_null\n 227: aconst_null\n 228: bipush 48\n 230: aconst_null\n 231: invokespecial #58 // Method Day20$Module.\"<init>\":(Ljava/lang/String;LDay20$ModuleType;Ljava/util/List;ZLjava/util/Set;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V\n 234: areturn\n\n public Day20$Module$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #100 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day3.kt
import kotlin.String import kotlin.collections.List object Day3 { data class NumberPosition( val number: Int, val start: Int, val end: Int, val row: Int ) data class Symbol(val symbol: Char, val coordinate: Coordinate) data class Coordinate(val x: Int, val y: Int) private val reservedSymbol = ".".first() fun part1(input: List<String>): String { val numbers = parseNumbers(input) val specialCharacters = parseSpecialCharacters(input).associateBy { it.coordinate } val partNumbers = numbers.filter { val (_, start, end, row) = it val up = row - 1 val down = row + 1 val left = start - 1 val right = end + 1 val coordinateCandidates = (left..right).flatMap { x -> listOf( Coordinate(x, up), Coordinate(x, down) ) } + listOf(Coordinate(left, row), Coordinate(right, row)) coordinateCandidates.any { specialCharacters.containsKey(it) } } return partNumbers.sumOf { it.number }.toString() } private fun parseNumbers(input: List<String>): List<NumberPosition> { return input.zip(input.indices).flatMap { (line, rowIndex) -> val charArray = line.toCharArray() val withIndexes = charArray.zip(charArray.indices) val deque = ArrayDeque(withIndexes) var buffer = "" var start = 0 var end = 0 val numbers = mutableListOf<NumberPosition>() while (deque.isNotEmpty()) { val (char, index) = deque.removeFirst() if (char.isDigit()) { end = index buffer += char } else { if (buffer.isNotEmpty()) { numbers.add(NumberPosition(buffer.toInt(), start, end, rowIndex)) } buffer = "" start = index + 1 end = index + 1 } } if (buffer.isNotEmpty()) { numbers.add(NumberPosition(buffer.toInt(), start, end, rowIndex)) } numbers } } private fun parseSpecialCharacters(input: List<String>): List<Symbol> { val validSymbols = input.map { it.toCharArray() } .map { it.zip(it.indices) } .map { it.filter { !it.first.isDigit() }.filter { it.first != reservedSymbol } } return validSymbols.zip(validSymbols.indices) .flatMap { (row, rowIndex) -> row.map { Symbol(it.first, Coordinate(it.second, rowIndex)) } } } fun part2(input: List<String>): String { val numbers = parseNumbers(input) val specialCharacters = parseSpecialCharacters(input) val gears = specialCharacters.filter { it.symbol == '*' }.associateBy { it.coordinate } return gears.map { adjacent(it.key, numbers) } .filter { it.size == 2 } .map { it.map { it.number }.reduce { a, b -> a * b } } .sum().toString() } private fun adjacent(it: Coordinate, numbers: List<NumberPosition>): List<NumberPosition> { val up = Coordinate(it.x, it.y - 1) val down = Coordinate(it.x, it.y + 1) val left = Coordinate(it.x - 1, it.y) val right = Coordinate(it.x + 1, it.y) val upLeft = Coordinate(it.x - 1, it.y - 1) val upRight = Coordinate(it.x + 1, it.y - 1) val downLeft = Coordinate(it.x - 1, it.y + 1) val downRight = Coordinate(it.x + 1, it.y + 1) val candidates = listOf(up, down, left, right, upLeft, upRight, downLeft, downRight) return numbers.filter { num -> candidates.any { it.x <= num.end && it.x >= num.start && it.y == num.row } } } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day3$Coordinate.class", "javap": "Compiled from \"Day3.kt\"\npublic final class Day3$Coordinate {\n private final int x;\n\n private final int y;\n\n public Day3$Coordinate(int, int);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: iload_1\n 6: putfield #13 // Field x:I\n 9: aload_0\n 10: iload_2\n 11: putfield #16 // Field y:I\n 14: return\n\n public final int getX();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: ireturn\n\n public final int getY();\n Code:\n 0: aload_0\n 1: getfield #16 // Field y:I\n 4: ireturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: ireturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field y:I\n 4: ireturn\n\n public final Day3$Coordinate copy(int, int);\n Code:\n 0: new #2 // class Day3$Coordinate\n 3: dup\n 4: iload_1\n 5: iload_2\n 6: invokespecial #28 // Method \"<init>\":(II)V\n 9: areturn\n\n public static Day3$Coordinate copy$default(Day3$Coordinate, int, int, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #13 // Field x:I\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #16 // Field y:I\n 21: istore_2\n 22: aload_0\n 23: iload_1\n 24: iload_2\n 25: invokevirtual #32 // Method copy:(II)LDay3$Coordinate;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #37 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #39 // String Coordinate(x=\n 9: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field x:I\n 16: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #48 // String , y=\n 21: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field y:I\n 28: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #51 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: invokestatic #59 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field y:I\n 16: invokestatic #59 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day3$Coordinate\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day3$Coordinate\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field x:I\n 25: aload_2\n 26: getfield #13 // Field x:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #16 // Field y:I\n 38: aload_2\n 39: getfield #16 // Field y:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: iconst_1\n 48: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day3.class", "javap": "Compiled from \"Day3.kt\"\npublic final class Day3 {\n public static final Day3 INSTANCE;\n\n private static final char reservedSymbol;\n\n private Day3();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method parseNumbers:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_0\n 13: aload_1\n 14: invokespecial #29 // Method parseSpecialCharacters:(Ljava/util/List;)Ljava/util/List;\n 17: checkcast #31 // class java/lang/Iterable\n 20: astore 4\n 22: iconst_0\n 23: istore 5\n 25: aload 4\n 27: bipush 10\n 29: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 32: invokestatic #43 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 35: bipush 16\n 37: invokestatic #49 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 40: istore 6\n 42: aload 4\n 44: astore 7\n 46: new #51 // class java/util/LinkedHashMap\n 49: dup\n 50: iload 6\n 52: invokespecial #54 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 55: checkcast #56 // class java/util/Map\n 58: astore 8\n 60: iconst_0\n 61: istore 9\n 63: aload 7\n 65: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 70: astore 10\n 72: aload 10\n 74: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 79: ifeq 124\n 82: aload 10\n 84: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 89: astore 11\n 91: aload 8\n 93: aload 11\n 95: checkcast #72 // class Day3$Symbol\n 98: astore 12\n 100: astore 32\n 102: iconst_0\n 103: istore 13\n 105: aload 12\n 107: invokevirtual #76 // Method Day3$Symbol.getCoordinate:()LDay3$Coordinate;\n 110: aload 32\n 112: swap\n 113: aload 11\n 115: invokeinterface #80, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 120: pop\n 121: goto 72\n 124: aload 8\n 126: nop\n 127: astore_3\n 128: aload_2\n 129: checkcast #31 // class java/lang/Iterable\n 132: astore 5\n 134: iconst_0\n 135: istore 6\n 137: aload 5\n 139: astore 7\n 141: new #82 // class java/util/ArrayList\n 144: dup\n 145: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 148: checkcast #85 // class java/util/Collection\n 151: astore 8\n 153: iconst_0\n 154: istore 9\n 156: aload 7\n 158: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 163: astore 10\n 165: aload 10\n 167: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 172: ifeq 535\n 175: aload 10\n 177: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 182: astore 11\n 184: aload 11\n 186: checkcast #87 // class Day3$NumberPosition\n 189: astore 12\n 191: iconst_0\n 192: istore 13\n 194: aload 12\n 196: invokevirtual #91 // Method Day3$NumberPosition.component2:()I\n 199: istore 14\n 201: aload 12\n 203: invokevirtual #94 // Method Day3$NumberPosition.component3:()I\n 206: istore 15\n 208: aload 12\n 210: invokevirtual #97 // Method Day3$NumberPosition.component4:()I\n 213: istore 16\n 215: iload 16\n 217: iconst_1\n 218: isub\n 219: istore 17\n 221: iload 16\n 223: iconst_1\n 224: iadd\n 225: istore 18\n 227: iload 14\n 229: iconst_1\n 230: isub\n 231: istore 19\n 233: iload 15\n 235: iconst_1\n 236: iadd\n 237: istore 20\n 239: new #99 // class kotlin/ranges/IntRange\n 242: dup\n 243: iload 19\n 245: iload 20\n 247: invokespecial #102 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 250: checkcast #31 // class java/lang/Iterable\n 253: astore 21\n 255: iconst_0\n 256: istore 22\n 258: aload 21\n 260: astore 23\n 262: new #82 // class java/util/ArrayList\n 265: dup\n 266: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 269: checkcast #85 // class java/util/Collection\n 272: astore 24\n 274: iconst_0\n 275: istore 25\n 277: aload 23\n 279: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 284: astore 26\n 286: aload 26\n 288: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 293: ifeq 371\n 296: aload 26\n 298: checkcast #104 // class kotlin/collections/IntIterator\n 301: invokevirtual #107 // Method kotlin/collections/IntIterator.nextInt:()I\n 304: istore 27\n 306: iload 27\n 308: istore 28\n 310: iconst_0\n 311: istore 29\n 313: iconst_2\n 314: anewarray #109 // class Day3$Coordinate\n 317: astore 30\n 319: aload 30\n 321: iconst_0\n 322: new #109 // class Day3$Coordinate\n 325: dup\n 326: iload 28\n 328: iload 17\n 330: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 333: aastore\n 334: aload 30\n 336: iconst_1\n 337: new #109 // class Day3$Coordinate\n 340: dup\n 341: iload 28\n 343: iload 18\n 345: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 348: aastore\n 349: aload 30\n 351: invokestatic #114 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 354: checkcast #31 // class java/lang/Iterable\n 357: nop\n 358: astore 28\n 360: aload 24\n 362: aload 28\n 364: invokestatic #118 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 367: pop\n 368: goto 286\n 371: aload 24\n 373: checkcast #120 // class java/util/List\n 376: nop\n 377: checkcast #85 // class java/util/Collection\n 380: iconst_2\n 381: anewarray #109 // class Day3$Coordinate\n 384: astore 21\n 386: aload 21\n 388: iconst_0\n 389: new #109 // class Day3$Coordinate\n 392: dup\n 393: iload 19\n 395: iload 16\n 397: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 400: aastore\n 401: aload 21\n 403: iconst_1\n 404: new #109 // class Day3$Coordinate\n 407: dup\n 408: iload 20\n 410: iload 16\n 412: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 415: aastore\n 416: aload 21\n 418: invokestatic #114 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 421: checkcast #31 // class java/lang/Iterable\n 424: invokestatic #124 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 427: astore 31\n 429: aload 31\n 431: checkcast #31 // class java/lang/Iterable\n 434: astore 21\n 436: iconst_0\n 437: istore 22\n 439: aload 21\n 441: instanceof #85 // class java/util/Collection\n 444: ifeq 464\n 447: aload 21\n 449: checkcast #85 // class java/util/Collection\n 452: invokeinterface #127, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 457: ifeq 464\n 460: iconst_0\n 461: goto 518\n 464: aload 21\n 466: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 471: astore 23\n 473: aload 23\n 475: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 480: ifeq 517\n 483: aload 23\n 485: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 490: astore 24\n 492: aload 24\n 494: checkcast #109 // class Day3$Coordinate\n 497: astore 25\n 499: iconst_0\n 500: istore 26\n 502: aload_3\n 503: aload 25\n 505: invokeinterface #131, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 510: ifeq 473\n 513: iconst_1\n 514: goto 518\n 517: iconst_0\n 518: nop\n 519: ifeq 165\n 522: aload 8\n 524: aload 11\n 526: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 531: pop\n 532: goto 165\n 535: aload 8\n 537: checkcast #120 // class java/util/List\n 540: nop\n 541: astore 4\n 543: aload 4\n 545: checkcast #31 // class java/lang/Iterable\n 548: astore 5\n 550: iconst_0\n 551: istore 6\n 553: aload 5\n 555: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 560: astore 7\n 562: aload 7\n 564: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 569: ifeq 612\n 572: aload 7\n 574: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 579: astore 8\n 581: iload 6\n 583: aload 8\n 585: checkcast #87 // class Day3$NumberPosition\n 588: astore 9\n 590: istore 32\n 592: iconst_0\n 593: istore 10\n 595: aload 9\n 597: invokevirtual #137 // Method Day3$NumberPosition.getNumber:()I\n 600: istore 33\n 602: iload 32\n 604: iload 33\n 606: iadd\n 607: istore 6\n 609: goto 562\n 612: iload 6\n 614: invokestatic #143 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 617: areturn\n\n private final java.util.List<Day3$NumberPosition> parseNumbers(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #31 // class java/lang/Iterable\n 4: aload_1\n 5: checkcast #85 // class java/util/Collection\n 8: invokestatic #194 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 11: checkcast #31 // class java/lang/Iterable\n 14: invokestatic #198 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 17: checkcast #31 // class java/lang/Iterable\n 20: astore_2\n 21: iconst_0\n 22: istore_3\n 23: aload_2\n 24: astore 4\n 26: new #82 // class java/util/ArrayList\n 29: dup\n 30: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 33: checkcast #85 // class java/util/Collection\n 36: astore 5\n 38: iconst_0\n 39: istore 6\n 41: aload 4\n 43: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 7\n 50: aload 7\n 52: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 391\n 60: aload 7\n 62: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 8\n 69: aload 8\n 71: checkcast #200 // class kotlin/Pair\n 74: astore 9\n 76: iconst_0\n 77: istore 10\n 79: aload 9\n 81: invokevirtual #203 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 84: checkcast #139 // class java/lang/String\n 87: astore 11\n 89: aload 9\n 91: invokevirtual #205 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 94: checkcast #207 // class java/lang/Number\n 97: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 100: istore 12\n 102: aload 11\n 104: invokevirtual #214 // Method java/lang/String.toCharArray:()[C\n 107: dup\n 108: ldc #216 // String toCharArray(...)\n 110: invokestatic #219 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 113: astore 13\n 115: aload 13\n 117: aload 13\n 119: invokestatic #224 // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;\n 122: checkcast #31 // class java/lang/Iterable\n 125: invokestatic #227 // Method kotlin/collections/ArraysKt.zip:([CLjava/lang/Iterable;)Ljava/util/List;\n 128: astore 14\n 130: new #229 // class kotlin/collections/ArrayDeque\n 133: dup\n 134: aload 14\n 136: checkcast #85 // class java/util/Collection\n 139: invokespecial #232 // Method kotlin/collections/ArrayDeque.\"<init>\":(Ljava/util/Collection;)V\n 142: astore 15\n 144: ldc #234 // String\n 146: astore 16\n 148: iconst_0\n 149: istore 17\n 151: iconst_0\n 152: istore 18\n 154: new #82 // class java/util/ArrayList\n 157: dup\n 158: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 161: checkcast #120 // class java/util/List\n 164: astore 19\n 166: aload 15\n 168: checkcast #85 // class java/util/Collection\n 171: invokeinterface #127, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 176: ifne 183\n 179: iconst_1\n 180: goto 184\n 183: iconst_0\n 184: ifeq 326\n 187: aload 15\n 189: invokevirtual #237 // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;\n 192: checkcast #200 // class kotlin/Pair\n 195: astore 20\n 197: aload 20\n 199: invokevirtual #203 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 202: checkcast #239 // class java/lang/Character\n 205: invokevirtual #243 // Method java/lang/Character.charValue:()C\n 208: istore 21\n 210: aload 20\n 212: invokevirtual #205 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 215: checkcast #207 // class java/lang/Number\n 218: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 221: istore 22\n 223: iload 21\n 225: invokestatic #247 // Method java/lang/Character.isDigit:(C)Z\n 228: ifeq 260\n 231: iload 22\n 233: istore 18\n 235: new #249 // class java/lang/StringBuilder\n 238: dup\n 239: invokespecial #250 // Method java/lang/StringBuilder.\"<init>\":()V\n 242: aload 16\n 244: invokevirtual #254 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 247: iload 21\n 249: invokevirtual #257 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 252: invokevirtual #261 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 255: astore 16\n 257: goto 166\n 260: aload 16\n 262: checkcast #263 // class java/lang/CharSequence\n 265: invokeinterface #266, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 270: ifle 277\n 273: iconst_1\n 274: goto 278\n 277: iconst_0\n 278: ifeq 307\n 281: aload 19\n 283: new #87 // class Day3$NumberPosition\n 286: dup\n 287: aload 16\n 289: invokestatic #272 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 292: iload 17\n 294: iload 18\n 296: iload 12\n 298: invokespecial #275 // Method Day3$NumberPosition.\"<init>\":(IIII)V\n 301: invokeinterface #276, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 306: pop\n 307: ldc #234 // String\n 309: astore 16\n 311: iload 22\n 313: iconst_1\n 314: iadd\n 315: istore 17\n 317: iload 22\n 319: iconst_1\n 320: iadd\n 321: istore 18\n 323: goto 166\n 326: aload 16\n 328: checkcast #263 // class java/lang/CharSequence\n 331: invokeinterface #266, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 336: ifle 343\n 339: iconst_1\n 340: goto 344\n 343: iconst_0\n 344: ifeq 373\n 347: aload 19\n 349: new #87 // class Day3$NumberPosition\n 352: dup\n 353: aload 16\n 355: invokestatic #272 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 358: iload 17\n 360: iload 18\n 362: iload 12\n 364: invokespecial #275 // Method Day3$NumberPosition.\"<init>\":(IIII)V\n 367: invokeinterface #276, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 372: pop\n 373: aload 19\n 375: checkcast #31 // class java/lang/Iterable\n 378: astore 9\n 380: aload 5\n 382: aload 9\n 384: invokestatic #118 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 387: pop\n 388: goto 50\n 391: aload 5\n 393: checkcast #120 // class java/util/List\n 396: nop\n 397: areturn\n\n private final java.util.List<Day3$Symbol> parseSpecialCharacters(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #31 // class java/lang/Iterable\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: astore 5\n 11: new #82 // class java/util/ArrayList\n 14: dup\n 15: aload_3\n 16: bipush 10\n 18: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 21: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 24: checkcast #85 // class java/util/Collection\n 27: astore 6\n 29: iconst_0\n 30: istore 7\n 32: aload 5\n 34: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 39: astore 8\n 41: aload 8\n 43: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 48: ifeq 98\n 51: aload 8\n 53: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 58: astore 9\n 60: aload 6\n 62: aload 9\n 64: checkcast #139 // class java/lang/String\n 67: astore 10\n 69: astore 24\n 71: iconst_0\n 72: istore 11\n 74: aload 10\n 76: invokevirtual #214 // Method java/lang/String.toCharArray:()[C\n 79: dup\n 80: ldc #216 // String toCharArray(...)\n 82: invokestatic #219 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 85: nop\n 86: aload 24\n 88: swap\n 89: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 94: pop\n 95: goto 41\n 98: aload 6\n 100: checkcast #120 // class java/util/List\n 103: nop\n 104: checkcast #31 // class java/lang/Iterable\n 107: astore_3\n 108: nop\n 109: iconst_0\n 110: istore 4\n 112: aload_3\n 113: astore 5\n 115: new #82 // class java/util/ArrayList\n 118: dup\n 119: aload_3\n 120: bipush 10\n 122: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 125: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 128: checkcast #85 // class java/util/Collection\n 131: astore 6\n 133: iconst_0\n 134: istore 7\n 136: aload 5\n 138: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 143: astore 8\n 145: aload 8\n 147: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 152: ifeq 203\n 155: aload 8\n 157: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 162: astore 9\n 164: aload 6\n 166: aload 9\n 168: checkcast #290 // class \"[C\"\n 171: astore 10\n 173: astore 24\n 175: iconst_0\n 176: istore 11\n 178: aload 10\n 180: aload 10\n 182: invokestatic #224 // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;\n 185: checkcast #31 // class java/lang/Iterable\n 188: invokestatic #227 // Method kotlin/collections/ArraysKt.zip:([CLjava/lang/Iterable;)Ljava/util/List;\n 191: aload 24\n 193: swap\n 194: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 199: pop\n 200: goto 145\n 203: aload 6\n 205: checkcast #120 // class java/util/List\n 208: nop\n 209: checkcast #31 // class java/lang/Iterable\n 212: astore_3\n 213: nop\n 214: iconst_0\n 215: istore 4\n 217: aload_3\n 218: astore 5\n 220: new #82 // class java/util/ArrayList\n 223: dup\n 224: aload_3\n 225: bipush 10\n 227: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 230: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 233: checkcast #85 // class java/util/Collection\n 236: astore 6\n 238: iconst_0\n 239: istore 7\n 241: aload 5\n 243: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 248: astore 8\n 250: aload 8\n 252: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 257: ifeq 517\n 260: aload 8\n 262: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 267: astore 9\n 269: aload 6\n 271: aload 9\n 273: checkcast #120 // class java/util/List\n 276: astore 10\n 278: astore 24\n 280: iconst_0\n 281: istore 11\n 283: aload 10\n 285: checkcast #31 // class java/lang/Iterable\n 288: astore 12\n 290: iconst_0\n 291: istore 13\n 293: aload 12\n 295: astore 14\n 297: new #82 // class java/util/ArrayList\n 300: dup\n 301: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 304: checkcast #85 // class java/util/Collection\n 307: astore 15\n 309: iconst_0\n 310: istore 16\n 312: aload 14\n 314: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 319: astore 17\n 321: aload 17\n 323: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 328: ifeq 388\n 331: aload 17\n 333: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 338: astore 18\n 340: aload 18\n 342: checkcast #200 // class kotlin/Pair\n 345: astore 19\n 347: iconst_0\n 348: istore 20\n 350: aload 19\n 352: invokevirtual #295 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 355: checkcast #239 // class java/lang/Character\n 358: invokevirtual #243 // Method java/lang/Character.charValue:()C\n 361: invokestatic #247 // Method java/lang/Character.isDigit:(C)Z\n 364: ifne 371\n 367: iconst_1\n 368: goto 372\n 371: iconst_0\n 372: ifeq 321\n 375: aload 15\n 377: aload 18\n 379: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 384: pop\n 385: goto 321\n 388: aload 15\n 390: checkcast #120 // class java/util/List\n 393: nop\n 394: checkcast #31 // class java/lang/Iterable\n 397: astore 12\n 399: nop\n 400: iconst_0\n 401: istore 13\n 403: aload 12\n 405: astore 14\n 407: new #82 // class java/util/ArrayList\n 410: dup\n 411: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 414: checkcast #85 // class java/util/Collection\n 417: astore 15\n 419: iconst_0\n 420: istore 16\n 422: aload 14\n 424: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 429: astore 17\n 431: aload 17\n 433: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 438: ifeq 498\n 441: aload 17\n 443: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 448: astore 18\n 450: aload 18\n 452: checkcast #200 // class kotlin/Pair\n 455: astore 19\n 457: iconst_0\n 458: istore 20\n 460: aload 19\n 462: invokevirtual #295 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 465: checkcast #239 // class java/lang/Character\n 468: invokevirtual #243 // Method java/lang/Character.charValue:()C\n 471: getstatic #298 // Field reservedSymbol:C\n 474: if_icmpeq 481\n 477: iconst_1\n 478: goto 482\n 481: iconst_0\n 482: ifeq 431\n 485: aload 15\n 487: aload 18\n 489: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 494: pop\n 495: goto 431\n 498: aload 15\n 500: checkcast #120 // class java/util/List\n 503: nop\n 504: nop\n 505: aload 24\n 507: swap\n 508: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 513: pop\n 514: goto 250\n 517: aload 6\n 519: checkcast #120 // class java/util/List\n 522: nop\n 523: astore_2\n 524: aload_2\n 525: checkcast #31 // class java/lang/Iterable\n 528: aload_2\n 529: checkcast #85 // class java/util/Collection\n 532: invokestatic #194 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 535: checkcast #31 // class java/lang/Iterable\n 538: invokestatic #198 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 541: checkcast #31 // class java/lang/Iterable\n 544: astore_3\n 545: nop\n 546: iconst_0\n 547: istore 4\n 549: aload_3\n 550: astore 5\n 552: new #82 // class java/util/ArrayList\n 555: dup\n 556: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 559: checkcast #85 // class java/util/Collection\n 562: astore 6\n 564: iconst_0\n 565: istore 7\n 567: aload 5\n 569: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 574: astore 8\n 576: aload 8\n 578: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 583: ifeq 779\n 586: aload 8\n 588: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 593: astore 9\n 595: aload 9\n 597: checkcast #200 // class kotlin/Pair\n 600: astore 10\n 602: iconst_0\n 603: istore 11\n 605: aload 10\n 607: invokevirtual #203 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 610: checkcast #120 // class java/util/List\n 613: astore 12\n 615: aload 10\n 617: invokevirtual #205 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 620: checkcast #207 // class java/lang/Number\n 623: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 626: istore 13\n 628: aload 12\n 630: checkcast #31 // class java/lang/Iterable\n 633: astore 14\n 635: iconst_0\n 636: istore 15\n 638: aload 14\n 640: astore 16\n 642: new #82 // class java/util/ArrayList\n 645: dup\n 646: aload 14\n 648: bipush 10\n 650: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 653: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 656: checkcast #85 // class java/util/Collection\n 659: astore 17\n 661: iconst_0\n 662: istore 18\n 664: aload 16\n 666: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 671: astore 19\n 673: aload 19\n 675: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 680: ifeq 756\n 683: aload 19\n 685: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 690: astore 20\n 692: aload 17\n 694: aload 20\n 696: checkcast #200 // class kotlin/Pair\n 699: astore 21\n 701: astore 22\n 703: iconst_0\n 704: istore 23\n 706: new #72 // class Day3$Symbol\n 709: dup\n 710: aload 21\n 712: invokevirtual #295 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 715: checkcast #239 // class java/lang/Character\n 718: invokevirtual #243 // Method java/lang/Character.charValue:()C\n 721: new #109 // class Day3$Coordinate\n 724: dup\n 725: aload 21\n 727: invokevirtual #301 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 730: checkcast #207 // class java/lang/Number\n 733: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 736: iload 13\n 738: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 741: invokespecial #304 // Method Day3$Symbol.\"<init>\":(CLDay3$Coordinate;)V\n 744: aload 22\n 746: swap\n 747: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 752: pop\n 753: goto 673\n 756: aload 17\n 758: checkcast #120 // class java/util/List\n 761: nop\n 762: checkcast #31 // class java/lang/Iterable\n 765: nop\n 766: astore 10\n 768: aload 6\n 770: aload 10\n 772: invokestatic #118 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 775: pop\n 776: goto 576\n 779: aload 6\n 781: checkcast #120 // class java/util/List\n 784: nop\n 785: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method parseNumbers:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_0\n 13: aload_1\n 14: invokespecial #29 // Method parseSpecialCharacters:(Ljava/util/List;)Ljava/util/List;\n 17: astore_3\n 18: aload_3\n 19: checkcast #31 // class java/lang/Iterable\n 22: astore 5\n 24: iconst_0\n 25: istore 6\n 27: aload 5\n 29: astore 7\n 31: new #82 // class java/util/ArrayList\n 34: dup\n 35: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 38: checkcast #85 // class java/util/Collection\n 41: astore 8\n 43: iconst_0\n 44: istore 9\n 46: aload 7\n 48: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 53: astore 10\n 55: aload 10\n 57: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 62: ifeq 115\n 65: aload 10\n 67: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 72: astore 11\n 74: aload 11\n 76: checkcast #72 // class Day3$Symbol\n 79: astore 12\n 81: iconst_0\n 82: istore 13\n 84: aload 12\n 86: invokevirtual #322 // Method Day3$Symbol.getSymbol:()C\n 89: bipush 42\n 91: if_icmpne 98\n 94: iconst_1\n 95: goto 99\n 98: iconst_0\n 99: ifeq 55\n 102: aload 8\n 104: aload 11\n 106: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 111: pop\n 112: goto 55\n 115: aload 8\n 117: checkcast #120 // class java/util/List\n 120: nop\n 121: checkcast #31 // class java/lang/Iterable\n 124: astore 5\n 126: nop\n 127: iconst_0\n 128: istore 6\n 130: aload 5\n 132: bipush 10\n 134: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 137: invokestatic #43 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 140: bipush 16\n 142: invokestatic #49 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 145: istore 7\n 147: aload 5\n 149: astore 8\n 151: new #51 // class java/util/LinkedHashMap\n 154: dup\n 155: iload 7\n 157: invokespecial #54 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 160: checkcast #56 // class java/util/Map\n 163: astore 9\n 165: iconst_0\n 166: istore 10\n 168: aload 8\n 170: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 175: astore 11\n 177: aload 11\n 179: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 184: ifeq 229\n 187: aload 11\n 189: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 194: astore 12\n 196: aload 9\n 198: aload 12\n 200: checkcast #72 // class Day3$Symbol\n 203: astore 13\n 205: astore 24\n 207: iconst_0\n 208: istore 14\n 210: aload 13\n 212: invokevirtual #76 // Method Day3$Symbol.getCoordinate:()LDay3$Coordinate;\n 215: aload 24\n 217: swap\n 218: aload 12\n 220: invokeinterface #80, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 225: pop\n 226: goto 177\n 229: aload 9\n 231: nop\n 232: astore 4\n 234: aload 4\n 236: astore 5\n 238: iconst_0\n 239: istore 6\n 241: aload 5\n 243: astore 7\n 245: new #82 // class java/util/ArrayList\n 248: dup\n 249: aload 5\n 251: invokeinterface #325, 1 // InterfaceMethod java/util/Map.size:()I\n 256: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 259: checkcast #85 // class java/util/Collection\n 262: astore 8\n 264: iconst_0\n 265: istore 9\n 267: aload 7\n 269: invokeinterface #329, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 274: invokeinterface #332, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 279: astore 10\n 281: aload 10\n 283: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 288: ifeq 343\n 291: aload 10\n 293: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 298: checkcast #334 // class java/util/Map$Entry\n 301: astore 11\n 303: aload 8\n 305: aload 11\n 307: astore 12\n 309: astore 24\n 311: iconst_0\n 312: istore 13\n 314: getstatic #337 // Field INSTANCE:LDay3;\n 317: aload 12\n 319: invokeinterface #340, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 324: checkcast #109 // class Day3$Coordinate\n 327: aload_2\n 328: invokespecial #344 // Method adjacent:(LDay3$Coordinate;Ljava/util/List;)Ljava/util/List;\n 331: aload 24\n 333: swap\n 334: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 339: pop\n 340: goto 281\n 343: aload 8\n 345: checkcast #120 // class java/util/List\n 348: nop\n 349: checkcast #31 // class java/lang/Iterable\n 352: astore 5\n 354: nop\n 355: iconst_0\n 356: istore 6\n 358: aload 5\n 360: astore 7\n 362: new #82 // class java/util/ArrayList\n 365: dup\n 366: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 369: checkcast #85 // class java/util/Collection\n 372: astore 8\n 374: iconst_0\n 375: istore 9\n 377: aload 7\n 379: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 384: astore 10\n 386: aload 10\n 388: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 393: ifeq 447\n 396: aload 10\n 398: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 403: astore 11\n 405: aload 11\n 407: checkcast #120 // class java/util/List\n 410: astore 12\n 412: iconst_0\n 413: istore 13\n 415: aload 12\n 417: invokeinterface #345, 1 // InterfaceMethod java/util/List.size:()I\n 422: iconst_2\n 423: if_icmpne 430\n 426: iconst_1\n 427: goto 431\n 430: iconst_0\n 431: ifeq 386\n 434: aload 8\n 436: aload 11\n 438: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 443: pop\n 444: goto 386\n 447: aload 8\n 449: checkcast #120 // class java/util/List\n 452: nop\n 453: checkcast #31 // class java/lang/Iterable\n 456: astore 5\n 458: nop\n 459: iconst_0\n 460: istore 6\n 462: aload 5\n 464: astore 7\n 466: new #82 // class java/util/ArrayList\n 469: dup\n 470: aload 5\n 472: bipush 10\n 474: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 477: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 480: checkcast #85 // class java/util/Collection\n 483: astore 8\n 485: iconst_0\n 486: istore 9\n 488: aload 7\n 490: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 495: astore 10\n 497: aload 10\n 499: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 504: ifeq 757\n 507: aload 10\n 509: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 514: astore 11\n 516: aload 8\n 518: aload 11\n 520: checkcast #120 // class java/util/List\n 523: astore 12\n 525: astore 24\n 527: iconst_0\n 528: istore 13\n 530: aload 12\n 532: checkcast #31 // class java/lang/Iterable\n 535: astore 14\n 537: iconst_0\n 538: istore 15\n 540: aload 14\n 542: astore 16\n 544: new #82 // class java/util/ArrayList\n 547: dup\n 548: aload 14\n 550: bipush 10\n 552: invokestatic #37 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 555: invokespecial #292 // Method java/util/ArrayList.\"<init>\":(I)V\n 558: checkcast #85 // class java/util/Collection\n 561: astore 17\n 563: iconst_0\n 564: istore 18\n 566: aload 16\n 568: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 573: astore 19\n 575: aload 19\n 577: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 582: ifeq 628\n 585: aload 19\n 587: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 592: astore 20\n 594: aload 17\n 596: aload 20\n 598: checkcast #87 // class Day3$NumberPosition\n 601: astore 21\n 603: astore 22\n 605: iconst_0\n 606: istore 23\n 608: aload 21\n 610: invokevirtual #137 // Method Day3$NumberPosition.getNumber:()I\n 613: invokestatic #348 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 616: aload 22\n 618: swap\n 619: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 624: pop\n 625: goto 575\n 628: aload 17\n 630: checkcast #120 // class java/util/List\n 633: nop\n 634: checkcast #31 // class java/lang/Iterable\n 637: astore 14\n 639: nop\n 640: iconst_0\n 641: istore 15\n 643: aload 14\n 645: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 650: astore 16\n 652: aload 16\n 654: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 659: ifne 673\n 662: new #350 // class java/lang/UnsupportedOperationException\n 665: dup\n 666: ldc_w #352 // String Empty collection can\\'t be reduced.\n 669: invokespecial #355 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 672: athrow\n 673: aload 16\n 675: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 680: astore 17\n 682: aload 16\n 684: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 689: ifeq 733\n 692: aload 17\n 694: aload 16\n 696: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 701: checkcast #207 // class java/lang/Number\n 704: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 707: istore 18\n 709: checkcast #207 // class java/lang/Number\n 712: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 715: istore 19\n 717: iconst_0\n 718: istore 20\n 720: iload 19\n 722: iload 18\n 724: imul\n 725: invokestatic #348 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 728: astore 17\n 730: goto 682\n 733: aload 17\n 735: checkcast #207 // class java/lang/Number\n 738: invokevirtual #210 // Method java/lang/Number.intValue:()I\n 741: nop\n 742: invokestatic #348 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 745: aload 24\n 747: swap\n 748: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 753: pop\n 754: goto 497\n 757: aload 8\n 759: checkcast #120 // class java/util/List\n 762: nop\n 763: checkcast #31 // class java/lang/Iterable\n 766: invokestatic #359 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 769: invokestatic #143 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 772: areturn\n\n private final java.util.List<Day3$NumberPosition> adjacent(Day3$Coordinate, java.util.List<Day3$NumberPosition>);\n Code:\n 0: new #109 // class Day3$Coordinate\n 3: dup\n 4: aload_1\n 5: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 8: aload_1\n 9: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 12: iconst_1\n 13: isub\n 14: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 17: astore_3\n 18: new #109 // class Day3$Coordinate\n 21: dup\n 22: aload_1\n 23: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 26: aload_1\n 27: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 30: iconst_1\n 31: iadd\n 32: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 35: astore 4\n 37: new #109 // class Day3$Coordinate\n 40: dup\n 41: aload_1\n 42: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 45: iconst_1\n 46: isub\n 47: aload_1\n 48: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 51: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 54: astore 5\n 56: new #109 // class Day3$Coordinate\n 59: dup\n 60: aload_1\n 61: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 64: iconst_1\n 65: iadd\n 66: aload_1\n 67: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 70: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 73: astore 6\n 75: new #109 // class Day3$Coordinate\n 78: dup\n 79: aload_1\n 80: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 83: iconst_1\n 84: isub\n 85: aload_1\n 86: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 89: iconst_1\n 90: isub\n 91: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 94: astore 7\n 96: new #109 // class Day3$Coordinate\n 99: dup\n 100: aload_1\n 101: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 104: iconst_1\n 105: iadd\n 106: aload_1\n 107: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 110: iconst_1\n 111: isub\n 112: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 115: astore 8\n 117: new #109 // class Day3$Coordinate\n 120: dup\n 121: aload_1\n 122: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 125: iconst_1\n 126: isub\n 127: aload_1\n 128: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 131: iconst_1\n 132: iadd\n 133: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 136: astore 9\n 138: new #109 // class Day3$Coordinate\n 141: dup\n 142: aload_1\n 143: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 146: iconst_1\n 147: iadd\n 148: aload_1\n 149: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 152: iconst_1\n 153: iadd\n 154: invokespecial #110 // Method Day3$Coordinate.\"<init>\":(II)V\n 157: astore 10\n 159: bipush 8\n 161: anewarray #109 // class Day3$Coordinate\n 164: astore 12\n 166: aload 12\n 168: iconst_0\n 169: aload_3\n 170: aastore\n 171: aload 12\n 173: iconst_1\n 174: aload 4\n 176: aastore\n 177: aload 12\n 179: iconst_2\n 180: aload 5\n 182: aastore\n 183: aload 12\n 185: iconst_3\n 186: aload 6\n 188: aastore\n 189: aload 12\n 191: iconst_4\n 192: aload 7\n 194: aastore\n 195: aload 12\n 197: iconst_5\n 198: aload 8\n 200: aastore\n 201: aload 12\n 203: bipush 6\n 205: aload 9\n 207: aastore\n 208: aload 12\n 210: bipush 7\n 212: aload 10\n 214: aastore\n 215: aload 12\n 217: invokestatic #114 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 220: astore 11\n 222: aload_2\n 223: checkcast #31 // class java/lang/Iterable\n 226: astore 12\n 228: iconst_0\n 229: istore 13\n 231: aload 12\n 233: astore 14\n 235: new #82 // class java/util/ArrayList\n 238: dup\n 239: invokespecial #83 // Method java/util/ArrayList.\"<init>\":()V\n 242: checkcast #85 // class java/util/Collection\n 245: astore 15\n 247: iconst_0\n 248: istore 16\n 250: aload 14\n 252: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 257: astore 17\n 259: aload 17\n 261: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 266: ifeq 430\n 269: aload 17\n 271: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 276: astore 18\n 278: aload 18\n 280: checkcast #87 // class Day3$NumberPosition\n 283: astore 19\n 285: iconst_0\n 286: istore 20\n 288: aload 11\n 290: checkcast #31 // class java/lang/Iterable\n 293: astore 21\n 295: iconst_0\n 296: istore 22\n 298: aload 21\n 300: instanceof #85 // class java/util/Collection\n 303: ifeq 323\n 306: aload 21\n 308: checkcast #85 // class java/util/Collection\n 311: invokeinterface #127, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 316: ifeq 323\n 319: iconst_0\n 320: goto 413\n 323: aload 21\n 325: invokeinterface #60, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 330: astore 23\n 332: aload 23\n 334: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 339: ifeq 412\n 342: aload 23\n 344: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 349: astore 24\n 351: aload 24\n 353: checkcast #109 // class Day3$Coordinate\n 356: astore 25\n 358: iconst_0\n 359: istore 26\n 361: aload 25\n 363: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 366: aload 19\n 368: invokevirtual #385 // Method Day3$NumberPosition.getEnd:()I\n 371: if_icmpgt 404\n 374: aload 25\n 376: invokevirtual #379 // Method Day3$Coordinate.getX:()I\n 379: aload 19\n 381: invokevirtual #388 // Method Day3$NumberPosition.getStart:()I\n 384: if_icmplt 404\n 387: aload 25\n 389: invokevirtual #382 // Method Day3$Coordinate.getY:()I\n 392: aload 19\n 394: invokevirtual #391 // Method Day3$NumberPosition.getRow:()I\n 397: if_icmpne 404\n 400: iconst_1\n 401: goto 405\n 404: iconst_0\n 405: ifeq 332\n 408: iconst_1\n 409: goto 413\n 412: iconst_0\n 413: nop\n 414: ifeq 259\n 417: aload 15\n 419: aload 18\n 421: invokeinterface #134, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 426: pop\n 427: goto 259\n 430: aload 15\n 432: checkcast #120 // class java/util/List\n 435: nop\n 436: areturn\n\n static {};\n Code:\n 0: new #2 // class Day3\n 3: dup\n 4: invokespecial #401 // Method \"<init>\":()V\n 7: putstatic #337 // Field INSTANCE:LDay3;\n 10: ldc_w #403 // String .\n 13: checkcast #263 // class java/lang/CharSequence\n 16: invokestatic #409 // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C\n 19: putstatic #298 // Field reservedSymbol:C\n 22: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day3$Symbol.class", "javap": "Compiled from \"Day3.kt\"\npublic final class Day3$Symbol {\n private final char symbol;\n\n private final Day3$Coordinate coordinate;\n\n public Day3$Symbol(char, Day3$Coordinate);\n Code:\n 0: aload_2\n 1: ldc #9 // String coordinate\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #18 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: iload_1\n 12: putfield #22 // Field symbol:C\n 15: aload_0\n 16: aload_2\n 17: putfield #25 // Field coordinate:LDay3$Coordinate;\n 20: return\n\n public final char getSymbol();\n Code:\n 0: aload_0\n 1: getfield #22 // Field symbol:C\n 4: ireturn\n\n public final Day3$Coordinate getCoordinate();\n Code:\n 0: aload_0\n 1: getfield #25 // Field coordinate:LDay3$Coordinate;\n 4: areturn\n\n public final char component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field symbol:C\n 4: ireturn\n\n public final Day3$Coordinate component2();\n Code:\n 0: aload_0\n 1: getfield #25 // Field coordinate:LDay3$Coordinate;\n 4: areturn\n\n public final Day3$Symbol copy(char, Day3$Coordinate);\n Code:\n 0: aload_2\n 1: ldc #9 // String coordinate\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day3$Symbol\n 9: dup\n 10: iload_1\n 11: aload_2\n 12: invokespecial #37 // Method \"<init>\":(CLDay3$Coordinate;)V\n 15: areturn\n\n public static Day3$Symbol copy$default(Day3$Symbol, char, Day3$Coordinate, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field symbol:C\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #25 // Field coordinate:LDay3$Coordinate;\n 21: astore_2\n 22: aload_0\n 23: iload_1\n 24: aload_2\n 25: invokevirtual #41 // Method copy:(CLDay3$Coordinate;)LDay3$Symbol;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #45 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #46 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #48 // String Symbol(symbol=\n 9: invokevirtual #52 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field symbol:C\n 16: invokevirtual #55 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 19: ldc #57 // String , coordinate=\n 21: invokevirtual #52 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #25 // Field coordinate:LDay3$Coordinate;\n 28: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #55 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #62 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field symbol:C\n 4: invokestatic #69 // Method java/lang/Character.hashCode:(C)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #25 // Field coordinate:LDay3$Coordinate;\n 16: invokevirtual #73 // Method Day3$Coordinate.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day3$Symbol\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day3$Symbol\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field symbol:C\n 25: aload_2\n 26: getfield #22 // Field symbol:C\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #25 // Field coordinate:LDay3$Coordinate;\n 38: aload_2\n 39: getfield #25 // Field coordinate:LDay3$Coordinate;\n 42: invokestatic #82 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: iconst_1\n 51: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day3$NumberPosition.class", "javap": "Compiled from \"Day3.kt\"\npublic final class Day3$NumberPosition {\n private final int number;\n\n private final int start;\n\n private final int end;\n\n private final int row;\n\n public Day3$NumberPosition(int, int, int, int);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: iload_1\n 6: putfield #13 // Field number:I\n 9: aload_0\n 10: iload_2\n 11: putfield #16 // Field start:I\n 14: aload_0\n 15: iload_3\n 16: putfield #19 // Field end:I\n 19: aload_0\n 20: iload 4\n 22: putfield #22 // Field row:I\n 25: return\n\n public final int getNumber();\n Code:\n 0: aload_0\n 1: getfield #13 // Field number:I\n 4: ireturn\n\n public final int getStart();\n Code:\n 0: aload_0\n 1: getfield #16 // Field start:I\n 4: ireturn\n\n public final int getEnd();\n Code:\n 0: aload_0\n 1: getfield #19 // Field end:I\n 4: ireturn\n\n public final int getRow();\n Code:\n 0: aload_0\n 1: getfield #22 // Field row:I\n 4: ireturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field number:I\n 4: ireturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field start:I\n 4: ireturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #19 // Field end:I\n 4: ireturn\n\n public final int component4();\n Code:\n 0: aload_0\n 1: getfield #22 // Field row:I\n 4: ireturn\n\n public final Day3$NumberPosition copy(int, int, int, int);\n Code:\n 0: new #2 // class Day3$NumberPosition\n 3: dup\n 4: iload_1\n 5: iload_2\n 6: iload_3\n 7: iload 4\n 9: invokespecial #38 // Method \"<init>\":(IIII)V\n 12: areturn\n\n public static Day3$NumberPosition copy$default(Day3$NumberPosition, int, int, int, int, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #13 // Field number:I\n 11: istore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #16 // Field start:I\n 23: istore_2\n 24: iload 5\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #19 // Field end:I\n 35: istore_3\n 36: iload 5\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #22 // Field row:I\n 48: istore 4\n 50: aload_0\n 51: iload_1\n 52: iload_2\n 53: iload_3\n 54: iload 4\n 56: invokevirtual #42 // Method copy:(IIII)LDay3$NumberPosition;\n 59: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #46 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #49 // String NumberPosition(number=\n 9: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field number:I\n 16: invokevirtual #56 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #58 // String , start=\n 21: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field start:I\n 28: invokevirtual #56 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: ldc #60 // String , end=\n 33: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #19 // Field end:I\n 40: invokevirtual #56 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: ldc #62 // String , row=\n 45: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #22 // Field row:I\n 52: invokevirtual #56 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 55: bipush 41\n 57: invokevirtual #65 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 60: invokevirtual #67 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 63: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field number:I\n 4: invokestatic #73 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field start:I\n 16: invokestatic #73 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #19 // Field end:I\n 29: invokestatic #73 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #22 // Field row:I\n 42: invokestatic #73 // Method java/lang/Integer.hashCode:(I)I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day3$NumberPosition\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day3$NumberPosition\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field number:I\n 25: aload_2\n 26: getfield #13 // Field number:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #16 // Field start:I\n 38: aload_2\n 39: getfield #16 // Field start:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: aload_0\n 48: getfield #19 // Field end:I\n 51: aload_2\n 52: getfield #19 // Field end:I\n 55: if_icmpeq 60\n 58: iconst_0\n 59: ireturn\n 60: aload_0\n 61: getfield #22 // Field row:I\n 64: aload_2\n 65: getfield #22 // Field row:I\n 68: if_icmpeq 73\n 71: iconst_0\n 72: ireturn\n 73: iconst_1\n 74: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day10.kt
import kotlin.String import kotlin.collections.List object Day10 { data class Coordinate(val x: Int, val y: Int) data class Node(val coordinate: Coordinate, val pipe: String, val connections: List<Coordinate>) fun part1(input: List<String>): String { val graph = parse(input) val nodesInLoop = findNodesInLoop(graph) val graphWithJunkRemoved = graph.filterKeys { it in nodesInLoop } return djikstras(graphWithJunkRemoved).values.max().toString() } private fun djikstras(graph: Map<Coordinate, Node>): Map<Coordinate, Int> { val startNode = graph.values.find { it.pipe == "S" }!! val dists = mutableMapOf<Coordinate, Int>() val unvisited = mutableSetOf<Coordinate>() for (node in graph.values) { unvisited.add(node.coordinate) } dists[startNode.coordinate] = 0 while (unvisited.isNotEmpty()) { val current = unvisited.minBy { dists[it] ?: Int.MAX_VALUE } unvisited.remove(current) for (connection in graph[current]?.connections ?: emptyList()) { val alt = dists.getOrPut(current) { 0 } + 1 if (alt < (dists[connection] ?: Int.MAX_VALUE)) { dists[connection] = alt } } } return dists } fun parse(input: List<String>): Map<Coordinate, Node> { val split = input.map { it.split("").filter { it.isNotBlank() } } val northDestinations = setOf("|", "7", "F", "S") val southDestinations = setOf("|", "J", "L", "S") val eastDestinations = setOf("-", "7", "J", "S") val westDestinations = setOf("-", "F", "L", "S") val nodes = split.mapIndexed { y, row -> row.mapIndexedNotNull { x, char -> val coordinate = Coordinate(x, y) when (char) { "|" -> { val connections = listOf( split.getOrNull(y - 1)?.getOrNull(x) ?.let { if (northDestinations.contains(it)) Coordinate(x, y - 1) else null }, split.getOrNull(y + 1)?.getOrNull(x) ?.let { if (southDestinations.contains(it)) Coordinate(x, y + 1) else null } ).filterNotNull() Node(coordinate, char, connections) } "-" -> { val connections = listOf( split.getOrNull(y)?.getOrNull(x - 1) ?.let { if (westDestinations.contains(it)) Coordinate(x - 1, y) else null }, split.getOrNull(y)?.getOrNull(x + 1) ?.let { if (eastDestinations.contains(it)) Coordinate(x + 1, y) else null } ).filterNotNull() Node(coordinate, char, connections) } "L" -> { val connections = listOf( split.getOrNull(y - 1)?.getOrNull(x) ?.let { if (northDestinations.contains(it)) Coordinate(x, y - 1) else null }, split.getOrNull(y)?.getOrNull(x + 1) ?.let { if (eastDestinations.contains(it)) Coordinate(x + 1, y) else null } ).filterNotNull() Node(coordinate, char, connections) } "J" -> { val connections = listOf( split.getOrNull(y - 1)?.getOrNull(x) ?.let { if (northDestinations.contains(it)) Coordinate(x, y - 1) else null }, split.getOrNull(y)?.getOrNull(x - 1) ?.let { if (westDestinations.contains(it)) Coordinate(x - 1, y) else null } ).filterNotNull() Node(coordinate, char, connections) } "7" -> { val connections = listOf( split.getOrNull(y + 1)?.getOrNull(x) ?.let { if (southDestinations.contains(it)) Coordinate(x, y + 1) else null }, split.getOrNull(y)?.getOrNull(x - 1) ?.let { if (westDestinations.contains(it)) Coordinate(x - 1, y) else null }, ).filterNotNull() Node(coordinate, char, connections) } "F" -> { val connections = listOf( split.getOrNull(y + 1)?.getOrNull(x) ?.let { if (southDestinations.contains(it)) Coordinate(x, y + 1) else null }, split.getOrNull(y)?.getOrNull(x + 1) ?.let { if (eastDestinations.contains(it)) Coordinate(x + 1, y) else null } ).filterNotNull() Node(coordinate, char, connections) } "S" -> { val connections = listOf( split.getOrNull(y - 1)?.getOrNull(x) ?.let { if (northDestinations.contains(it)) Coordinate(x, y - 1) else null }, split.getOrNull(y + 1)?.getOrNull(x) ?.let { if (southDestinations.contains(it)) Coordinate(x, y + 1) else null }, split.getOrNull(y)?.getOrNull(x - 1) ?.let { if (westDestinations.contains(it)) Coordinate(x - 1, y) else null }, split.getOrNull(y)?.getOrNull(x + 1) ?.let { if (eastDestinations.contains(it)) Coordinate(x + 1, y) else null } ).filterNotNull() Node(coordinate, char, connections) } else -> null } } }.flatten() return nodes.associateBy { it.coordinate } } fun part2(input: List<String>): String { val graph = parse(input) val nodesInLoop = findNodesInLoop(graph) val inputWithJunkPipesRemoved = input.mapIndexed { y, row -> row.mapIndexedNotNull { x, char -> val coordinate = Coordinate(x, y) if (char == '.' || coordinate !in nodesInLoop) { '.'.toString() } else { char.toString() } }.joinToString("") } val graphWithJunkRemoved = graph.filterKeys { it in nodesInLoop } val graphWithStartReplaced = graphWithJunkRemoved.map { (coordinate, node) -> if (node.pipe == "S") { coordinate to Node(coordinate, translate("S", node.connections), node.connections) } else { coordinate to node } }.toMap() val dots = inputWithJunkPipesRemoved.mapIndexed { y, row -> row.mapIndexedNotNull { x, char -> val coordinate = Coordinate(x, y) if (char == '.') { coordinate } else { null } } }.flatten().toSet() return dots.count { isInPolygon(graphWithStartReplaced, it) }.toString() } private fun translate(s: String, connections: List<Coordinate>): String { val sortedConnections = connections.sortedWith(compareBy({ it.x }, { it.y })) val northSouth = (sortedConnections.first().x - sortedConnections.last().x) == 0 val eastWest = (sortedConnections.first().y - sortedConnections.last().y) == 0 val eastNorth = sortedConnections.first().x > sortedConnections.last().x && sortedConnections.first().y < sortedConnections.last().y val eastSouth = sortedConnections.first().x > sortedConnections.last().x && sortedConnections.first().y > sortedConnections.last().y val westSouth = sortedConnections.first().x < sortedConnections.last().x && sortedConnections.first().y < sortedConnections.last().y val westNorth = sortedConnections.first().x < sortedConnections.last().x && sortedConnections.first().y > sortedConnections.last().y return when { eastWest -> "-" northSouth -> "|" eastNorth -> "L" eastSouth -> "F" westNorth -> "J" westSouth -> "7" else -> s } } private fun findNodesInLoop(graph: Map<Coordinate, Node>): Set<Coordinate> { val startNode = graph.values.find { it.pipe == "S" }!! val processed = mutableSetOf<Coordinate>() val unprocessed = ArrayDeque<Coordinate>() unprocessed.add(startNode.coordinate) while (unprocessed.isNotEmpty()) { val current = unprocessed.removeFirst() if (current in processed) { continue } unprocessed.addAll(graph[current]?.connections ?: emptyList()) processed.add(current) } return processed } /** * Modified ray cast algorithm to identify if a coordinate is within the loop. * * Instead of casting a simple ray any direction and seeing if it crosses an odd number of segments, * we cast rays in each direction and see if they cross an odd number of segments. Additionally * we collapse segments such as * F-- * | * --J * * into a single segment FJ */ private fun isInPolygon(graph: Map<Coordinate, Node>, it: Coordinate): Boolean { return isInPolygonAbove(graph, it) && isInPolygonBelow(graph, it) && isInPolygonLeft( graph, it ) && isInPolygonRight(graph, it) } /** * Modified ray cast algorithm to identify num segments right * * ------> ||| (true, 3) * ------> || (false, 2) */ fun isInPolygonRight(graph: Map<Coordinate, Node>, coordinate: Coordinate): Boolean { val intersectionsRight = graph.keys.filter { it.x > coordinate.x }.filter { it.y == coordinate.y } val directSegments = intersectionsRight .filter { graph[it]?.pipe == "|" } val indirectSegmentRightPairs = setOf("FJ", "L7") val indirectSegments = intersectionsRight .filter { graph[it]?.pipe != "-" } .zipWithNext().filter { (a, b) -> (graph[a]?.pipe + graph[b]?.pipe) in indirectSegmentRightPairs } return (indirectSegments.size + directSegments.size) % 2 == 1 } /** * Modified ray cast algorithm to identify num segments left * * ||| <------ (true, 3) * || <------ (false, 2) */ fun isInPolygonLeft(graph: Map<Coordinate, Node>, coordinate: Coordinate): Boolean { val intersectionsLeft = graph.keys.filter { it.x < coordinate.x }.filter { it.y == coordinate.y }.sortedByDescending { it.x } val directSegments = intersectionsLeft .filter { graph[it]?.pipe == "|" } val indirectSegmentLeftPairs = setOf("JF", "7L") val indirectSegments = intersectionsLeft .filter { graph[it]?.pipe != "-" } .zipWithNext().filter { (a, b) -> (graph[a]?.pipe + graph[b]?.pipe) in indirectSegmentLeftPairs } return (indirectSegments.size + directSegments.size) % 2 == 1 } /** * Modified ray cast algorithm to identify num segments below * * | * | * v * - * - * - (true, 3) * * | * | * v * - * - (false, 2) */ fun isInPolygonBelow(graph: Map<Coordinate, Node>, coordinate: Coordinate): Boolean { val intersectionsBelow = graph.keys.filter { it.y > coordinate.y }.filter { it.x == coordinate.x }.sortedBy { it.y } val directSegments = intersectionsBelow .filter { graph[it]?.pipe == "-" } val indirectSegmentSouthPairs = setOf("FJ", "7L") val indirectSegments = intersectionsBelow .filter { graph[it]?.pipe != "|" } .zipWithNext().filter { (a, b) -> (graph[a]?.pipe + graph[b]?.pipe) in indirectSegmentSouthPairs } return (indirectSegments.size + directSegments.size) % 2 == 1 } /** * Modified ray cast algorithm to identify num segments above * * - (true, 3) * - * - * ^ * | * | * * - (false, 2) * - * ^ * | * | */ fun isInPolygonAbove(graph: Map<Coordinate, Node>, coordinate: Coordinate): Boolean { graph.keys.filter { it.y < coordinate.y }.filter { it.x < coordinate.x } val intersectionsAbove = graph.keys.filter { it.y < coordinate.y }.filter { it.x == coordinate.x }.sortedByDescending { it.y } val directSegments = intersectionsAbove .filter { graph[it]?.pipe == "-" } val indirectSegmentNorthPairs = setOf("JF", "L7") val indirectSegments = intersectionsAbove .filter { graph[it]?.pipe != "|" } .zipWithNext().filter { (a, b) -> (graph[a]?.pipe + graph[b]?.pipe) in indirectSegmentNorthPairs } return (indirectSegments.size + directSegments.size) % 2 == 1 } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day10$Node.class", "javap": "Compiled from \"Day10.kt\"\npublic final class Day10$Node {\n private final Day10$Coordinate coordinate;\n\n private final java.lang.String pipe;\n\n private final java.util.List<Day10$Coordinate> connections;\n\n public Day10$Node(Day10$Coordinate, java.lang.String, java.util.List<Day10$Coordinate>);\n Code:\n 0: aload_1\n 1: ldc #10 // String coordinate\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String pipe\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_3\n 13: ldc #20 // String connections\n 15: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload_0\n 19: invokespecial #23 // Method java/lang/Object.\"<init>\":()V\n 22: aload_0\n 23: aload_1\n 24: putfield #26 // Field coordinate:LDay10$Coordinate;\n 27: aload_0\n 28: aload_2\n 29: putfield #29 // Field pipe:Ljava/lang/String;\n 32: aload_0\n 33: aload_3\n 34: putfield #32 // Field connections:Ljava/util/List;\n 37: return\n\n public final Day10$Coordinate getCoordinate();\n Code:\n 0: aload_0\n 1: getfield #26 // Field coordinate:LDay10$Coordinate;\n 4: areturn\n\n public final java.lang.String getPipe();\n Code:\n 0: aload_0\n 1: getfield #29 // Field pipe:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day10$Coordinate> getConnections();\n Code:\n 0: aload_0\n 1: getfield #32 // Field connections:Ljava/util/List;\n 4: areturn\n\n public final Day10$Coordinate component1();\n Code:\n 0: aload_0\n 1: getfield #26 // Field coordinate:LDay10$Coordinate;\n 4: areturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #29 // Field pipe:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day10$Coordinate> component3();\n Code:\n 0: aload_0\n 1: getfield #32 // Field connections:Ljava/util/List;\n 4: areturn\n\n public final Day10$Node copy(Day10$Coordinate, java.lang.String, java.util.List<Day10$Coordinate>);\n Code:\n 0: aload_1\n 1: ldc #10 // String coordinate\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String pipe\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_3\n 13: ldc #20 // String connections\n 15: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: new #2 // class Day10$Node\n 21: dup\n 22: aload_1\n 23: aload_2\n 24: aload_3\n 25: invokespecial #49 // Method \"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 28: areturn\n\n public static Day10$Node copy$default(Day10$Node, Day10$Coordinate, java.lang.String, java.util.List, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #26 // Field coordinate:LDay10$Coordinate;\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #29 // Field pipe:Ljava/lang/String;\n 23: astore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #32 // Field connections:Ljava/util/List;\n 35: astore_3\n 36: aload_0\n 37: aload_1\n 38: aload_2\n 39: aload_3\n 40: invokevirtual #53 // Method copy:(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)LDay10$Node;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #56 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #57 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #59 // String Node(coordinate=\n 9: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #26 // Field coordinate:LDay10$Coordinate;\n 16: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #68 // String , pipe=\n 21: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #29 // Field pipe:Ljava/lang/String;\n 28: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: ldc #70 // String , connections=\n 33: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #32 // Field connections:Ljava/util/List;\n 40: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #73 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #75 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #26 // Field coordinate:LDay10$Coordinate;\n 4: invokevirtual #81 // Method Day10$Coordinate.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #29 // Field pipe:Ljava/lang/String;\n 16: invokevirtual #84 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #32 // Field connections:Ljava/util/List;\n 29: invokevirtual #85 // Method java/lang/Object.hashCode:()I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day10$Node\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day10$Node\n 20: astore_2\n 21: aload_0\n 22: getfield #26 // Field coordinate:LDay10$Coordinate;\n 25: aload_2\n 26: getfield #26 // Field coordinate:LDay10$Coordinate;\n 29: invokestatic #94 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #29 // Field pipe:Ljava/lang/String;\n 41: aload_2\n 42: getfield #29 // Field pipe:Ljava/lang/String;\n 45: invokestatic #94 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #32 // Field connections:Ljava/util/List;\n 57: aload_2\n 58: getfield #32 // Field connections:Ljava/util/List;\n 61: invokestatic #94 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 64: ifne 69\n 67: iconst_0\n 68: ireturn\n 69: iconst_1\n 70: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day10$isInPolygonBelow$$inlined$sortedBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day10$isInPolygonBelow$$inlined$sortedBy$1<T> implements java.util.Comparator {\n public Day10$isInPolygonBelow$$inlined$sortedBy$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_1\n 1: checkcast #23 // class Day10$Coordinate\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method Day10$Coordinate.getY:()I\n 12: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 15: checkcast #35 // class java/lang/Comparable\n 18: aload_2\n 19: checkcast #23 // class Day10$Coordinate\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method Day10$Coordinate.getY:()I\n 32: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 35: aload 5\n 37: swap\n 38: checkcast #35 // class java/lang/Comparable\n 41: invokestatic #41 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day10.class", "javap": "Compiled from \"Day10.kt\"\npublic final class Day10 {\n public static final Day10 INSTANCE;\n\n private Day10();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokevirtual #26 // Method parse:(Ljava/util/List;)Ljava/util/Map;\n 11: astore_2\n 12: aload_0\n 13: aload_2\n 14: invokespecial #30 // Method findNodesInLoop:(Ljava/util/Map;)Ljava/util/Set;\n 17: astore_3\n 18: aload_2\n 19: astore 5\n 21: iconst_0\n 22: istore 6\n 24: new #32 // class java/util/LinkedHashMap\n 27: dup\n 28: invokespecial #33 // Method java/util/LinkedHashMap.\"<init>\":()V\n 31: astore 7\n 33: aload 5\n 35: invokeinterface #39, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 40: invokeinterface #45, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 45: astore 8\n 47: aload 8\n 49: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 118\n 57: aload 8\n 59: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: checkcast #57 // class java/util/Map$Entry\n 67: astore 9\n 69: aload 9\n 71: invokeinterface #60, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 76: checkcast #62 // class Day10$Coordinate\n 79: astore 10\n 81: iconst_0\n 82: istore 11\n 84: aload_3\n 85: aload 10\n 87: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 92: ifeq 47\n 95: aload 7\n 97: aload 9\n 99: invokeinterface #60, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 104: aload 9\n 106: invokeinterface #69, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 111: invokevirtual #73 // Method java/util/LinkedHashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 114: pop\n 115: goto 47\n 118: aload 7\n 120: checkcast #35 // class java/util/Map\n 123: astore 4\n 125: aload_0\n 126: aload 4\n 128: invokespecial #77 // Method djikstras:(Ljava/util/Map;)Ljava/util/Map;\n 131: invokeinterface #81, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 136: checkcast #83 // class java/lang/Iterable\n 139: invokestatic #89 // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 142: checkcast #91 // class java/lang/Number\n 145: invokevirtual #95 // Method java/lang/Number.intValue:()I\n 148: invokestatic #101 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 151: areturn\n\n private final java.util.Map<Day10$Coordinate, java.lang.Integer> djikstras(java.util.Map<Day10$Coordinate, Day10$Node>);\n Code:\n 0: aload_1\n 1: invokeinterface #81, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 6: checkcast #83 // class java/lang/Iterable\n 9: astore 4\n 11: aload 4\n 13: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 18: astore 5\n 20: aload 5\n 22: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 27: ifeq 67\n 30: aload 5\n 32: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 37: astore 6\n 39: aload 6\n 41: checkcast #123 // class Day10$Node\n 44: astore 7\n 46: iconst_0\n 47: istore 8\n 49: aload 7\n 51: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 54: ldc #129 // String S\n 56: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 59: ifeq 20\n 62: aload 6\n 64: goto 68\n 67: aconst_null\n 68: dup\n 69: invokestatic #137 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 72: checkcast #123 // class Day10$Node\n 75: astore_2\n 76: new #32 // class java/util/LinkedHashMap\n 79: dup\n 80: invokespecial #33 // Method java/util/LinkedHashMap.\"<init>\":()V\n 83: checkcast #35 // class java/util/Map\n 86: astore_3\n 87: new #139 // class java/util/LinkedHashSet\n 90: dup\n 91: invokespecial #140 // Method java/util/LinkedHashSet.\"<init>\":()V\n 94: checkcast #41 // class java/util/Set\n 97: astore 4\n 99: aload_1\n 100: invokeinterface #81, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 105: invokeinterface #143, 1 // InterfaceMethod java/util/Collection.iterator:()Ljava/util/Iterator;\n 110: astore 5\n 112: aload 5\n 114: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 119: ifeq 150\n 122: aload 5\n 124: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 129: checkcast #123 // class Day10$Node\n 132: astore 6\n 134: aload 4\n 136: aload 6\n 138: invokevirtual #147 // Method Day10$Node.getCoordinate:()LDay10$Coordinate;\n 141: invokeinterface #150, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 146: pop\n 147: goto 112\n 150: aload_3\n 151: aload_2\n 152: invokevirtual #147 // Method Day10$Node.getCoordinate:()LDay10$Coordinate;\n 155: iconst_0\n 156: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 159: invokeinterface #156, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 164: pop\n 165: aload 4\n 167: checkcast #142 // class java/util/Collection\n 170: invokeinterface #159, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 175: ifne 182\n 178: iconst_1\n 179: goto 183\n 182: iconst_0\n 183: ifeq 553\n 186: aload 4\n 188: checkcast #83 // class java/lang/Iterable\n 191: astore 6\n 193: iconst_0\n 194: istore 7\n 196: aload 6\n 198: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 203: astore 8\n 205: aload 8\n 207: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 212: ifne 223\n 215: new #161 // class java/util/NoSuchElementException\n 218: dup\n 219: invokespecial #162 // Method java/util/NoSuchElementException.\"<init>\":()V\n 222: athrow\n 223: aload 8\n 225: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 230: astore 9\n 232: aload 8\n 234: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 239: ifne 247\n 242: aload 9\n 244: goto 372\n 247: aload 9\n 249: checkcast #62 // class Day10$Coordinate\n 252: astore 10\n 254: iconst_0\n 255: istore 11\n 257: aload_3\n 258: aload 10\n 260: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 265: checkcast #152 // class java/lang/Integer\n 268: dup\n 269: ifnull 278\n 272: invokevirtual #167 // Method java/lang/Integer.intValue:()I\n 275: goto 281\n 278: pop\n 279: ldc #168 // int 2147483647\n 281: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 284: checkcast #170 // class java/lang/Comparable\n 287: astore 10\n 289: aload 8\n 291: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 296: astore 11\n 298: aload 11\n 300: checkcast #62 // class Day10$Coordinate\n 303: astore 12\n 305: iconst_0\n 306: istore 13\n 308: aload_3\n 309: aload 12\n 311: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 316: checkcast #152 // class java/lang/Integer\n 319: dup\n 320: ifnull 329\n 323: invokevirtual #167 // Method java/lang/Integer.intValue:()I\n 326: goto 332\n 329: pop\n 330: ldc #168 // int 2147483647\n 332: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 335: checkcast #170 // class java/lang/Comparable\n 338: astore 12\n 340: aload 10\n 342: aload 12\n 344: invokeinterface #174, 2 // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I\n 349: ifle 360\n 352: aload 11\n 354: astore 9\n 356: aload 12\n 358: astore 10\n 360: aload 8\n 362: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 367: ifne 289\n 370: aload 9\n 372: checkcast #62 // class Day10$Coordinate\n 375: astore 5\n 377: aload 4\n 379: aload 5\n 381: invokeinterface #177, 2 // InterfaceMethod java/util/Set.remove:(Ljava/lang/Object;)Z\n 386: pop\n 387: aload_1\n 388: aload 5\n 390: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 395: checkcast #123 // class Day10$Node\n 398: dup\n 399: ifnull 409\n 402: invokevirtual #181 // Method Day10$Node.getConnections:()Ljava/util/List;\n 405: dup\n 406: ifnonnull 413\n 409: pop\n 410: invokestatic #184 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 413: invokeinterface #185, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 418: astore 6\n 420: aload 6\n 422: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 427: ifeq 165\n 430: aload 6\n 432: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 437: checkcast #62 // class Day10$Coordinate\n 440: astore 7\n 442: aload_3\n 443: astore 9\n 445: iconst_0\n 446: istore 10\n 448: aload 9\n 450: aload 5\n 452: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 457: astore 11\n 459: aload 11\n 461: ifnonnull 490\n 464: iconst_0\n 465: istore 12\n 467: iconst_0\n 468: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 471: astore 12\n 473: aload 9\n 475: aload 5\n 477: aload 12\n 479: invokeinterface #156, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 484: pop\n 485: aload 12\n 487: goto 492\n 490: aload 11\n 492: nop\n 493: checkcast #91 // class java/lang/Number\n 496: invokevirtual #95 // Method java/lang/Number.intValue:()I\n 499: iconst_1\n 500: iadd\n 501: istore 8\n 503: iload 8\n 505: aload_3\n 506: aload 7\n 508: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 513: checkcast #152 // class java/lang/Integer\n 516: dup\n 517: ifnull 526\n 520: invokevirtual #167 // Method java/lang/Integer.intValue:()I\n 523: goto 529\n 526: pop\n 527: ldc #168 // int 2147483647\n 529: if_icmpge 420\n 532: iload 8\n 534: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 537: astore 10\n 539: aload_3\n 540: aload 7\n 542: aload 10\n 544: invokeinterface #156, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 549: pop\n 550: goto 420\n 553: aload_3\n 554: areturn\n\n public final java.util.Map<Day10$Coordinate, Day10$Node> parse(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #83 // class java/lang/Iterable\n 10: astore_3\n 11: iconst_0\n 12: istore 4\n 14: aload_3\n 15: astore 5\n 17: new #214 // class java/util/ArrayList\n 20: dup\n 21: aload_3\n 22: bipush 10\n 24: invokestatic #218 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 27: invokespecial #221 // Method java/util/ArrayList.\"<init>\":(I)V\n 30: checkcast #142 // class java/util/Collection\n 33: astore 6\n 35: iconst_0\n 36: istore 7\n 38: aload 5\n 40: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 8\n 47: aload 8\n 49: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 224\n 57: aload 8\n 59: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 9\n 66: aload 6\n 68: aload 9\n 70: checkcast #97 // class java/lang/String\n 73: astore 10\n 75: astore 50\n 77: iconst_0\n 78: istore 11\n 80: aload 10\n 82: checkcast #223 // class java/lang/CharSequence\n 85: iconst_1\n 86: anewarray #97 // class java/lang/String\n 89: astore 12\n 91: aload 12\n 93: iconst_0\n 94: ldc #225 // String\n 96: aastore\n 97: aload 12\n 99: iconst_0\n 100: iconst_0\n 101: bipush 6\n 103: aconst_null\n 104: invokestatic #231 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 107: checkcast #83 // class java/lang/Iterable\n 110: astore 12\n 112: iconst_0\n 113: istore 13\n 115: aload 12\n 117: astore 14\n 119: new #214 // class java/util/ArrayList\n 122: dup\n 123: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 126: checkcast #142 // class java/util/Collection\n 129: astore 15\n 131: iconst_0\n 132: istore 16\n 134: aload 14\n 136: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 141: astore 17\n 143: aload 17\n 145: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 150: ifeq 205\n 153: aload 17\n 155: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 160: astore 18\n 162: aload 18\n 164: checkcast #97 // class java/lang/String\n 167: astore 19\n 169: iconst_0\n 170: istore 20\n 172: aload 19\n 174: checkcast #223 // class java/lang/CharSequence\n 177: invokestatic #236 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z\n 180: ifne 187\n 183: iconst_1\n 184: goto 188\n 187: iconst_0\n 188: nop\n 189: ifeq 143\n 192: aload 15\n 194: aload 18\n 196: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 201: pop\n 202: goto 143\n 205: aload 15\n 207: checkcast #119 // class java/util/List\n 210: nop\n 211: nop\n 212: aload 50\n 214: swap\n 215: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 220: pop\n 221: goto 47\n 224: aload 6\n 226: checkcast #119 // class java/util/List\n 229: nop\n 230: astore_2\n 231: iconst_4\n 232: anewarray #97 // class java/lang/String\n 235: astore 4\n 237: aload 4\n 239: iconst_0\n 240: ldc #239 // String |\n 242: aastore\n 243: aload 4\n 245: iconst_1\n 246: ldc #241 // String 7\n 248: aastore\n 249: aload 4\n 251: iconst_2\n 252: ldc #243 // String F\n 254: aastore\n 255: aload 4\n 257: iconst_3\n 258: ldc #129 // String S\n 260: aastore\n 261: aload 4\n 263: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 266: astore_3\n 267: iconst_4\n 268: anewarray #97 // class java/lang/String\n 271: astore 5\n 273: aload 5\n 275: iconst_0\n 276: ldc #239 // String |\n 278: aastore\n 279: aload 5\n 281: iconst_1\n 282: ldc #251 // String J\n 284: aastore\n 285: aload 5\n 287: iconst_2\n 288: ldc #253 // String L\n 290: aastore\n 291: aload 5\n 293: iconst_3\n 294: ldc #129 // String S\n 296: aastore\n 297: aload 5\n 299: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 302: astore 4\n 304: iconst_4\n 305: anewarray #97 // class java/lang/String\n 308: astore 6\n 310: aload 6\n 312: iconst_0\n 313: ldc #255 // String -\n 315: aastore\n 316: aload 6\n 318: iconst_1\n 319: ldc #241 // String 7\n 321: aastore\n 322: aload 6\n 324: iconst_2\n 325: ldc #251 // String J\n 327: aastore\n 328: aload 6\n 330: iconst_3\n 331: ldc #129 // String S\n 333: aastore\n 334: aload 6\n 336: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 339: astore 5\n 341: iconst_4\n 342: anewarray #97 // class java/lang/String\n 345: astore 7\n 347: aload 7\n 349: iconst_0\n 350: ldc #255 // String -\n 352: aastore\n 353: aload 7\n 355: iconst_1\n 356: ldc #243 // String F\n 358: aastore\n 359: aload 7\n 361: iconst_2\n 362: ldc #253 // String L\n 364: aastore\n 365: aload 7\n 367: iconst_3\n 368: ldc #129 // String S\n 370: aastore\n 371: aload 7\n 373: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 376: astore 6\n 378: aload_2\n 379: checkcast #83 // class java/lang/Iterable\n 382: astore 8\n 384: iconst_0\n 385: istore 9\n 387: aload 8\n 389: astore 10\n 391: new #214 // class java/util/ArrayList\n 394: dup\n 395: aload 8\n 397: bipush 10\n 399: invokestatic #218 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 402: invokespecial #221 // Method java/util/ArrayList.\"<init>\":(I)V\n 405: checkcast #142 // class java/util/Collection\n 408: astore 11\n 410: iconst_0\n 411: istore 12\n 413: iconst_0\n 414: istore 13\n 416: aload 10\n 418: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 423: astore 14\n 425: aload 14\n 427: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 432: ifeq 2509\n 435: aload 14\n 437: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 442: astore 15\n 444: aload 11\n 446: iload 13\n 448: iinc 13, 1\n 451: istore 16\n 453: iload 16\n 455: ifge 461\n 458: invokestatic #258 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 461: iload 16\n 463: aload 15\n 465: checkcast #119 // class java/util/List\n 468: astore 17\n 470: istore 18\n 472: astore 50\n 474: iconst_0\n 475: istore 19\n 477: aload 17\n 479: checkcast #83 // class java/lang/Iterable\n 482: astore 20\n 484: iconst_0\n 485: istore 21\n 487: aload 20\n 489: astore 22\n 491: new #214 // class java/util/ArrayList\n 494: dup\n 495: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 498: checkcast #142 // class java/util/Collection\n 501: astore 23\n 503: iconst_0\n 504: istore 24\n 506: aload 22\n 508: astore 25\n 510: iconst_0\n 511: istore 26\n 513: iconst_0\n 514: istore 27\n 516: aload 25\n 518: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 523: astore 28\n 525: aload 28\n 527: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 532: ifeq 2489\n 535: aload 28\n 537: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 542: astore 29\n 544: iload 27\n 546: iinc 27, 1\n 549: istore 30\n 551: iload 30\n 553: ifge 559\n 556: invokestatic #258 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 559: iload 30\n 561: aload 29\n 563: astore 31\n 565: istore 32\n 567: iconst_0\n 568: istore 33\n 570: iload 32\n 572: aload 31\n 574: checkcast #97 // class java/lang/String\n 577: astore 34\n 579: istore 35\n 581: iconst_0\n 582: istore 36\n 584: new #62 // class Day10$Coordinate\n 587: dup\n 588: iload 35\n 590: iload 18\n 592: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 595: astore 37\n 597: aload 34\n 599: astore 38\n 601: aload 38\n 603: invokevirtual #264 // Method java/lang/String.hashCode:()I\n 606: lookupswitch { // 7\n 45: 750\n 55: 698\n 70: 685\n 74: 711\n 76: 737\n 83: 672\n 124: 724\n default: 2460\n }\n 672: aload 38\n 674: ldc #129 // String S\n 676: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 679: ifne 2062\n 682: goto 2460\n 685: aload 38\n 687: ldc #243 // String F\n 689: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 692: ifne 1845\n 695: goto 2460\n 698: aload 38\n 700: ldc #241 // String 7\n 702: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 705: ifne 1628\n 708: goto 2460\n 711: aload 38\n 713: ldc #251 // String J\n 715: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 718: ifne 1412\n 721: goto 2460\n 724: aload 38\n 726: ldc #239 // String |\n 728: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 731: ifne 763\n 734: goto 2460\n 737: aload 38\n 739: ldc #253 // String L\n 741: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 744: ifne 1196\n 747: goto 2460\n 750: aload 38\n 752: ldc #255 // String -\n 754: invokevirtual #267 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 757: ifne 979\n 760: goto 2460\n 763: iconst_2\n 764: anewarray #62 // class Day10$Coordinate\n 767: astore 39\n 769: aload 39\n 771: iconst_0\n 772: aload_2\n 773: iload 18\n 775: iconst_1\n 776: isub\n 777: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 780: checkcast #119 // class java/util/List\n 783: astore 40\n 785: aload 40\n 787: ifnull 857\n 790: aload 40\n 792: iload 35\n 794: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 797: checkcast #97 // class java/lang/String\n 800: astore 41\n 802: aload 41\n 804: ifnull 857\n 807: aload 41\n 809: astore 42\n 811: istore 43\n 813: astore 44\n 815: iconst_0\n 816: istore 45\n 818: aload_3\n 819: aload 42\n 821: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 826: ifeq 845\n 829: new #62 // class Day10$Coordinate\n 832: dup\n 833: iload 35\n 835: iload 18\n 837: iconst_1\n 838: isub\n 839: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 842: goto 846\n 845: aconst_null\n 846: astore 46\n 848: aload 44\n 850: iload 43\n 852: aload 46\n 854: goto 858\n 857: aconst_null\n 858: aastore\n 859: aload 39\n 861: iconst_1\n 862: aload_2\n 863: iload 18\n 865: iconst_1\n 866: iadd\n 867: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 870: checkcast #119 // class java/util/List\n 873: astore 40\n 875: aload 40\n 877: ifnull 948\n 880: aload 40\n 882: iload 35\n 884: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 887: checkcast #97 // class java/lang/String\n 890: astore 41\n 892: aload 41\n 894: ifnull 948\n 897: aload 41\n 899: astore 42\n 901: istore 43\n 903: astore 44\n 905: iconst_0\n 906: istore 45\n 908: aload 4\n 910: aload 42\n 912: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 917: ifeq 936\n 920: new #62 // class Day10$Coordinate\n 923: dup\n 924: iload 35\n 926: iload 18\n 928: iconst_1\n 929: iadd\n 930: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 933: goto 937\n 936: aconst_null\n 937: astore 46\n 939: aload 44\n 941: iload 43\n 943: aload 46\n 945: goto 949\n 948: aconst_null\n 949: aastore\n 950: aload 39\n 952: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 955: checkcast #83 // class java/lang/Iterable\n 958: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 961: astore 47\n 963: new #123 // class Day10$Node\n 966: dup\n 967: aload 37\n 969: aload 34\n 971: aload 47\n 973: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 976: goto 2461\n 979: iconst_2\n 980: anewarray #62 // class Day10$Coordinate\n 983: astore 39\n 985: aload 39\n 987: iconst_0\n 988: aload_2\n 989: iload 18\n 991: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 994: checkcast #119 // class java/util/List\n 997: astore 40\n 999: aload 40\n 1001: ifnull 1074\n 1004: aload 40\n 1006: iload 35\n 1008: iconst_1\n 1009: isub\n 1010: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1013: checkcast #97 // class java/lang/String\n 1016: astore 41\n 1018: aload 41\n 1020: ifnull 1074\n 1023: aload 41\n 1025: astore 42\n 1027: istore 43\n 1029: astore 44\n 1031: iconst_0\n 1032: istore 45\n 1034: aload 6\n 1036: aload 42\n 1038: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1043: ifeq 1062\n 1046: new #62 // class Day10$Coordinate\n 1049: dup\n 1050: iload 35\n 1052: iconst_1\n 1053: isub\n 1054: iload 18\n 1056: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1059: goto 1063\n 1062: aconst_null\n 1063: astore 46\n 1065: aload 44\n 1067: iload 43\n 1069: aload 46\n 1071: goto 1075\n 1074: aconst_null\n 1075: aastore\n 1076: aload 39\n 1078: iconst_1\n 1079: aload_2\n 1080: iload 18\n 1082: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1085: checkcast #119 // class java/util/List\n 1088: astore 40\n 1090: aload 40\n 1092: ifnull 1165\n 1095: aload 40\n 1097: iload 35\n 1099: iconst_1\n 1100: iadd\n 1101: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1104: checkcast #97 // class java/lang/String\n 1107: astore 41\n 1109: aload 41\n 1111: ifnull 1165\n 1114: aload 41\n 1116: astore 42\n 1118: istore 43\n 1120: astore 44\n 1122: iconst_0\n 1123: istore 45\n 1125: aload 5\n 1127: aload 42\n 1129: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1134: ifeq 1153\n 1137: new #62 // class Day10$Coordinate\n 1140: dup\n 1141: iload 35\n 1143: iconst_1\n 1144: iadd\n 1145: iload 18\n 1147: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1150: goto 1154\n 1153: aconst_null\n 1154: astore 46\n 1156: aload 44\n 1158: iload 43\n 1160: aload 46\n 1162: goto 1166\n 1165: aconst_null\n 1166: aastore\n 1167: aload 39\n 1169: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1172: checkcast #83 // class java/lang/Iterable\n 1175: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 1178: astore 47\n 1180: new #123 // class Day10$Node\n 1183: dup\n 1184: aload 37\n 1186: aload 34\n 1188: aload 47\n 1190: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 1193: goto 2461\n 1196: iconst_2\n 1197: anewarray #62 // class Day10$Coordinate\n 1200: astore 39\n 1202: aload 39\n 1204: iconst_0\n 1205: aload_2\n 1206: iload 18\n 1208: iconst_1\n 1209: isub\n 1210: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1213: checkcast #119 // class java/util/List\n 1216: astore 40\n 1218: aload 40\n 1220: ifnull 1290\n 1223: aload 40\n 1225: iload 35\n 1227: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1230: checkcast #97 // class java/lang/String\n 1233: astore 41\n 1235: aload 41\n 1237: ifnull 1290\n 1240: aload 41\n 1242: astore 42\n 1244: istore 43\n 1246: astore 44\n 1248: iconst_0\n 1249: istore 45\n 1251: aload_3\n 1252: aload 42\n 1254: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1259: ifeq 1278\n 1262: new #62 // class Day10$Coordinate\n 1265: dup\n 1266: iload 35\n 1268: iload 18\n 1270: iconst_1\n 1271: isub\n 1272: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1275: goto 1279\n 1278: aconst_null\n 1279: astore 46\n 1281: aload 44\n 1283: iload 43\n 1285: aload 46\n 1287: goto 1291\n 1290: aconst_null\n 1291: aastore\n 1292: aload 39\n 1294: iconst_1\n 1295: aload_2\n 1296: iload 18\n 1298: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1301: checkcast #119 // class java/util/List\n 1304: astore 40\n 1306: aload 40\n 1308: ifnull 1381\n 1311: aload 40\n 1313: iload 35\n 1315: iconst_1\n 1316: iadd\n 1317: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1320: checkcast #97 // class java/lang/String\n 1323: astore 41\n 1325: aload 41\n 1327: ifnull 1381\n 1330: aload 41\n 1332: astore 42\n 1334: istore 43\n 1336: astore 44\n 1338: iconst_0\n 1339: istore 45\n 1341: aload 5\n 1343: aload 42\n 1345: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1350: ifeq 1369\n 1353: new #62 // class Day10$Coordinate\n 1356: dup\n 1357: iload 35\n 1359: iconst_1\n 1360: iadd\n 1361: iload 18\n 1363: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1366: goto 1370\n 1369: aconst_null\n 1370: astore 46\n 1372: aload 44\n 1374: iload 43\n 1376: aload 46\n 1378: goto 1382\n 1381: aconst_null\n 1382: aastore\n 1383: aload 39\n 1385: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1388: checkcast #83 // class java/lang/Iterable\n 1391: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 1394: astore 47\n 1396: new #123 // class Day10$Node\n 1399: dup\n 1400: aload 37\n 1402: aload 34\n 1404: aload 47\n 1406: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 1409: goto 2461\n 1412: iconst_2\n 1413: anewarray #62 // class Day10$Coordinate\n 1416: astore 39\n 1418: aload 39\n 1420: iconst_0\n 1421: aload_2\n 1422: iload 18\n 1424: iconst_1\n 1425: isub\n 1426: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1429: checkcast #119 // class java/util/List\n 1432: astore 40\n 1434: aload 40\n 1436: ifnull 1506\n 1439: aload 40\n 1441: iload 35\n 1443: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1446: checkcast #97 // class java/lang/String\n 1449: astore 41\n 1451: aload 41\n 1453: ifnull 1506\n 1456: aload 41\n 1458: astore 42\n 1460: istore 43\n 1462: astore 44\n 1464: iconst_0\n 1465: istore 45\n 1467: aload_3\n 1468: aload 42\n 1470: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1475: ifeq 1494\n 1478: new #62 // class Day10$Coordinate\n 1481: dup\n 1482: iload 35\n 1484: iload 18\n 1486: iconst_1\n 1487: isub\n 1488: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1491: goto 1495\n 1494: aconst_null\n 1495: astore 46\n 1497: aload 44\n 1499: iload 43\n 1501: aload 46\n 1503: goto 1507\n 1506: aconst_null\n 1507: aastore\n 1508: aload 39\n 1510: iconst_1\n 1511: aload_2\n 1512: iload 18\n 1514: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1517: checkcast #119 // class java/util/List\n 1520: astore 40\n 1522: aload 40\n 1524: ifnull 1597\n 1527: aload 40\n 1529: iload 35\n 1531: iconst_1\n 1532: isub\n 1533: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1536: checkcast #97 // class java/lang/String\n 1539: astore 41\n 1541: aload 41\n 1543: ifnull 1597\n 1546: aload 41\n 1548: astore 42\n 1550: istore 43\n 1552: astore 44\n 1554: iconst_0\n 1555: istore 45\n 1557: aload 6\n 1559: aload 42\n 1561: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1566: ifeq 1585\n 1569: new #62 // class Day10$Coordinate\n 1572: dup\n 1573: iload 35\n 1575: iconst_1\n 1576: isub\n 1577: iload 18\n 1579: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1582: goto 1586\n 1585: aconst_null\n 1586: astore 46\n 1588: aload 44\n 1590: iload 43\n 1592: aload 46\n 1594: goto 1598\n 1597: aconst_null\n 1598: aastore\n 1599: aload 39\n 1601: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1604: checkcast #83 // class java/lang/Iterable\n 1607: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 1610: astore 47\n 1612: new #123 // class Day10$Node\n 1615: dup\n 1616: aload 37\n 1618: aload 34\n 1620: aload 47\n 1622: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 1625: goto 2461\n 1628: iconst_2\n 1629: anewarray #62 // class Day10$Coordinate\n 1632: astore 39\n 1634: aload 39\n 1636: iconst_0\n 1637: aload_2\n 1638: iload 18\n 1640: iconst_1\n 1641: iadd\n 1642: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1645: checkcast #119 // class java/util/List\n 1648: astore 40\n 1650: aload 40\n 1652: ifnull 1723\n 1655: aload 40\n 1657: iload 35\n 1659: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1662: checkcast #97 // class java/lang/String\n 1665: astore 41\n 1667: aload 41\n 1669: ifnull 1723\n 1672: aload 41\n 1674: astore 42\n 1676: istore 43\n 1678: astore 44\n 1680: iconst_0\n 1681: istore 45\n 1683: aload 4\n 1685: aload 42\n 1687: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1692: ifeq 1711\n 1695: new #62 // class Day10$Coordinate\n 1698: dup\n 1699: iload 35\n 1701: iload 18\n 1703: iconst_1\n 1704: iadd\n 1705: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1708: goto 1712\n 1711: aconst_null\n 1712: astore 46\n 1714: aload 44\n 1716: iload 43\n 1718: aload 46\n 1720: goto 1724\n 1723: aconst_null\n 1724: aastore\n 1725: aload 39\n 1727: iconst_1\n 1728: aload_2\n 1729: iload 18\n 1731: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1734: checkcast #119 // class java/util/List\n 1737: astore 40\n 1739: aload 40\n 1741: ifnull 1814\n 1744: aload 40\n 1746: iload 35\n 1748: iconst_1\n 1749: isub\n 1750: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1753: checkcast #97 // class java/lang/String\n 1756: astore 41\n 1758: aload 41\n 1760: ifnull 1814\n 1763: aload 41\n 1765: astore 42\n 1767: istore 43\n 1769: astore 44\n 1771: iconst_0\n 1772: istore 45\n 1774: aload 6\n 1776: aload 42\n 1778: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1783: ifeq 1802\n 1786: new #62 // class Day10$Coordinate\n 1789: dup\n 1790: iload 35\n 1792: iconst_1\n 1793: isub\n 1794: iload 18\n 1796: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1799: goto 1803\n 1802: aconst_null\n 1803: astore 46\n 1805: aload 44\n 1807: iload 43\n 1809: aload 46\n 1811: goto 1815\n 1814: aconst_null\n 1815: aastore\n 1816: aload 39\n 1818: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1821: checkcast #83 // class java/lang/Iterable\n 1824: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 1827: astore 47\n 1829: new #123 // class Day10$Node\n 1832: dup\n 1833: aload 37\n 1835: aload 34\n 1837: aload 47\n 1839: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 1842: goto 2461\n 1845: iconst_2\n 1846: anewarray #62 // class Day10$Coordinate\n 1849: astore 39\n 1851: aload 39\n 1853: iconst_0\n 1854: aload_2\n 1855: iload 18\n 1857: iconst_1\n 1858: iadd\n 1859: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1862: checkcast #119 // class java/util/List\n 1865: astore 40\n 1867: aload 40\n 1869: ifnull 1940\n 1872: aload 40\n 1874: iload 35\n 1876: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1879: checkcast #97 // class java/lang/String\n 1882: astore 41\n 1884: aload 41\n 1886: ifnull 1940\n 1889: aload 41\n 1891: astore 42\n 1893: istore 43\n 1895: astore 44\n 1897: iconst_0\n 1898: istore 45\n 1900: aload 4\n 1902: aload 42\n 1904: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1909: ifeq 1928\n 1912: new #62 // class Day10$Coordinate\n 1915: dup\n 1916: iload 35\n 1918: iload 18\n 1920: iconst_1\n 1921: iadd\n 1922: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 1925: goto 1929\n 1928: aconst_null\n 1929: astore 46\n 1931: aload 44\n 1933: iload 43\n 1935: aload 46\n 1937: goto 1941\n 1940: aconst_null\n 1941: aastore\n 1942: aload 39\n 1944: iconst_1\n 1945: aload_2\n 1946: iload 18\n 1948: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1951: checkcast #119 // class java/util/List\n 1954: astore 40\n 1956: aload 40\n 1958: ifnull 2031\n 1961: aload 40\n 1963: iload 35\n 1965: iconst_1\n 1966: iadd\n 1967: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 1970: checkcast #97 // class java/lang/String\n 1973: astore 41\n 1975: aload 41\n 1977: ifnull 2031\n 1980: aload 41\n 1982: astore 42\n 1984: istore 43\n 1986: astore 44\n 1988: iconst_0\n 1989: istore 45\n 1991: aload 5\n 1993: aload 42\n 1995: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 2000: ifeq 2019\n 2003: new #62 // class Day10$Coordinate\n 2006: dup\n 2007: iload 35\n 2009: iconst_1\n 2010: iadd\n 2011: iload 18\n 2013: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 2016: goto 2020\n 2019: aconst_null\n 2020: astore 46\n 2022: aload 44\n 2024: iload 43\n 2026: aload 46\n 2028: goto 2032\n 2031: aconst_null\n 2032: aastore\n 2033: aload 39\n 2035: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2038: checkcast #83 // class java/lang/Iterable\n 2041: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 2044: astore 47\n 2046: new #123 // class Day10$Node\n 2049: dup\n 2050: aload 37\n 2052: aload 34\n 2054: aload 47\n 2056: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 2059: goto 2461\n 2062: iconst_4\n 2063: anewarray #62 // class Day10$Coordinate\n 2066: astore 39\n 2068: aload 39\n 2070: iconst_0\n 2071: aload_2\n 2072: iload 18\n 2074: iconst_1\n 2075: isub\n 2076: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2079: checkcast #119 // class java/util/List\n 2082: astore 40\n 2084: aload 40\n 2086: ifnull 2156\n 2089: aload 40\n 2091: iload 35\n 2093: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2096: checkcast #97 // class java/lang/String\n 2099: astore 41\n 2101: aload 41\n 2103: ifnull 2156\n 2106: aload 41\n 2108: astore 42\n 2110: istore 43\n 2112: astore 44\n 2114: iconst_0\n 2115: istore 45\n 2117: aload_3\n 2118: aload 42\n 2120: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 2125: ifeq 2144\n 2128: new #62 // class Day10$Coordinate\n 2131: dup\n 2132: iload 35\n 2134: iload 18\n 2136: iconst_1\n 2137: isub\n 2138: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 2141: goto 2145\n 2144: aconst_null\n 2145: astore 46\n 2147: aload 44\n 2149: iload 43\n 2151: aload 46\n 2153: goto 2157\n 2156: aconst_null\n 2157: aastore\n 2158: aload 39\n 2160: iconst_1\n 2161: aload_2\n 2162: iload 18\n 2164: iconst_1\n 2165: iadd\n 2166: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2169: checkcast #119 // class java/util/List\n 2172: astore 40\n 2174: aload 40\n 2176: ifnull 2247\n 2179: aload 40\n 2181: iload 35\n 2183: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2186: checkcast #97 // class java/lang/String\n 2189: astore 41\n 2191: aload 41\n 2193: ifnull 2247\n 2196: aload 41\n 2198: astore 42\n 2200: istore 43\n 2202: astore 44\n 2204: iconst_0\n 2205: istore 45\n 2207: aload 4\n 2209: aload 42\n 2211: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 2216: ifeq 2235\n 2219: new #62 // class Day10$Coordinate\n 2222: dup\n 2223: iload 35\n 2225: iload 18\n 2227: iconst_1\n 2228: iadd\n 2229: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 2232: goto 2236\n 2235: aconst_null\n 2236: astore 46\n 2238: aload 44\n 2240: iload 43\n 2242: aload 46\n 2244: goto 2248\n 2247: aconst_null\n 2248: aastore\n 2249: aload 39\n 2251: iconst_2\n 2252: aload_2\n 2253: iload 18\n 2255: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2258: checkcast #119 // class java/util/List\n 2261: astore 40\n 2263: aload 40\n 2265: ifnull 2338\n 2268: aload 40\n 2270: iload 35\n 2272: iconst_1\n 2273: isub\n 2274: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2277: checkcast #97 // class java/lang/String\n 2280: astore 41\n 2282: aload 41\n 2284: ifnull 2338\n 2287: aload 41\n 2289: astore 42\n 2291: istore 43\n 2293: astore 44\n 2295: iconst_0\n 2296: istore 45\n 2298: aload 6\n 2300: aload 42\n 2302: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 2307: ifeq 2326\n 2310: new #62 // class Day10$Coordinate\n 2313: dup\n 2314: iload 35\n 2316: iconst_1\n 2317: isub\n 2318: iload 18\n 2320: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 2323: goto 2327\n 2326: aconst_null\n 2327: astore 46\n 2329: aload 44\n 2331: iload 43\n 2333: aload 46\n 2335: goto 2339\n 2338: aconst_null\n 2339: aastore\n 2340: aload 39\n 2342: iconst_3\n 2343: aload_2\n 2344: iload 18\n 2346: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2349: checkcast #119 // class java/util/List\n 2352: astore 40\n 2354: aload 40\n 2356: ifnull 2429\n 2359: aload 40\n 2361: iload 35\n 2363: iconst_1\n 2364: iadd\n 2365: invokestatic #271 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;\n 2368: checkcast #97 // class java/lang/String\n 2371: astore 41\n 2373: aload 41\n 2375: ifnull 2429\n 2378: aload 41\n 2380: astore 42\n 2382: istore 43\n 2384: astore 44\n 2386: iconst_0\n 2387: istore 45\n 2389: aload 5\n 2391: aload 42\n 2393: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 2398: ifeq 2417\n 2401: new #62 // class Day10$Coordinate\n 2404: dup\n 2405: iload 35\n 2407: iconst_1\n 2408: iadd\n 2409: iload 18\n 2411: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 2414: goto 2418\n 2417: aconst_null\n 2418: astore 46\n 2420: aload 44\n 2422: iload 43\n 2424: aload 46\n 2426: goto 2430\n 2429: aconst_null\n 2430: aastore\n 2431: aload 39\n 2433: invokestatic #275 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 2436: checkcast #83 // class java/lang/Iterable\n 2439: invokestatic #279 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 2442: astore 47\n 2444: new #123 // class Day10$Node\n 2447: dup\n 2448: aload 37\n 2450: aload 34\n 2452: aload 47\n 2454: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 2457: goto 2461\n 2460: aconst_null\n 2461: nop\n 2462: dup\n 2463: ifnull 2484\n 2466: astore 48\n 2468: iconst_0\n 2469: istore 49\n 2471: aload 23\n 2473: aload 48\n 2475: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 2480: pop\n 2481: goto 2485\n 2484: pop\n 2485: nop\n 2486: goto 525\n 2489: nop\n 2490: aload 23\n 2492: checkcast #119 // class java/util/List\n 2495: nop\n 2496: nop\n 2497: aload 50\n 2499: swap\n 2500: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 2505: pop\n 2506: goto 425\n 2509: aload 11\n 2511: checkcast #119 // class java/util/List\n 2514: nop\n 2515: checkcast #83 // class java/lang/Iterable\n 2518: invokestatic #285 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;\n 2521: astore 7\n 2523: aload 7\n 2525: checkcast #83 // class java/lang/Iterable\n 2528: astore 8\n 2530: iconst_0\n 2531: istore 9\n 2533: aload 8\n 2535: bipush 10\n 2537: invokestatic #218 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 2540: invokestatic #291 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 2543: bipush 16\n 2545: invokestatic #297 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 2548: istore 10\n 2550: aload 8\n 2552: astore 11\n 2554: new #32 // class java/util/LinkedHashMap\n 2557: dup\n 2558: iload 10\n 2560: invokespecial #298 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 2563: checkcast #35 // class java/util/Map\n 2566: astore 12\n 2568: iconst_0\n 2569: istore 13\n 2571: aload 11\n 2573: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 2578: astore 14\n 2580: aload 14\n 2582: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 2587: ifeq 2632\n 2590: aload 14\n 2592: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 2597: astore 15\n 2599: aload 12\n 2601: aload 15\n 2603: checkcast #123 // class Day10$Node\n 2606: astore 16\n 2608: astore 50\n 2610: iconst_0\n 2611: istore 17\n 2613: aload 16\n 2615: invokevirtual #147 // Method Day10$Node.getCoordinate:()LDay10$Coordinate;\n 2618: aload 50\n 2620: swap\n 2621: aload 15\n 2623: invokeinterface #156, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 2628: pop\n 2629: goto 2580\n 2632: aload 12\n 2634: nop\n 2635: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokevirtual #26 // Method parse:(Ljava/util/List;)Ljava/util/Map;\n 11: astore_2\n 12: aload_0\n 13: aload_2\n 14: invokespecial #30 // Method findNodesInLoop:(Ljava/util/Map;)Ljava/util/Set;\n 17: astore_3\n 18: aload_1\n 19: checkcast #83 // class java/lang/Iterable\n 22: astore 5\n 24: iconst_0\n 25: istore 6\n 27: aload 5\n 29: astore 7\n 31: new #214 // class java/util/ArrayList\n 34: dup\n 35: aload 5\n 37: bipush 10\n 39: invokestatic #218 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 42: invokespecial #221 // Method java/util/ArrayList.\"<init>\":(I)V\n 45: checkcast #142 // class java/util/Collection\n 48: astore 8\n 50: iconst_0\n 51: istore 9\n 53: iconst_0\n 54: istore 10\n 56: aload 7\n 58: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 63: astore 11\n 65: aload 11\n 67: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 72: ifeq 318\n 75: aload 11\n 77: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 82: astore 12\n 84: aload 8\n 86: iload 10\n 88: iinc 10, 1\n 91: istore 13\n 93: iload 13\n 95: ifge 101\n 98: invokestatic #258 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 101: iload 13\n 103: aload 12\n 105: checkcast #97 // class java/lang/String\n 108: astore 14\n 110: istore 15\n 112: astore 39\n 114: iconst_0\n 115: istore 16\n 117: aload 14\n 119: checkcast #223 // class java/lang/CharSequence\n 122: astore 17\n 124: iconst_0\n 125: istore 18\n 127: aload 17\n 129: astore 19\n 131: new #214 // class java/util/ArrayList\n 134: dup\n 135: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 138: checkcast #142 // class java/util/Collection\n 141: astore 20\n 143: iconst_0\n 144: istore 21\n 146: aload 19\n 148: astore 22\n 150: iconst_0\n 151: istore 23\n 153: iconst_0\n 154: istore 24\n 156: iconst_0\n 157: istore 25\n 159: iload 25\n 161: aload 22\n 163: invokeinterface #373, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 168: if_icmpge 280\n 171: aload 22\n 173: iload 25\n 175: invokeinterface #377, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 180: istore 26\n 182: iload 24\n 184: iinc 24, 1\n 187: iload 26\n 189: istore 27\n 191: istore 28\n 193: iconst_0\n 194: istore 29\n 196: iload 28\n 198: iload 27\n 200: istore 30\n 202: istore 31\n 204: iconst_0\n 205: istore 32\n 207: new #62 // class Day10$Coordinate\n 210: dup\n 211: iload 31\n 213: iload 15\n 215: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 218: astore 33\n 220: iload 30\n 222: bipush 46\n 224: if_icmpeq 238\n 227: aload_3\n 228: aload 33\n 230: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 235: ifne 244\n 238: ldc_w #379 // String .\n 241: goto 249\n 244: iload 30\n 246: invokestatic #382 // Method java/lang/String.valueOf:(C)Ljava/lang/String;\n 249: nop\n 250: dup\n 251: ifnull 272\n 254: astore 34\n 256: iconst_0\n 257: istore 35\n 259: aload 20\n 261: aload 34\n 263: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 268: pop\n 269: goto 273\n 272: pop\n 273: nop\n 274: iinc 25, 1\n 277: goto 159\n 280: nop\n 281: aload 20\n 283: checkcast #119 // class java/util/List\n 286: nop\n 287: checkcast #83 // class java/lang/Iterable\n 290: ldc #225 // String\n 292: checkcast #223 // class java/lang/CharSequence\n 295: aconst_null\n 296: aconst_null\n 297: iconst_0\n 298: aconst_null\n 299: aconst_null\n 300: bipush 62\n 302: aconst_null\n 303: invokestatic #386 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 306: aload 39\n 308: swap\n 309: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 314: pop\n 315: goto 65\n 318: aload 8\n 320: checkcast #119 // class java/util/List\n 323: nop\n 324: astore 4\n 326: aload_2\n 327: astore 6\n 329: iconst_0\n 330: istore 7\n 332: new #32 // class java/util/LinkedHashMap\n 335: dup\n 336: invokespecial #33 // Method java/util/LinkedHashMap.\"<init>\":()V\n 339: astore 8\n 341: aload 6\n 343: invokeinterface #39, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 348: invokeinterface #45, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 353: astore 9\n 355: aload 9\n 357: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 362: ifeq 426\n 365: aload 9\n 367: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 372: checkcast #57 // class java/util/Map$Entry\n 375: astore 10\n 377: aload 10\n 379: invokeinterface #60, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 384: checkcast #62 // class Day10$Coordinate\n 387: astore 11\n 389: iconst_0\n 390: istore 12\n 392: aload_3\n 393: aload 11\n 395: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 400: ifeq 355\n 403: aload 8\n 405: aload 10\n 407: invokeinterface #60, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 412: aload 10\n 414: invokeinterface #69, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 419: invokevirtual #73 // Method java/util/LinkedHashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 422: pop\n 423: goto 355\n 426: aload 8\n 428: checkcast #35 // class java/util/Map\n 431: astore 5\n 433: aload 5\n 435: astore 7\n 437: iconst_0\n 438: istore 8\n 440: aload 7\n 442: astore 9\n 444: new #214 // class java/util/ArrayList\n 447: dup\n 448: aload 7\n 450: invokeinterface #389, 1 // InterfaceMethod java/util/Map.size:()I\n 455: invokespecial #221 // Method java/util/ArrayList.\"<init>\":(I)V\n 458: checkcast #142 // class java/util/Collection\n 461: astore 10\n 463: iconst_0\n 464: istore 11\n 466: aload 9\n 468: invokeinterface #39, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 473: invokeinterface #45, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 478: astore 12\n 480: aload 12\n 482: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 487: ifeq 605\n 490: aload 12\n 492: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 497: checkcast #57 // class java/util/Map$Entry\n 500: astore 13\n 502: aload 10\n 504: aload 13\n 506: astore 14\n 508: astore 39\n 510: iconst_0\n 511: istore 15\n 513: aload 14\n 515: invokeinterface #60, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 520: checkcast #62 // class Day10$Coordinate\n 523: astore 16\n 525: aload 14\n 527: invokeinterface #69, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 532: checkcast #123 // class Day10$Node\n 535: astore 17\n 537: aload 17\n 539: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 542: ldc #129 // String S\n 544: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 547: ifeq 585\n 550: aload 16\n 552: new #123 // class Day10$Node\n 555: dup\n 556: aload 16\n 558: getstatic #392 // Field INSTANCE:LDay10;\n 561: ldc #129 // String S\n 563: aload 17\n 565: invokevirtual #181 // Method Day10$Node.getConnections:()Ljava/util/List;\n 568: invokespecial #396 // Method translate:(Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;\n 571: aload 17\n 573: invokevirtual #181 // Method Day10$Node.getConnections:()Ljava/util/List;\n 576: invokespecial #282 // Method Day10$Node.\"<init>\":(LDay10$Coordinate;Ljava/lang/String;Ljava/util/List;)V\n 579: invokestatic #402 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 582: goto 592\n 585: aload 16\n 587: aload 17\n 589: invokestatic #402 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 592: nop\n 593: aload 39\n 595: swap\n 596: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 601: pop\n 602: goto 480\n 605: aload 10\n 607: checkcast #119 // class java/util/List\n 610: nop\n 611: checkcast #83 // class java/lang/Iterable\n 614: invokestatic #406 // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;\n 617: astore 6\n 619: aload 4\n 621: checkcast #83 // class java/lang/Iterable\n 624: astore 8\n 626: iconst_0\n 627: istore 9\n 629: aload 8\n 631: astore 10\n 633: new #214 // class java/util/ArrayList\n 636: dup\n 637: aload 8\n 639: bipush 10\n 641: invokestatic #218 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 644: invokespecial #221 // Method java/util/ArrayList.\"<init>\":(I)V\n 647: checkcast #142 // class java/util/Collection\n 650: astore 11\n 652: iconst_0\n 653: istore 12\n 655: iconst_0\n 656: istore 13\n 658: aload 10\n 660: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 665: astore 14\n 667: aload 14\n 669: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 674: ifeq 886\n 677: aload 14\n 679: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 684: astore 15\n 686: aload 11\n 688: iload 13\n 690: iinc 13, 1\n 693: istore 16\n 695: iload 16\n 697: ifge 703\n 700: invokestatic #258 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 703: iload 16\n 705: aload 15\n 707: checkcast #97 // class java/lang/String\n 710: astore 17\n 712: istore 18\n 714: astore 39\n 716: iconst_0\n 717: istore 19\n 719: aload 17\n 721: checkcast #223 // class java/lang/CharSequence\n 724: astore 20\n 726: iconst_0\n 727: istore 21\n 729: aload 20\n 731: astore 22\n 733: new #214 // class java/util/ArrayList\n 736: dup\n 737: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 740: checkcast #142 // class java/util/Collection\n 743: astore 23\n 745: iconst_0\n 746: istore 24\n 748: aload 22\n 750: astore 25\n 752: iconst_0\n 753: istore 26\n 755: iconst_0\n 756: istore 27\n 758: iconst_0\n 759: istore 28\n 761: iload 28\n 763: aload 25\n 765: invokeinterface #373, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 770: if_icmpge 866\n 773: aload 25\n 775: iload 28\n 777: invokeinterface #377, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 782: istore 29\n 784: iload 27\n 786: iinc 27, 1\n 789: iload 29\n 791: istore 30\n 793: istore 31\n 795: iconst_0\n 796: istore 32\n 798: iload 31\n 800: iload 30\n 802: istore 33\n 804: istore 34\n 806: iconst_0\n 807: istore 35\n 809: new #62 // class Day10$Coordinate\n 812: dup\n 813: iload 34\n 815: iload 18\n 817: invokespecial #261 // Method Day10$Coordinate.\"<init>\":(II)V\n 820: astore 36\n 822: iload 33\n 824: bipush 46\n 826: if_icmpne 834\n 829: aload 36\n 831: goto 835\n 834: aconst_null\n 835: nop\n 836: dup\n 837: ifnull 858\n 840: astore 37\n 842: iconst_0\n 843: istore 38\n 845: aload 23\n 847: aload 37\n 849: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 854: pop\n 855: goto 859\n 858: pop\n 859: nop\n 860: iinc 28, 1\n 863: goto 761\n 866: nop\n 867: aload 23\n 869: checkcast #119 // class java/util/List\n 872: nop\n 873: nop\n 874: aload 39\n 876: swap\n 877: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 882: pop\n 883: goto 667\n 886: aload 11\n 888: checkcast #119 // class java/util/List\n 891: nop\n 892: checkcast #83 // class java/lang/Iterable\n 895: invokestatic #285 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;\n 898: checkcast #83 // class java/lang/Iterable\n 901: invokestatic #410 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 904: astore 7\n 906: aload 7\n 908: checkcast #83 // class java/lang/Iterable\n 911: astore 8\n 913: iconst_0\n 914: istore 9\n 916: aload 8\n 918: instanceof #142 // class java/util/Collection\n 921: ifeq 941\n 924: aload 8\n 926: checkcast #142 // class java/util/Collection\n 929: invokeinterface #159, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 934: ifeq 941\n 937: iconst_0\n 938: goto 1011\n 941: iconst_0\n 942: istore 10\n 944: aload 8\n 946: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 951: astore 11\n 953: aload 11\n 955: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 960: ifeq 1009\n 963: aload 11\n 965: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 970: astore 12\n 972: aload 12\n 974: checkcast #62 // class Day10$Coordinate\n 977: astore 13\n 979: iconst_0\n 980: istore 14\n 982: getstatic #392 // Field INSTANCE:LDay10;\n 985: aload 6\n 987: aload 13\n 989: invokespecial #414 // Method isInPolygon:(Ljava/util/Map;LDay10$Coordinate;)Z\n 992: ifeq 953\n 995: iinc 10, 1\n 998: iload 10\n 1000: ifge 953\n 1003: invokestatic #417 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 1006: goto 953\n 1009: iload 10\n 1011: invokestatic #101 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 1014: areturn\n\n private final java.lang.String translate(java.lang.String, java.util.List<Day10$Coordinate>);\n Code:\n 0: aload_2\n 1: checkcast #83 // class java/lang/Iterable\n 4: iconst_2\n 5: anewarray #440 // class kotlin/jvm/functions/Function1\n 8: astore 4\n 10: aload 4\n 12: iconst_0\n 13: invokedynamic #458, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 18: aastore\n 19: aload 4\n 21: iconst_1\n 22: invokedynamic #463, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 27: aastore\n 28: aload 4\n 30: invokestatic #469 // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;\n 33: invokestatic #473 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 36: astore_3\n 37: aload_3\n 38: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 41: checkcast #62 // class Day10$Coordinate\n 44: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 47: aload_3\n 48: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 51: checkcast #62 // class Day10$Coordinate\n 54: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 57: isub\n 58: ifne 65\n 61: iconst_1\n 62: goto 66\n 65: iconst_0\n 66: istore 4\n 68: aload_3\n 69: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 72: checkcast #62 // class Day10$Coordinate\n 75: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 78: aload_3\n 79: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 82: checkcast #62 // class Day10$Coordinate\n 85: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 88: isub\n 89: ifne 96\n 92: iconst_1\n 93: goto 97\n 96: iconst_0\n 97: istore 5\n 99: aload_3\n 100: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 103: checkcast #62 // class Day10$Coordinate\n 106: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 109: aload_3\n 110: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 113: checkcast #62 // class Day10$Coordinate\n 116: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 119: if_icmple 149\n 122: aload_3\n 123: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 126: checkcast #62 // class Day10$Coordinate\n 129: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 132: aload_3\n 133: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 136: checkcast #62 // class Day10$Coordinate\n 139: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 142: if_icmpge 149\n 145: iconst_1\n 146: goto 150\n 149: iconst_0\n 150: istore 6\n 152: aload_3\n 153: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 156: checkcast #62 // class Day10$Coordinate\n 159: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 162: aload_3\n 163: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 166: checkcast #62 // class Day10$Coordinate\n 169: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 172: if_icmple 202\n 175: aload_3\n 176: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 179: checkcast #62 // class Day10$Coordinate\n 182: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 185: aload_3\n 186: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 189: checkcast #62 // class Day10$Coordinate\n 192: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 195: if_icmple 202\n 198: iconst_1\n 199: goto 203\n 202: iconst_0\n 203: istore 7\n 205: aload_3\n 206: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 209: checkcast #62 // class Day10$Coordinate\n 212: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 215: aload_3\n 216: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 219: checkcast #62 // class Day10$Coordinate\n 222: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 225: if_icmpge 255\n 228: aload_3\n 229: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 232: checkcast #62 // class Day10$Coordinate\n 235: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 238: aload_3\n 239: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 242: checkcast #62 // class Day10$Coordinate\n 245: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 248: if_icmpge 255\n 251: iconst_1\n 252: goto 256\n 255: iconst_0\n 256: istore 8\n 258: aload_3\n 259: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 262: checkcast #62 // class Day10$Coordinate\n 265: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 268: aload_3\n 269: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 272: checkcast #62 // class Day10$Coordinate\n 275: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 278: if_icmpge 308\n 281: aload_3\n 282: invokestatic #477 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 285: checkcast #62 // class Day10$Coordinate\n 288: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 291: aload_3\n 292: invokestatic #483 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 295: checkcast #62 // class Day10$Coordinate\n 298: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 301: if_icmple 308\n 304: iconst_1\n 305: goto 309\n 308: iconst_0\n 309: istore 9\n 311: nop\n 312: iload 5\n 314: ifeq 322\n 317: ldc #255 // String -\n 319: goto 373\n 322: iload 4\n 324: ifeq 332\n 327: ldc #239 // String |\n 329: goto 373\n 332: iload 6\n 334: ifeq 342\n 337: ldc #253 // String L\n 339: goto 373\n 342: iload 7\n 344: ifeq 352\n 347: ldc #243 // String F\n 349: goto 373\n 352: iload 9\n 354: ifeq 362\n 357: ldc #251 // String J\n 359: goto 373\n 362: iload 8\n 364: ifeq 372\n 367: ldc #241 // String 7\n 369: goto 373\n 372: aload_1\n 373: areturn\n\n private final java.util.Set<Day10$Coordinate> findNodesInLoop(java.util.Map<Day10$Coordinate, Day10$Node>);\n Code:\n 0: aload_1\n 1: invokeinterface #81, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 6: checkcast #83 // class java/lang/Iterable\n 9: astore 4\n 11: aload 4\n 13: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 18: astore 5\n 20: aload 5\n 22: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 27: ifeq 67\n 30: aload 5\n 32: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 37: astore 6\n 39: aload 6\n 41: checkcast #123 // class Day10$Node\n 44: astore 7\n 46: iconst_0\n 47: istore 8\n 49: aload 7\n 51: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 54: ldc #129 // String S\n 56: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 59: ifeq 20\n 62: aload 6\n 64: goto 68\n 67: aconst_null\n 68: dup\n 69: invokestatic #137 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 72: checkcast #123 // class Day10$Node\n 75: astore_2\n 76: new #139 // class java/util/LinkedHashSet\n 79: dup\n 80: invokespecial #140 // Method java/util/LinkedHashSet.\"<init>\":()V\n 83: checkcast #41 // class java/util/Set\n 86: astore_3\n 87: new #500 // class kotlin/collections/ArrayDeque\n 90: dup\n 91: invokespecial #501 // Method kotlin/collections/ArrayDeque.\"<init>\":()V\n 94: astore 4\n 96: aload 4\n 98: aload_2\n 99: invokevirtual #147 // Method Day10$Node.getCoordinate:()LDay10$Coordinate;\n 102: invokevirtual #502 // Method kotlin/collections/ArrayDeque.add:(Ljava/lang/Object;)Z\n 105: pop\n 106: aload 4\n 108: checkcast #142 // class java/util/Collection\n 111: invokeinterface #159, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 116: ifne 123\n 119: iconst_1\n 120: goto 124\n 123: iconst_0\n 124: ifeq 204\n 127: aload 4\n 129: invokevirtual #505 // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;\n 132: checkcast #62 // class Day10$Coordinate\n 135: astore 5\n 137: aload_3\n 138: aload 5\n 140: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 145: ifeq 151\n 148: goto 106\n 151: aload 4\n 153: aload_1\n 154: aload 5\n 156: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 161: checkcast #123 // class Day10$Node\n 164: dup\n 165: ifnull 181\n 168: invokevirtual #181 // Method Day10$Node.getConnections:()Ljava/util/List;\n 171: dup\n 172: ifnull 181\n 175: checkcast #142 // class java/util/Collection\n 178: goto 188\n 181: pop\n 182: invokestatic #184 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 185: checkcast #142 // class java/util/Collection\n 188: invokevirtual #509 // Method kotlin/collections/ArrayDeque.addAll:(Ljava/util/Collection;)Z\n 191: pop\n 192: aload_3\n 193: aload 5\n 195: invokeinterface #150, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 200: pop\n 201: goto 106\n 204: aload_3\n 205: areturn\n\n private final boolean isInPolygon(java.util.Map<Day10$Coordinate, Day10$Node>, Day10$Coordinate);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokevirtual #517 // Method isInPolygonAbove:(Ljava/util/Map;LDay10$Coordinate;)Z\n 6: ifeq 40\n 9: aload_0\n 10: aload_1\n 11: aload_2\n 12: invokevirtual #520 // Method isInPolygonBelow:(Ljava/util/Map;LDay10$Coordinate;)Z\n 15: ifeq 40\n 18: aload_0\n 19: aload_1\n 20: aload_2\n 21: invokevirtual #523 // Method isInPolygonLeft:(Ljava/util/Map;LDay10$Coordinate;)Z\n 24: ifeq 40\n 27: aload_0\n 28: aload_1\n 29: aload_2\n 30: invokevirtual #526 // Method isInPolygonRight:(Ljava/util/Map;LDay10$Coordinate;)Z\n 33: ifeq 40\n 36: iconst_1\n 37: goto 41\n 40: iconst_0\n 41: ireturn\n\n public final boolean isInPolygonRight(java.util.Map<Day10$Coordinate, Day10$Node>, Day10$Coordinate);\n Code:\n 0: aload_1\n 1: ldc_w #527 // String graph\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc_w #528 // String coordinate\n 11: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_1\n 15: invokeinterface #531, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 20: checkcast #83 // class java/lang/Iterable\n 23: astore 4\n 25: iconst_0\n 26: istore 5\n 28: aload 4\n 30: astore 6\n 32: new #214 // class java/util/ArrayList\n 35: dup\n 36: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 39: checkcast #142 // class java/util/Collection\n 42: astore 7\n 44: iconst_0\n 45: istore 8\n 47: aload 6\n 49: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 54: astore 9\n 56: aload 9\n 58: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 63: ifeq 118\n 66: aload 9\n 68: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 73: astore 10\n 75: aload 10\n 77: checkcast #62 // class Day10$Coordinate\n 80: astore 11\n 82: iconst_0\n 83: istore 12\n 85: aload 11\n 87: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 90: aload_2\n 91: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 94: if_icmple 101\n 97: iconst_1\n 98: goto 102\n 101: iconst_0\n 102: ifeq 56\n 105: aload 7\n 107: aload 10\n 109: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 114: pop\n 115: goto 56\n 118: aload 7\n 120: checkcast #119 // class java/util/List\n 123: nop\n 124: checkcast #83 // class java/lang/Iterable\n 127: astore 4\n 129: nop\n 130: iconst_0\n 131: istore 5\n 133: aload 4\n 135: astore 6\n 137: new #214 // class java/util/ArrayList\n 140: dup\n 141: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 144: checkcast #142 // class java/util/Collection\n 147: astore 7\n 149: iconst_0\n 150: istore 8\n 152: aload 6\n 154: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 159: astore 9\n 161: aload 9\n 163: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 168: ifeq 223\n 171: aload 9\n 173: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 178: astore 10\n 180: aload 10\n 182: checkcast #62 // class Day10$Coordinate\n 185: astore 11\n 187: iconst_0\n 188: istore 12\n 190: aload 11\n 192: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 195: aload_2\n 196: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 199: if_icmpne 206\n 202: iconst_1\n 203: goto 207\n 206: iconst_0\n 207: ifeq 161\n 210: aload 7\n 212: aload 10\n 214: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 219: pop\n 220: goto 161\n 223: aload 7\n 225: checkcast #119 // class java/util/List\n 228: nop\n 229: astore_3\n 230: aload_3\n 231: checkcast #83 // class java/lang/Iterable\n 234: astore 5\n 236: nop\n 237: iconst_0\n 238: istore 6\n 240: aload 5\n 242: astore 7\n 244: new #214 // class java/util/ArrayList\n 247: dup\n 248: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 251: checkcast #142 // class java/util/Collection\n 254: astore 8\n 256: iconst_0\n 257: istore 9\n 259: aload 7\n 261: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 266: astore 10\n 268: aload 10\n 270: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 275: ifeq 341\n 278: aload 10\n 280: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 285: astore 11\n 287: aload 11\n 289: checkcast #62 // class Day10$Coordinate\n 292: astore 12\n 294: iconst_0\n 295: istore 13\n 297: aload_1\n 298: aload 12\n 300: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 305: checkcast #123 // class Day10$Node\n 308: dup\n 309: ifnull 318\n 312: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 315: goto 320\n 318: pop\n 319: aconst_null\n 320: ldc #239 // String |\n 322: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 325: ifeq 268\n 328: aload 8\n 330: aload 11\n 332: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 337: pop\n 338: goto 268\n 341: aload 8\n 343: checkcast #119 // class java/util/List\n 346: nop\n 347: astore 4\n 349: iconst_2\n 350: anewarray #97 // class java/lang/String\n 353: astore 6\n 355: aload 6\n 357: iconst_0\n 358: ldc_w #533 // String FJ\n 361: aastore\n 362: aload 6\n 364: iconst_1\n 365: ldc_w #535 // String L7\n 368: aastore\n 369: aload 6\n 371: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 374: astore 5\n 376: aload_3\n 377: checkcast #83 // class java/lang/Iterable\n 380: astore 7\n 382: nop\n 383: iconst_0\n 384: istore 8\n 386: aload 7\n 388: astore 9\n 390: new #214 // class java/util/ArrayList\n 393: dup\n 394: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 397: checkcast #142 // class java/util/Collection\n 400: astore 10\n 402: iconst_0\n 403: istore 11\n 405: aload 9\n 407: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 412: astore 12\n 414: aload 12\n 416: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 421: ifeq 495\n 424: aload 12\n 426: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 431: astore 13\n 433: aload 13\n 435: checkcast #62 // class Day10$Coordinate\n 438: astore 14\n 440: iconst_0\n 441: istore 15\n 443: aload_1\n 444: aload 14\n 446: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 451: checkcast #123 // class Day10$Node\n 454: dup\n 455: ifnull 464\n 458: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 461: goto 466\n 464: pop\n 465: aconst_null\n 466: ldc #255 // String -\n 468: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 471: ifne 478\n 474: iconst_1\n 475: goto 479\n 478: iconst_0\n 479: ifeq 414\n 482: aload 10\n 484: aload 13\n 486: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 491: pop\n 492: goto 414\n 495: aload 10\n 497: checkcast #119 // class java/util/List\n 500: nop\n 501: checkcast #83 // class java/lang/Iterable\n 504: invokestatic #538 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 507: checkcast #83 // class java/lang/Iterable\n 510: astore 7\n 512: iconst_0\n 513: istore 8\n 515: aload 7\n 517: astore 9\n 519: new #214 // class java/util/ArrayList\n 522: dup\n 523: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 526: checkcast #142 // class java/util/Collection\n 529: astore 10\n 531: iconst_0\n 532: istore 11\n 534: aload 9\n 536: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 541: astore 12\n 543: aload 12\n 545: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 550: ifeq 677\n 553: aload 12\n 555: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 560: astore 13\n 562: aload 13\n 564: checkcast #437 // class kotlin/Pair\n 567: astore 14\n 569: iconst_0\n 570: istore 15\n 572: aload 14\n 574: invokevirtual #541 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 577: checkcast #62 // class Day10$Coordinate\n 580: astore 16\n 582: aload 14\n 584: invokevirtual #544 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 587: checkcast #62 // class Day10$Coordinate\n 590: astore 17\n 592: aload 5\n 594: new #546 // class java/lang/StringBuilder\n 597: dup\n 598: invokespecial #547 // Method java/lang/StringBuilder.\"<init>\":()V\n 601: aload_1\n 602: aload 16\n 604: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 609: checkcast #123 // class Day10$Node\n 612: dup\n 613: ifnull 622\n 616: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 619: goto 624\n 622: pop\n 623: aconst_null\n 624: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 627: aload_1\n 628: aload 17\n 630: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 635: checkcast #123 // class Day10$Node\n 638: dup\n 639: ifnull 648\n 642: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 645: goto 650\n 648: pop\n 649: aconst_null\n 650: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 653: invokevirtual #554 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 656: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 661: ifeq 543\n 664: aload 10\n 666: aload 13\n 668: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 673: pop\n 674: goto 543\n 677: aload 10\n 679: checkcast #119 // class java/util/List\n 682: nop\n 683: astore 6\n 685: aload 6\n 687: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 692: aload 4\n 694: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 699: iadd\n 700: iconst_2\n 701: irem\n 702: iconst_1\n 703: if_icmpne 710\n 706: iconst_1\n 707: goto 711\n 710: iconst_0\n 711: ireturn\n\n public final boolean isInPolygonLeft(java.util.Map<Day10$Coordinate, Day10$Node>, Day10$Coordinate);\n Code:\n 0: aload_1\n 1: ldc_w #527 // String graph\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc_w #528 // String coordinate\n 11: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_1\n 15: invokeinterface #531, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 20: checkcast #83 // class java/lang/Iterable\n 23: astore 4\n 25: iconst_0\n 26: istore 5\n 28: aload 4\n 30: astore 6\n 32: new #214 // class java/util/ArrayList\n 35: dup\n 36: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 39: checkcast #142 // class java/util/Collection\n 42: astore 7\n 44: iconst_0\n 45: istore 8\n 47: aload 6\n 49: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 54: astore 9\n 56: aload 9\n 58: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 63: ifeq 118\n 66: aload 9\n 68: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 73: astore 10\n 75: aload 10\n 77: checkcast #62 // class Day10$Coordinate\n 80: astore 11\n 82: iconst_0\n 83: istore 12\n 85: aload 11\n 87: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 90: aload_2\n 91: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 94: if_icmpge 101\n 97: iconst_1\n 98: goto 102\n 101: iconst_0\n 102: ifeq 56\n 105: aload 7\n 107: aload 10\n 109: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 114: pop\n 115: goto 56\n 118: aload 7\n 120: checkcast #119 // class java/util/List\n 123: nop\n 124: checkcast #83 // class java/lang/Iterable\n 127: astore 4\n 129: nop\n 130: iconst_0\n 131: istore 5\n 133: aload 4\n 135: astore 6\n 137: new #214 // class java/util/ArrayList\n 140: dup\n 141: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 144: checkcast #142 // class java/util/Collection\n 147: astore 7\n 149: iconst_0\n 150: istore 8\n 152: aload 6\n 154: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 159: astore 9\n 161: aload 9\n 163: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 168: ifeq 223\n 171: aload 9\n 173: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 178: astore 10\n 180: aload 10\n 182: checkcast #62 // class Day10$Coordinate\n 185: astore 11\n 187: iconst_0\n 188: istore 12\n 190: aload 11\n 192: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 195: aload_2\n 196: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 199: if_icmpne 206\n 202: iconst_1\n 203: goto 207\n 206: iconst_0\n 207: ifeq 161\n 210: aload 7\n 212: aload 10\n 214: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 219: pop\n 220: goto 161\n 223: aload 7\n 225: checkcast #119 // class java/util/List\n 228: nop\n 229: checkcast #83 // class java/lang/Iterable\n 232: astore 4\n 234: nop\n 235: iconst_0\n 236: istore 5\n 238: aload 4\n 240: new #568 // class Day10$isInPolygonLeft$$inlined$sortedByDescending$1\n 243: dup\n 244: invokespecial #569 // Method Day10$isInPolygonLeft$$inlined$sortedByDescending$1.\"<init>\":()V\n 247: checkcast #571 // class java/util/Comparator\n 250: invokestatic #473 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 253: astore_3\n 254: aload_3\n 255: checkcast #83 // class java/lang/Iterable\n 258: astore 5\n 260: nop\n 261: iconst_0\n 262: istore 6\n 264: aload 5\n 266: astore 7\n 268: new #214 // class java/util/ArrayList\n 271: dup\n 272: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 275: checkcast #142 // class java/util/Collection\n 278: astore 8\n 280: iconst_0\n 281: istore 9\n 283: aload 7\n 285: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 290: astore 10\n 292: aload 10\n 294: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 299: ifeq 365\n 302: aload 10\n 304: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 309: astore 11\n 311: aload 11\n 313: checkcast #62 // class Day10$Coordinate\n 316: astore 12\n 318: iconst_0\n 319: istore 13\n 321: aload_1\n 322: aload 12\n 324: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 329: checkcast #123 // class Day10$Node\n 332: dup\n 333: ifnull 342\n 336: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 339: goto 344\n 342: pop\n 343: aconst_null\n 344: ldc #239 // String |\n 346: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 349: ifeq 292\n 352: aload 8\n 354: aload 11\n 356: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 361: pop\n 362: goto 292\n 365: aload 8\n 367: checkcast #119 // class java/util/List\n 370: nop\n 371: astore 4\n 373: iconst_2\n 374: anewarray #97 // class java/lang/String\n 377: astore 6\n 379: aload 6\n 381: iconst_0\n 382: ldc_w #573 // String JF\n 385: aastore\n 386: aload 6\n 388: iconst_1\n 389: ldc_w #575 // String 7L\n 392: aastore\n 393: aload 6\n 395: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 398: astore 5\n 400: aload_3\n 401: checkcast #83 // class java/lang/Iterable\n 404: astore 7\n 406: nop\n 407: iconst_0\n 408: istore 8\n 410: aload 7\n 412: astore 9\n 414: new #214 // class java/util/ArrayList\n 417: dup\n 418: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 421: checkcast #142 // class java/util/Collection\n 424: astore 10\n 426: iconst_0\n 427: istore 11\n 429: aload 9\n 431: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 436: astore 12\n 438: aload 12\n 440: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 445: ifeq 519\n 448: aload 12\n 450: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 455: astore 13\n 457: aload 13\n 459: checkcast #62 // class Day10$Coordinate\n 462: astore 14\n 464: iconst_0\n 465: istore 15\n 467: aload_1\n 468: aload 14\n 470: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 475: checkcast #123 // class Day10$Node\n 478: dup\n 479: ifnull 488\n 482: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 485: goto 490\n 488: pop\n 489: aconst_null\n 490: ldc #255 // String -\n 492: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 495: ifne 502\n 498: iconst_1\n 499: goto 503\n 502: iconst_0\n 503: ifeq 438\n 506: aload 10\n 508: aload 13\n 510: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 515: pop\n 516: goto 438\n 519: aload 10\n 521: checkcast #119 // class java/util/List\n 524: nop\n 525: checkcast #83 // class java/lang/Iterable\n 528: invokestatic #538 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 531: checkcast #83 // class java/lang/Iterable\n 534: astore 7\n 536: iconst_0\n 537: istore 8\n 539: aload 7\n 541: astore 9\n 543: new #214 // class java/util/ArrayList\n 546: dup\n 547: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 550: checkcast #142 // class java/util/Collection\n 553: astore 10\n 555: iconst_0\n 556: istore 11\n 558: aload 9\n 560: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 565: astore 12\n 567: aload 12\n 569: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 574: ifeq 701\n 577: aload 12\n 579: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 584: astore 13\n 586: aload 13\n 588: checkcast #437 // class kotlin/Pair\n 591: astore 14\n 593: iconst_0\n 594: istore 15\n 596: aload 14\n 598: invokevirtual #541 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 601: checkcast #62 // class Day10$Coordinate\n 604: astore 16\n 606: aload 14\n 608: invokevirtual #544 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 611: checkcast #62 // class Day10$Coordinate\n 614: astore 17\n 616: aload 5\n 618: new #546 // class java/lang/StringBuilder\n 621: dup\n 622: invokespecial #547 // Method java/lang/StringBuilder.\"<init>\":()V\n 625: aload_1\n 626: aload 16\n 628: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 633: checkcast #123 // class Day10$Node\n 636: dup\n 637: ifnull 646\n 640: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 643: goto 648\n 646: pop\n 647: aconst_null\n 648: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 651: aload_1\n 652: aload 17\n 654: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 659: checkcast #123 // class Day10$Node\n 662: dup\n 663: ifnull 672\n 666: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 669: goto 674\n 672: pop\n 673: aconst_null\n 674: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 677: invokevirtual #554 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 680: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 685: ifeq 567\n 688: aload 10\n 690: aload 13\n 692: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 697: pop\n 698: goto 567\n 701: aload 10\n 703: checkcast #119 // class java/util/List\n 706: nop\n 707: astore 6\n 709: aload 6\n 711: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 716: aload 4\n 718: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 723: iadd\n 724: iconst_2\n 725: irem\n 726: iconst_1\n 727: if_icmpne 734\n 730: iconst_1\n 731: goto 735\n 734: iconst_0\n 735: ireturn\n\n public final boolean isInPolygonBelow(java.util.Map<Day10$Coordinate, Day10$Node>, Day10$Coordinate);\n Code:\n 0: aload_1\n 1: ldc_w #527 // String graph\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc_w #528 // String coordinate\n 11: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_1\n 15: invokeinterface #531, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 20: checkcast #83 // class java/lang/Iterable\n 23: astore 4\n 25: iconst_0\n 26: istore 5\n 28: aload 4\n 30: astore 6\n 32: new #214 // class java/util/ArrayList\n 35: dup\n 36: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 39: checkcast #142 // class java/util/Collection\n 42: astore 7\n 44: iconst_0\n 45: istore 8\n 47: aload 6\n 49: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 54: astore 9\n 56: aload 9\n 58: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 63: ifeq 118\n 66: aload 9\n 68: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 73: astore 10\n 75: aload 10\n 77: checkcast #62 // class Day10$Coordinate\n 80: astore 11\n 82: iconst_0\n 83: istore 12\n 85: aload 11\n 87: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 90: aload_2\n 91: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 94: if_icmple 101\n 97: iconst_1\n 98: goto 102\n 101: iconst_0\n 102: ifeq 56\n 105: aload 7\n 107: aload 10\n 109: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 114: pop\n 115: goto 56\n 118: aload 7\n 120: checkcast #119 // class java/util/List\n 123: nop\n 124: checkcast #83 // class java/lang/Iterable\n 127: astore 4\n 129: nop\n 130: iconst_0\n 131: istore 5\n 133: aload 4\n 135: astore 6\n 137: new #214 // class java/util/ArrayList\n 140: dup\n 141: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 144: checkcast #142 // class java/util/Collection\n 147: astore 7\n 149: iconst_0\n 150: istore 8\n 152: aload 6\n 154: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 159: astore 9\n 161: aload 9\n 163: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 168: ifeq 223\n 171: aload 9\n 173: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 178: astore 10\n 180: aload 10\n 182: checkcast #62 // class Day10$Coordinate\n 185: astore 11\n 187: iconst_0\n 188: istore 12\n 190: aload 11\n 192: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 195: aload_2\n 196: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 199: if_icmpne 206\n 202: iconst_1\n 203: goto 207\n 206: iconst_0\n 207: ifeq 161\n 210: aload 7\n 212: aload 10\n 214: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 219: pop\n 220: goto 161\n 223: aload 7\n 225: checkcast #119 // class java/util/List\n 228: nop\n 229: checkcast #83 // class java/lang/Iterable\n 232: astore 4\n 234: nop\n 235: iconst_0\n 236: istore 5\n 238: aload 4\n 240: new #586 // class Day10$isInPolygonBelow$$inlined$sortedBy$1\n 243: dup\n 244: invokespecial #587 // Method Day10$isInPolygonBelow$$inlined$sortedBy$1.\"<init>\":()V\n 247: checkcast #571 // class java/util/Comparator\n 250: invokestatic #473 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 253: astore_3\n 254: aload_3\n 255: checkcast #83 // class java/lang/Iterable\n 258: astore 5\n 260: nop\n 261: iconst_0\n 262: istore 6\n 264: aload 5\n 266: astore 7\n 268: new #214 // class java/util/ArrayList\n 271: dup\n 272: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 275: checkcast #142 // class java/util/Collection\n 278: astore 8\n 280: iconst_0\n 281: istore 9\n 283: aload 7\n 285: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 290: astore 10\n 292: aload 10\n 294: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 299: ifeq 365\n 302: aload 10\n 304: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 309: astore 11\n 311: aload 11\n 313: checkcast #62 // class Day10$Coordinate\n 316: astore 12\n 318: iconst_0\n 319: istore 13\n 321: aload_1\n 322: aload 12\n 324: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 329: checkcast #123 // class Day10$Node\n 332: dup\n 333: ifnull 342\n 336: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 339: goto 344\n 342: pop\n 343: aconst_null\n 344: ldc #255 // String -\n 346: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 349: ifeq 292\n 352: aload 8\n 354: aload 11\n 356: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 361: pop\n 362: goto 292\n 365: aload 8\n 367: checkcast #119 // class java/util/List\n 370: nop\n 371: astore 4\n 373: iconst_2\n 374: anewarray #97 // class java/lang/String\n 377: astore 6\n 379: aload 6\n 381: iconst_0\n 382: ldc_w #533 // String FJ\n 385: aastore\n 386: aload 6\n 388: iconst_1\n 389: ldc_w #575 // String 7L\n 392: aastore\n 393: aload 6\n 395: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 398: astore 5\n 400: aload_3\n 401: checkcast #83 // class java/lang/Iterable\n 404: astore 7\n 406: nop\n 407: iconst_0\n 408: istore 8\n 410: aload 7\n 412: astore 9\n 414: new #214 // class java/util/ArrayList\n 417: dup\n 418: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 421: checkcast #142 // class java/util/Collection\n 424: astore 10\n 426: iconst_0\n 427: istore 11\n 429: aload 9\n 431: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 436: astore 12\n 438: aload 12\n 440: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 445: ifeq 519\n 448: aload 12\n 450: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 455: astore 13\n 457: aload 13\n 459: checkcast #62 // class Day10$Coordinate\n 462: astore 14\n 464: iconst_0\n 465: istore 15\n 467: aload_1\n 468: aload 14\n 470: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 475: checkcast #123 // class Day10$Node\n 478: dup\n 479: ifnull 488\n 482: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 485: goto 490\n 488: pop\n 489: aconst_null\n 490: ldc #239 // String |\n 492: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 495: ifne 502\n 498: iconst_1\n 499: goto 503\n 502: iconst_0\n 503: ifeq 438\n 506: aload 10\n 508: aload 13\n 510: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 515: pop\n 516: goto 438\n 519: aload 10\n 521: checkcast #119 // class java/util/List\n 524: nop\n 525: checkcast #83 // class java/lang/Iterable\n 528: invokestatic #538 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 531: checkcast #83 // class java/lang/Iterable\n 534: astore 7\n 536: iconst_0\n 537: istore 8\n 539: aload 7\n 541: astore 9\n 543: new #214 // class java/util/ArrayList\n 546: dup\n 547: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 550: checkcast #142 // class java/util/Collection\n 553: astore 10\n 555: iconst_0\n 556: istore 11\n 558: aload 9\n 560: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 565: astore 12\n 567: aload 12\n 569: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 574: ifeq 701\n 577: aload 12\n 579: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 584: astore 13\n 586: aload 13\n 588: checkcast #437 // class kotlin/Pair\n 591: astore 14\n 593: iconst_0\n 594: istore 15\n 596: aload 14\n 598: invokevirtual #541 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 601: checkcast #62 // class Day10$Coordinate\n 604: astore 16\n 606: aload 14\n 608: invokevirtual #544 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 611: checkcast #62 // class Day10$Coordinate\n 614: astore 17\n 616: aload 5\n 618: new #546 // class java/lang/StringBuilder\n 621: dup\n 622: invokespecial #547 // Method java/lang/StringBuilder.\"<init>\":()V\n 625: aload_1\n 626: aload 16\n 628: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 633: checkcast #123 // class Day10$Node\n 636: dup\n 637: ifnull 646\n 640: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 643: goto 648\n 646: pop\n 647: aconst_null\n 648: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 651: aload_1\n 652: aload 17\n 654: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 659: checkcast #123 // class Day10$Node\n 662: dup\n 663: ifnull 672\n 666: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 669: goto 674\n 672: pop\n 673: aconst_null\n 674: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 677: invokevirtual #554 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 680: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 685: ifeq 567\n 688: aload 10\n 690: aload 13\n 692: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 697: pop\n 698: goto 567\n 701: aload 10\n 703: checkcast #119 // class java/util/List\n 706: nop\n 707: astore 6\n 709: aload 6\n 711: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 716: aload 4\n 718: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 723: iadd\n 724: iconst_2\n 725: irem\n 726: iconst_1\n 727: if_icmpne 734\n 730: iconst_1\n 731: goto 735\n 734: iconst_0\n 735: ireturn\n\n public final boolean isInPolygonAbove(java.util.Map<Day10$Coordinate, Day10$Node>, Day10$Coordinate);\n Code:\n 0: aload_1\n 1: ldc_w #527 // String graph\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc_w #528 // String coordinate\n 11: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_1\n 15: invokeinterface #531, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 20: checkcast #83 // class java/lang/Iterable\n 23: astore_3\n 24: iconst_0\n 25: istore 4\n 27: aload_3\n 28: astore 5\n 30: new #214 // class java/util/ArrayList\n 33: dup\n 34: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 37: checkcast #142 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 116\n 64: aload 8\n 66: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 9\n 75: checkcast #62 // class Day10$Coordinate\n 78: astore 10\n 80: iconst_0\n 81: istore 11\n 83: aload 10\n 85: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 88: aload_2\n 89: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 92: if_icmpge 99\n 95: iconst_1\n 96: goto 100\n 99: iconst_0\n 100: ifeq 54\n 103: aload 6\n 105: aload 9\n 107: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 112: pop\n 113: goto 54\n 116: aload 6\n 118: checkcast #119 // class java/util/List\n 121: nop\n 122: checkcast #83 // class java/lang/Iterable\n 125: astore_3\n 126: nop\n 127: iconst_0\n 128: istore 4\n 130: aload_3\n 131: astore 5\n 133: new #214 // class java/util/ArrayList\n 136: dup\n 137: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 140: checkcast #142 // class java/util/Collection\n 143: astore 6\n 145: iconst_0\n 146: istore 7\n 148: aload 5\n 150: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 155: astore 8\n 157: aload 8\n 159: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 164: ifeq 219\n 167: aload 8\n 169: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 174: astore 9\n 176: aload 9\n 178: checkcast #62 // class Day10$Coordinate\n 181: astore 10\n 183: iconst_0\n 184: istore 11\n 186: aload 10\n 188: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 191: aload_2\n 192: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 195: if_icmpge 202\n 198: iconst_1\n 199: goto 203\n 202: iconst_0\n 203: ifeq 157\n 206: aload 6\n 208: aload 9\n 210: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 215: pop\n 216: goto 157\n 219: aload 6\n 221: checkcast #119 // class java/util/List\n 224: nop\n 225: pop\n 226: aload_1\n 227: invokeinterface #531, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 232: checkcast #83 // class java/lang/Iterable\n 235: astore 4\n 237: iconst_0\n 238: istore 5\n 240: aload 4\n 242: astore 6\n 244: new #214 // class java/util/ArrayList\n 247: dup\n 248: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 251: checkcast #142 // class java/util/Collection\n 254: astore 7\n 256: iconst_0\n 257: istore 8\n 259: aload 6\n 261: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 266: astore 9\n 268: aload 9\n 270: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 275: ifeq 330\n 278: aload 9\n 280: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 285: astore 10\n 287: aload 10\n 289: checkcast #62 // class Day10$Coordinate\n 292: astore 11\n 294: iconst_0\n 295: istore 12\n 297: aload 11\n 299: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 302: aload_2\n 303: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 306: if_icmpge 313\n 309: iconst_1\n 310: goto 314\n 313: iconst_0\n 314: ifeq 268\n 317: aload 7\n 319: aload 10\n 321: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 326: pop\n 327: goto 268\n 330: aload 7\n 332: checkcast #119 // class java/util/List\n 335: nop\n 336: checkcast #83 // class java/lang/Iterable\n 339: astore 4\n 341: nop\n 342: iconst_0\n 343: istore 5\n 345: aload 4\n 347: astore 6\n 349: new #214 // class java/util/ArrayList\n 352: dup\n 353: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 356: checkcast #142 // class java/util/Collection\n 359: astore 7\n 361: iconst_0\n 362: istore 8\n 364: aload 6\n 366: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 371: astore 9\n 373: aload 9\n 375: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 380: ifeq 435\n 383: aload 9\n 385: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 390: astore 10\n 392: aload 10\n 394: checkcast #62 // class Day10$Coordinate\n 397: astore 11\n 399: iconst_0\n 400: istore 12\n 402: aload 11\n 404: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 407: aload_2\n 408: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 411: if_icmpne 418\n 414: iconst_1\n 415: goto 419\n 418: iconst_0\n 419: ifeq 373\n 422: aload 7\n 424: aload 10\n 426: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 431: pop\n 432: goto 373\n 435: aload 7\n 437: checkcast #119 // class java/util/List\n 440: nop\n 441: checkcast #83 // class java/lang/Iterable\n 444: astore 4\n 446: nop\n 447: iconst_0\n 448: istore 5\n 450: aload 4\n 452: new #598 // class Day10$isInPolygonAbove$$inlined$sortedByDescending$1\n 455: dup\n 456: invokespecial #599 // Method Day10$isInPolygonAbove$$inlined$sortedByDescending$1.\"<init>\":()V\n 459: checkcast #571 // class java/util/Comparator\n 462: invokestatic #473 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 465: astore_3\n 466: aload_3\n 467: checkcast #83 // class java/lang/Iterable\n 470: astore 5\n 472: nop\n 473: iconst_0\n 474: istore 6\n 476: aload 5\n 478: astore 7\n 480: new #214 // class java/util/ArrayList\n 483: dup\n 484: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 487: checkcast #142 // class java/util/Collection\n 490: astore 8\n 492: iconst_0\n 493: istore 9\n 495: aload 7\n 497: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 502: astore 10\n 504: aload 10\n 506: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 511: ifeq 577\n 514: aload 10\n 516: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 521: astore 11\n 523: aload 11\n 525: checkcast #62 // class Day10$Coordinate\n 528: astore 12\n 530: iconst_0\n 531: istore 13\n 533: aload_1\n 534: aload 12\n 536: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 541: checkcast #123 // class Day10$Node\n 544: dup\n 545: ifnull 554\n 548: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 551: goto 556\n 554: pop\n 555: aconst_null\n 556: ldc #255 // String -\n 558: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 561: ifeq 504\n 564: aload 8\n 566: aload 11\n 568: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 573: pop\n 574: goto 504\n 577: aload 8\n 579: checkcast #119 // class java/util/List\n 582: nop\n 583: astore 4\n 585: iconst_2\n 586: anewarray #97 // class java/lang/String\n 589: astore 6\n 591: aload 6\n 593: iconst_0\n 594: ldc_w #573 // String JF\n 597: aastore\n 598: aload 6\n 600: iconst_1\n 601: ldc_w #535 // String L7\n 604: aastore\n 605: aload 6\n 607: invokestatic #249 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 610: astore 5\n 612: aload_3\n 613: checkcast #83 // class java/lang/Iterable\n 616: astore 7\n 618: nop\n 619: iconst_0\n 620: istore 8\n 622: aload 7\n 624: astore 9\n 626: new #214 // class java/util/ArrayList\n 629: dup\n 630: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 633: checkcast #142 // class java/util/Collection\n 636: astore 10\n 638: iconst_0\n 639: istore 11\n 641: aload 9\n 643: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 648: astore 12\n 650: aload 12\n 652: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 657: ifeq 731\n 660: aload 12\n 662: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 667: astore 13\n 669: aload 13\n 671: checkcast #62 // class Day10$Coordinate\n 674: astore 14\n 676: iconst_0\n 677: istore 15\n 679: aload_1\n 680: aload 14\n 682: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 687: checkcast #123 // class Day10$Node\n 690: dup\n 691: ifnull 700\n 694: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 697: goto 702\n 700: pop\n 701: aconst_null\n 702: ldc #239 // String |\n 704: invokestatic #133 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 707: ifne 714\n 710: iconst_1\n 711: goto 715\n 714: iconst_0\n 715: ifeq 650\n 718: aload 10\n 720: aload 13\n 722: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 727: pop\n 728: goto 650\n 731: aload 10\n 733: checkcast #119 // class java/util/List\n 736: nop\n 737: checkcast #83 // class java/lang/Iterable\n 740: invokestatic #538 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 743: checkcast #83 // class java/lang/Iterable\n 746: astore 7\n 748: iconst_0\n 749: istore 8\n 751: aload 7\n 753: astore 9\n 755: new #214 // class java/util/ArrayList\n 758: dup\n 759: invokespecial #232 // Method java/util/ArrayList.\"<init>\":()V\n 762: checkcast #142 // class java/util/Collection\n 765: astore 10\n 767: iconst_0\n 768: istore 11\n 770: aload 9\n 772: invokeinterface #121, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 777: astore 12\n 779: aload 12\n 781: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 786: ifeq 913\n 789: aload 12\n 791: invokeinterface #55, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 796: astore 13\n 798: aload 13\n 800: checkcast #437 // class kotlin/Pair\n 803: astore 14\n 805: iconst_0\n 806: istore 15\n 808: aload 14\n 810: invokevirtual #541 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 813: checkcast #62 // class Day10$Coordinate\n 816: astore 16\n 818: aload 14\n 820: invokevirtual #544 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 823: checkcast #62 // class Day10$Coordinate\n 826: astore 17\n 828: aload 5\n 830: new #546 // class java/lang/StringBuilder\n 833: dup\n 834: invokespecial #547 // Method java/lang/StringBuilder.\"<init>\":()V\n 837: aload_1\n 838: aload 16\n 840: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 845: checkcast #123 // class Day10$Node\n 848: dup\n 849: ifnull 858\n 852: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 855: goto 860\n 858: pop\n 859: aconst_null\n 860: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 863: aload_1\n 864: aload 17\n 866: invokeinterface #166, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 871: checkcast #123 // class Day10$Node\n 874: dup\n 875: ifnull 884\n 878: invokevirtual #127 // Method Day10$Node.getPipe:()Ljava/lang/String;\n 881: goto 886\n 884: pop\n 885: aconst_null\n 886: invokevirtual #551 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 889: invokevirtual #554 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 892: invokeinterface #66, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 897: ifeq 779\n 900: aload 10\n 902: aload 13\n 904: invokeinterface #237, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 909: pop\n 910: goto 779\n 913: aload 10\n 915: checkcast #119 // class java/util/List\n 918: nop\n 919: astore 6\n 921: aload 6\n 923: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 928: aload 4\n 930: invokeinterface #555, 1 // InterfaceMethod java/util/List.size:()I\n 935: iadd\n 936: iconst_2\n 937: irem\n 938: iconst_1\n 939: if_icmpne 946\n 942: iconst_1\n 943: goto 947\n 946: iconst_0\n 947: ireturn\n\n private static final java.lang.Comparable translate$lambda$32(Day10$Coordinate);\n Code:\n 0: aload_0\n 1: ldc_w #609 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #480 // Method Day10$Coordinate.getX:()I\n 11: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #170 // class java/lang/Comparable\n 17: areturn\n\n private static final java.lang.Comparable translate$lambda$33(Day10$Coordinate);\n Code:\n 0: aload_0\n 1: ldc_w #609 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #486 // Method Day10$Coordinate.getY:()I\n 11: invokestatic #155 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #170 // class java/lang/Comparable\n 17: areturn\n\n static {};\n Code:\n 0: new #2 // class Day10\n 3: dup\n 4: invokespecial #611 // Method \"<init>\":()V\n 7: putstatic #392 // Field INSTANCE:LDay10;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day10$isInPolygonLeft$$inlined$sortedByDescending$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day10$isInPolygonLeft$$inlined$sortedByDescending$1<T> implements java.util.Comparator {\n public Day10$isInPolygonLeft$$inlined$sortedByDescending$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_2\n 1: checkcast #23 // class Day10$Coordinate\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method Day10$Coordinate.getX:()I\n 12: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 15: checkcast #35 // class java/lang/Comparable\n 18: aload_1\n 19: checkcast #23 // class Day10$Coordinate\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method Day10$Coordinate.getX:()I\n 32: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 35: aload 5\n 37: swap\n 38: checkcast #35 // class java/lang/Comparable\n 41: invokestatic #41 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day10$Coordinate.class", "javap": "Compiled from \"Day10.kt\"\npublic final class Day10$Coordinate {\n private final int x;\n\n private final int y;\n\n public Day10$Coordinate(int, int);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: iload_1\n 6: putfield #13 // Field x:I\n 9: aload_0\n 10: iload_2\n 11: putfield #16 // Field y:I\n 14: return\n\n public final int getX();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: ireturn\n\n public final int getY();\n Code:\n 0: aload_0\n 1: getfield #16 // Field y:I\n 4: ireturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: ireturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field y:I\n 4: ireturn\n\n public final Day10$Coordinate copy(int, int);\n Code:\n 0: new #2 // class Day10$Coordinate\n 3: dup\n 4: iload_1\n 5: iload_2\n 6: invokespecial #28 // Method \"<init>\":(II)V\n 9: areturn\n\n public static Day10$Coordinate copy$default(Day10$Coordinate, int, int, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #13 // Field x:I\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #16 // Field y:I\n 21: istore_2\n 22: aload_0\n 23: iload_1\n 24: iload_2\n 25: invokevirtual #32 // Method copy:(II)LDay10$Coordinate;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #37 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #39 // String Coordinate(x=\n 9: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field x:I\n 16: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #48 // String , y=\n 21: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field y:I\n 28: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #51 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: invokestatic #59 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field y:I\n 16: invokestatic #59 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day10$Coordinate\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day10$Coordinate\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field x:I\n 25: aload_2\n 26: getfield #13 // Field x:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #16 // Field y:I\n 38: aload_2\n 39: getfield #16 // Field y:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: iconst_1\n 48: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day10$isInPolygonAbove$$inlined$sortedByDescending$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day10$isInPolygonAbove$$inlined$sortedByDescending$1<T> implements java.util.Comparator {\n public Day10$isInPolygonAbove$$inlined$sortedByDescending$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_2\n 1: checkcast #23 // class Day10$Coordinate\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokevirtual #27 // Method Day10$Coordinate.getY:()I\n 12: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 15: checkcast #35 // class java/lang/Comparable\n 18: aload_1\n 19: checkcast #23 // class Day10$Coordinate\n 22: astore_3\n 23: astore 5\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokevirtual #27 // Method Day10$Coordinate.getY:()I\n 32: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 35: aload 5\n 37: swap\n 38: checkcast #35 // class java/lang/Comparable\n 41: invokestatic #41 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 44: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day17.kt
import java.util.* import kotlin.String import kotlin.collections.List import kotlin.math.min object Day17 { enum class Direction { UP, DOWN, LEFT, RIGHT } data class CurrentStepInformation( val currentCoordinate: Coordinate, val currentDirection: Direction, val consecutiveDirectionSteps: Int, val heatLoss: Int ) { } data class Coordinate(val x: Int, val y: Int) fun part1(input: List<String>): String { val endCoordinate = Coordinate(input[0].length - 1, input.size - 1) return minimumHeatLoss(input, endCoordinate, maxConsecutiveSteps = 3).toString() } private fun minimumHeatLoss( grid: List<String>, endCoordinate: Coordinate, maxConsecutiveSteps: Int, minConsecutiveSteps: Int = 0 ): Int { val heap = PriorityQueue<CurrentStepInformation> { o1, o2 -> o1.heatLoss.compareTo(o2.heatLoss) } heap.add( CurrentStepInformation( Coordinate(1, 0), Direction.RIGHT, 1, 0 ) ) heap.add( CurrentStepInformation( Coordinate(0, 1), Direction.DOWN, 1, 0 ) ) var minValue = Int.MAX_VALUE val memo = mutableMapOf<CurrentStepInformation, Int>() while (heap.isNotEmpty()) { val currentStepInformation = heap.poll() val currentCoordinate = currentStepInformation.currentCoordinate val heatLoss = grid[currentCoordinate.y][currentCoordinate.x].digitToInt() val memoKey = currentStepInformation.copy(heatLoss = 0) // If we have already been here with less heat loss, we can skip this // Especially if we have already been here with the same heat loss but less consecutive steps, because // if a path had more possibilites and a smaller heat loss it makes no sense to search the space val tooExpensive = (minConsecutiveSteps..memoKey.consecutiveDirectionSteps - 1).map { memoKey.copy( consecutiveDirectionSteps = it ) } .any { memo.containsKey(it) && memo[it]!! <= currentStepInformation.heatLoss + heatLoss } || (memo[memoKey] ?: Int.MAX_VALUE) <= currentStepInformation.heatLoss + heatLoss if (tooExpensive) { continue } memo.put(memoKey, currentStepInformation.heatLoss + heatLoss) if (currentCoordinate == endCoordinate) { if (currentStepInformation.consecutiveDirectionSteps < minConsecutiveSteps) { continue } minValue = min(minValue, currentStepInformation.heatLoss + heatLoss) continue } val nextCoordinates = listOf( currentCoordinate.copy(x = currentCoordinate.x + 1) to Direction.RIGHT, currentCoordinate.copy(y = currentCoordinate.y + 1) to Direction.DOWN, currentCoordinate.copy(x = currentCoordinate.x - 1) to Direction.LEFT, currentCoordinate.copy(y = currentCoordinate.y - 1) to Direction.UP ).filter { (_, direction) -> // We cannot reverse directions when (direction) { Direction.UP -> currentStepInformation.currentDirection != Direction.DOWN Direction.DOWN -> currentStepInformation.currentDirection != Direction.UP Direction.LEFT -> currentStepInformation.currentDirection != Direction.RIGHT Direction.RIGHT -> currentStepInformation.currentDirection != Direction.LEFT } }.map { (coordinate, direction) -> CurrentStepInformation( coordinate, direction, if (direction == currentStepInformation.currentDirection) currentStepInformation.consecutiveDirectionSteps + 1 else 1, currentStepInformation.heatLoss + heatLoss ) }.filter { // We must move a minimum number of steps in the same direction it.currentDirection == currentStepInformation.currentDirection || currentStepInformation.consecutiveDirectionSteps >= minConsecutiveSteps }.filter { // We cannot move in the same direction more than maxConsecutiveSteps it.consecutiveDirectionSteps <= maxConsecutiveSteps }.filter { // We cannot move out of bounds it.currentCoordinate.x >= 0 && it.currentCoordinate.y >= 0 && it.currentCoordinate.y < grid.size && it.currentCoordinate.x < grid[it.currentCoordinate.y].length } heap.addAll(nextCoordinates) } return minValue } fun part2(input: List<String>): String { val endCoordinate = Coordinate(input[0].length - 1, input.size - 1) return minimumHeatLoss( input, endCoordinate, maxConsecutiveSteps = 10, minConsecutiveSteps = 4 ).toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day17.class", "javap": "Compiled from \"Day17.kt\"\npublic final class Day17 {\n public static final Day17 INSTANCE;\n\n private Day17();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #24 // class Day17$Coordinate\n 9: dup\n 10: aload_1\n 11: iconst_0\n 12: invokeinterface #30, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 17: checkcast #32 // class java/lang/String\n 20: invokevirtual #36 // Method java/lang/String.length:()I\n 23: iconst_1\n 24: isub\n 25: aload_1\n 26: invokeinterface #39, 1 // InterfaceMethod java/util/List.size:()I\n 31: iconst_1\n 32: isub\n 33: invokespecial #42 // Method Day17$Coordinate.\"<init>\":(II)V\n 36: astore_2\n 37: aload_0\n 38: aload_1\n 39: aload_2\n 40: iconst_3\n 41: iconst_0\n 42: bipush 8\n 44: aconst_null\n 45: invokestatic #46 // Method minimumHeatLoss$default:(LDay17;Ljava/util/List;LDay17$Coordinate;IIILjava/lang/Object;)I\n 48: invokestatic #50 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 51: areturn\n\n private final int minimumHeatLoss(java.util.List<java.lang.String>, Day17$Coordinate, int, int);\n Code:\n 0: new #58 // class java/util/PriorityQueue\n 3: dup\n 4: invokedynamic #78, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;\n 9: invokedynamic #89, 0 // InvokeDynamic #1:compare:(Lkotlin/jvm/functions/Function2;)Ljava/util/Comparator;\n 14: invokespecial #92 // Method java/util/PriorityQueue.\"<init>\":(Ljava/util/Comparator;)V\n 17: astore 5\n 19: aload 5\n 21: new #94 // class Day17$CurrentStepInformation\n 24: dup\n 25: new #24 // class Day17$Coordinate\n 28: dup\n 29: iconst_1\n 30: iconst_0\n 31: invokespecial #42 // Method Day17$Coordinate.\"<init>\":(II)V\n 34: getstatic #100 // Field Day17$Direction.RIGHT:LDay17$Direction;\n 37: iconst_1\n 38: iconst_0\n 39: invokespecial #103 // Method Day17$CurrentStepInformation.\"<init>\":(LDay17$Coordinate;LDay17$Direction;II)V\n 42: invokevirtual #107 // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z\n 45: pop\n 46: aload 5\n 48: new #94 // class Day17$CurrentStepInformation\n 51: dup\n 52: new #24 // class Day17$Coordinate\n 55: dup\n 56: iconst_0\n 57: iconst_1\n 58: invokespecial #42 // Method Day17$Coordinate.\"<init>\":(II)V\n 61: getstatic #110 // Field Day17$Direction.DOWN:LDay17$Direction;\n 64: iconst_1\n 65: iconst_0\n 66: invokespecial #103 // Method Day17$CurrentStepInformation.\"<init>\":(LDay17$Coordinate;LDay17$Direction;II)V\n 69: invokevirtual #107 // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z\n 72: pop\n 73: ldc #111 // int 2147483647\n 75: istore 6\n 77: new #113 // class java/util/LinkedHashMap\n 80: dup\n 81: invokespecial #114 // Method java/util/LinkedHashMap.\"<init>\":()V\n 84: checkcast #116 // class java/util/Map\n 87: astore 7\n 89: aload 5\n 91: checkcast #118 // class java/util/Collection\n 94: invokeinterface #122, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 99: ifne 106\n 102: iconst_1\n 103: goto 107\n 106: iconst_0\n 107: ifeq 1420\n 110: aload 5\n 112: invokevirtual #126 // Method java/util/PriorityQueue.poll:()Ljava/lang/Object;\n 115: checkcast #94 // class Day17$CurrentStepInformation\n 118: astore 8\n 120: aload 8\n 122: invokevirtual #130 // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;\n 125: astore 9\n 127: aload_1\n 128: aload 9\n 130: invokevirtual #133 // Method Day17$Coordinate.getY:()I\n 133: invokeinterface #30, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 138: checkcast #32 // class java/lang/String\n 141: aload 9\n 143: invokevirtual #136 // Method Day17$Coordinate.getX:()I\n 146: invokevirtual #140 // Method java/lang/String.charAt:(I)C\n 149: invokestatic #146 // Method kotlin/text/CharsKt.digitToInt:(C)I\n 152: istore 10\n 154: aload 8\n 156: aconst_null\n 157: aconst_null\n 158: iconst_0\n 159: iconst_0\n 160: bipush 7\n 162: aconst_null\n 163: invokestatic #150 // Method Day17$CurrentStepInformation.copy$default:(LDay17$CurrentStepInformation;LDay17$Coordinate;LDay17$Direction;IIILjava/lang/Object;)LDay17$CurrentStepInformation;\n 166: astore 11\n 168: new #152 // class kotlin/ranges/IntRange\n 171: dup\n 172: iload 4\n 174: aload 11\n 176: invokevirtual #155 // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I\n 179: iconst_1\n 180: isub\n 181: invokespecial #156 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 184: checkcast #158 // class java/lang/Iterable\n 187: astore 13\n 189: iconst_0\n 190: istore 14\n 192: aload 13\n 194: astore 15\n 196: new #160 // class java/util/ArrayList\n 199: dup\n 200: aload 13\n 202: bipush 10\n 204: invokestatic #166 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 207: invokespecial #169 // Method java/util/ArrayList.\"<init>\":(I)V\n 210: checkcast #118 // class java/util/Collection\n 213: astore 16\n 215: iconst_0\n 216: istore 17\n 218: aload 15\n 220: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 225: astore 18\n 227: aload 18\n 229: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 234: ifeq 284\n 237: aload 18\n 239: checkcast #180 // class kotlin/collections/IntIterator\n 242: invokevirtual #183 // Method kotlin/collections/IntIterator.nextInt:()I\n 245: istore 19\n 247: aload 16\n 249: iload 19\n 251: istore 20\n 253: astore 25\n 255: iconst_0\n 256: istore 21\n 258: aload 11\n 260: aconst_null\n 261: aconst_null\n 262: iload 20\n 264: iconst_0\n 265: bipush 11\n 267: aconst_null\n 268: invokestatic #150 // Method Day17$CurrentStepInformation.copy$default:(LDay17$CurrentStepInformation;LDay17$Coordinate;LDay17$Direction;IIILjava/lang/Object;)LDay17$CurrentStepInformation;\n 271: nop\n 272: aload 25\n 274: swap\n 275: invokeinterface #184, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 280: pop\n 281: goto 227\n 284: aload 16\n 286: checkcast #26 // class java/util/List\n 289: nop\n 290: checkcast #158 // class java/lang/Iterable\n 293: astore 13\n 295: nop\n 296: iconst_0\n 297: istore 14\n 299: aload 13\n 301: instanceof #118 // class java/util/Collection\n 304: ifeq 324\n 307: aload 13\n 309: checkcast #118 // class java/util/Collection\n 312: invokeinterface #122, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 317: ifeq 324\n 320: iconst_0\n 321: goto 417\n 324: aload 13\n 326: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 331: astore 15\n 333: aload 15\n 335: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 340: ifeq 416\n 343: aload 15\n 345: invokeinterface #187, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 350: astore 16\n 352: aload 16\n 354: checkcast #94 // class Day17$CurrentStepInformation\n 357: astore 17\n 359: iconst_0\n 360: istore 18\n 362: aload 7\n 364: aload 17\n 366: invokeinterface #190, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 371: ifeq 408\n 374: aload 7\n 376: aload 17\n 378: invokeinterface #193, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 383: dup\n 384: invokestatic #197 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 387: checkcast #199 // class java/lang/Number\n 390: invokevirtual #202 // Method java/lang/Number.intValue:()I\n 393: aload 8\n 395: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 398: iload 10\n 400: iadd\n 401: if_icmpgt 408\n 404: iconst_1\n 405: goto 409\n 408: iconst_0\n 409: ifeq 333\n 412: iconst_1\n 413: goto 417\n 416: iconst_0\n 417: ifne 456\n 420: aload 7\n 422: aload 11\n 424: invokeinterface #193, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 429: checkcast #207 // class java/lang/Integer\n 432: dup\n 433: ifnull 442\n 436: invokevirtual #208 // Method java/lang/Integer.intValue:()I\n 439: goto 445\n 442: pop\n 443: ldc #111 // int 2147483647\n 445: aload 8\n 447: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 450: iload 10\n 452: iadd\n 453: if_icmpgt 460\n 456: iconst_1\n 457: goto 461\n 460: iconst_0\n 461: istore 12\n 463: iload 12\n 465: ifeq 471\n 468: goto 89\n 471: aload 7\n 473: aload 11\n 475: aload 8\n 477: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 480: iload 10\n 482: iadd\n 483: invokestatic #211 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 486: invokeinterface #214, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 491: pop\n 492: aload 9\n 494: aload_2\n 495: invokestatic #218 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 498: ifeq 532\n 501: aload 8\n 503: invokevirtual #155 // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I\n 506: iload 4\n 508: if_icmpge 514\n 511: goto 89\n 514: iload 6\n 516: aload 8\n 518: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 521: iload 10\n 523: iadd\n 524: invokestatic #224 // Method java/lang/Math.min:(II)I\n 527: istore 6\n 529: goto 89\n 532: iconst_4\n 533: anewarray #226 // class kotlin/Pair\n 536: astore 14\n 538: aload 14\n 540: iconst_0\n 541: aload 9\n 543: aload 9\n 545: invokevirtual #136 // Method Day17$Coordinate.getX:()I\n 548: iconst_1\n 549: iadd\n 550: iconst_0\n 551: iconst_2\n 552: aconst_null\n 553: invokestatic #229 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 556: getstatic #100 // Field Day17$Direction.RIGHT:LDay17$Direction;\n 559: invokestatic #235 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 562: aastore\n 563: aload 14\n 565: iconst_1\n 566: aload 9\n 568: iconst_0\n 569: aload 9\n 571: invokevirtual #133 // Method Day17$Coordinate.getY:()I\n 574: iconst_1\n 575: iadd\n 576: iconst_1\n 577: aconst_null\n 578: invokestatic #229 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 581: getstatic #110 // Field Day17$Direction.DOWN:LDay17$Direction;\n 584: invokestatic #235 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 587: aastore\n 588: aload 14\n 590: iconst_2\n 591: aload 9\n 593: aload 9\n 595: invokevirtual #136 // Method Day17$Coordinate.getX:()I\n 598: iconst_1\n 599: isub\n 600: iconst_0\n 601: iconst_2\n 602: aconst_null\n 603: invokestatic #229 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 606: getstatic #238 // Field Day17$Direction.LEFT:LDay17$Direction;\n 609: invokestatic #235 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 612: aastore\n 613: aload 14\n 615: iconst_3\n 616: aload 9\n 618: iconst_0\n 619: aload 9\n 621: invokevirtual #133 // Method Day17$Coordinate.getY:()I\n 624: iconst_1\n 625: isub\n 626: iconst_1\n 627: aconst_null\n 628: invokestatic #229 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 631: getstatic #241 // Field Day17$Direction.UP:LDay17$Direction;\n 634: invokestatic #235 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 637: aastore\n 638: aload 14\n 640: invokestatic #245 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 643: checkcast #158 // class java/lang/Iterable\n 646: astore 14\n 648: nop\n 649: iconst_0\n 650: istore 15\n 652: aload 14\n 654: astore 16\n 656: new #160 // class java/util/ArrayList\n 659: dup\n 660: invokespecial #246 // Method java/util/ArrayList.\"<init>\":()V\n 663: checkcast #118 // class java/util/Collection\n 666: astore 17\n 668: iconst_0\n 669: istore 18\n 671: aload 16\n 673: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 678: astore 19\n 680: aload 19\n 682: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 687: ifeq 861\n 690: aload 19\n 692: invokeinterface #187, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 697: astore 20\n 699: aload 20\n 701: checkcast #226 // class kotlin/Pair\n 704: astore 21\n 706: iconst_0\n 707: istore 22\n 709: aload 21\n 711: invokevirtual #249 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 714: checkcast #96 // class Day17$Direction\n 717: astore 23\n 719: aload 23\n 721: getstatic #255 // Field Day17$WhenMappings.$EnumSwitchMapping$0:[I\n 724: swap\n 725: invokevirtual #258 // Method Day17$Direction.ordinal:()I\n 728: iaload\n 729: tableswitch { // 1 to 4\n 1: 760\n 2: 779\n 3: 798\n 4: 817\n default: 836\n }\n 760: aload 8\n 762: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 765: getstatic #110 // Field Day17$Direction.DOWN:LDay17$Direction;\n 768: if_acmpeq 775\n 771: iconst_1\n 772: goto 844\n 775: iconst_0\n 776: goto 844\n 779: aload 8\n 781: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 784: getstatic #241 // Field Day17$Direction.UP:LDay17$Direction;\n 787: if_acmpeq 794\n 790: iconst_1\n 791: goto 844\n 794: iconst_0\n 795: goto 844\n 798: aload 8\n 800: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 803: getstatic #100 // Field Day17$Direction.RIGHT:LDay17$Direction;\n 806: if_acmpeq 813\n 809: iconst_1\n 810: goto 844\n 813: iconst_0\n 814: goto 844\n 817: aload 8\n 819: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 822: getstatic #238 // Field Day17$Direction.LEFT:LDay17$Direction;\n 825: if_acmpeq 832\n 828: iconst_1\n 829: goto 844\n 832: iconst_0\n 833: goto 844\n 836: new #264 // class kotlin/NoWhenBranchMatchedException\n 839: dup\n 840: invokespecial #265 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 843: athrow\n 844: nop\n 845: ifeq 680\n 848: aload 17\n 850: aload 20\n 852: invokeinterface #184, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 857: pop\n 858: goto 680\n 861: aload 17\n 863: checkcast #26 // class java/util/List\n 866: nop\n 867: checkcast #158 // class java/lang/Iterable\n 870: astore 14\n 872: nop\n 873: iconst_0\n 874: istore 15\n 876: aload 14\n 878: astore 16\n 880: new #160 // class java/util/ArrayList\n 883: dup\n 884: aload 14\n 886: bipush 10\n 888: invokestatic #166 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 891: invokespecial #169 // Method java/util/ArrayList.\"<init>\":(I)V\n 894: checkcast #118 // class java/util/Collection\n 897: astore 17\n 899: iconst_0\n 900: istore 18\n 902: aload 16\n 904: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 909: astore 19\n 911: aload 19\n 913: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 918: ifeq 1017\n 921: aload 19\n 923: invokeinterface #187, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 928: astore 20\n 930: aload 17\n 932: aload 20\n 934: checkcast #226 // class kotlin/Pair\n 937: astore 21\n 939: astore 25\n 941: iconst_0\n 942: istore 22\n 944: aload 21\n 946: invokevirtual #268 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 949: checkcast #24 // class Day17$Coordinate\n 952: astore 23\n 954: aload 21\n 956: invokevirtual #249 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 959: checkcast #96 // class Day17$Direction\n 962: astore 24\n 964: new #94 // class Day17$CurrentStepInformation\n 967: dup\n 968: aload 23\n 970: aload 24\n 972: aload 24\n 974: aload 8\n 976: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 979: if_acmpne 992\n 982: aload 8\n 984: invokevirtual #155 // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I\n 987: iconst_1\n 988: iadd\n 989: goto 993\n 992: iconst_1\n 993: aload 8\n 995: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 998: iload 10\n 1000: iadd\n 1001: invokespecial #103 // Method Day17$CurrentStepInformation.\"<init>\":(LDay17$Coordinate;LDay17$Direction;II)V\n 1004: nop\n 1005: aload 25\n 1007: swap\n 1008: invokeinterface #184, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1013: pop\n 1014: goto 911\n 1017: aload 17\n 1019: checkcast #26 // class java/util/List\n 1022: nop\n 1023: checkcast #158 // class java/lang/Iterable\n 1026: astore 14\n 1028: nop\n 1029: iconst_0\n 1030: istore 15\n 1032: aload 14\n 1034: astore 16\n 1036: new #160 // class java/util/ArrayList\n 1039: dup\n 1040: invokespecial #246 // Method java/util/ArrayList.\"<init>\":()V\n 1043: checkcast #118 // class java/util/Collection\n 1046: astore 17\n 1048: iconst_0\n 1049: istore 18\n 1051: aload 16\n 1053: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1058: astore 19\n 1060: aload 19\n 1062: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1067: ifeq 1133\n 1070: aload 19\n 1072: invokeinterface #187, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1077: astore 20\n 1079: aload 20\n 1081: checkcast #94 // class Day17$CurrentStepInformation\n 1084: astore 21\n 1086: iconst_0\n 1087: istore 22\n 1089: aload 21\n 1091: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 1094: aload 8\n 1096: invokevirtual #262 // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;\n 1099: if_acmpeq 1112\n 1102: aload 8\n 1104: invokevirtual #155 // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I\n 1107: iload 4\n 1109: if_icmplt 1116\n 1112: iconst_1\n 1113: goto 1117\n 1116: iconst_0\n 1117: ifeq 1060\n 1120: aload 17\n 1122: aload 20\n 1124: invokeinterface #184, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1129: pop\n 1130: goto 1060\n 1133: aload 17\n 1135: checkcast #26 // class java/util/List\n 1138: nop\n 1139: checkcast #158 // class java/lang/Iterable\n 1142: astore 14\n 1144: nop\n 1145: iconst_0\n 1146: istore 15\n 1148: aload 14\n 1150: astore 16\n 1152: new #160 // class java/util/ArrayList\n 1155: dup\n 1156: invokespecial #246 // Method java/util/ArrayList.\"<init>\":()V\n 1159: checkcast #118 // class java/util/Collection\n 1162: astore 17\n 1164: iconst_0\n 1165: istore 18\n 1167: aload 16\n 1169: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1174: astore 19\n 1176: aload 19\n 1178: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1183: ifeq 1235\n 1186: aload 19\n 1188: invokeinterface #187, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1193: astore 20\n 1195: aload 20\n 1197: checkcast #94 // class Day17$CurrentStepInformation\n 1200: astore 21\n 1202: iconst_0\n 1203: istore 22\n 1205: aload 21\n 1207: invokevirtual #155 // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I\n 1210: iload_3\n 1211: if_icmpgt 1218\n 1214: iconst_1\n 1215: goto 1219\n 1218: iconst_0\n 1219: ifeq 1176\n 1222: aload 17\n 1224: aload 20\n 1226: invokeinterface #184, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1231: pop\n 1232: goto 1176\n 1235: aload 17\n 1237: checkcast #26 // class java/util/List\n 1240: nop\n 1241: checkcast #158 // class java/lang/Iterable\n 1244: astore 14\n 1246: nop\n 1247: iconst_0\n 1248: istore 15\n 1250: aload 14\n 1252: astore 16\n 1254: new #160 // class java/util/ArrayList\n 1257: dup\n 1258: invokespecial #246 // Method java/util/ArrayList.\"<init>\":()V\n 1261: checkcast #118 // class java/util/Collection\n 1264: astore 17\n 1266: iconst_0\n 1267: istore 18\n 1269: aload 16\n 1271: invokeinterface #173, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1276: astore 19\n 1278: aload 19\n 1280: invokeinterface #178, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1285: ifeq 1398\n 1288: aload 19\n 1290: invokeinterface #187, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1295: astore 20\n 1297: aload 20\n 1299: checkcast #94 // class Day17$CurrentStepInformation\n 1302: astore 21\n 1304: iconst_0\n 1305: istore 22\n 1307: aload 21\n 1309: invokevirtual #130 // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;\n 1312: invokevirtual #136 // Method Day17$Coordinate.getX:()I\n 1315: iflt 1381\n 1318: aload 21\n 1320: invokevirtual #130 // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;\n 1323: invokevirtual #133 // Method Day17$Coordinate.getY:()I\n 1326: iflt 1381\n 1329: aload 21\n 1331: invokevirtual #130 // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;\n 1334: invokevirtual #133 // Method Day17$Coordinate.getY:()I\n 1337: aload_1\n 1338: invokeinterface #39, 1 // InterfaceMethod java/util/List.size:()I\n 1343: if_icmpge 1381\n 1346: aload 21\n 1348: invokevirtual #130 // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;\n 1351: invokevirtual #136 // Method Day17$Coordinate.getX:()I\n 1354: aload_1\n 1355: aload 21\n 1357: invokevirtual #130 // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;\n 1360: invokevirtual #133 // Method Day17$Coordinate.getY:()I\n 1363: invokeinterface #30, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 1368: checkcast #32 // class java/lang/String\n 1371: invokevirtual #36 // Method java/lang/String.length:()I\n 1374: if_icmpge 1381\n 1377: iconst_1\n 1378: goto 1382\n 1381: iconst_0\n 1382: ifeq 1278\n 1385: aload 17\n 1387: aload 20\n 1389: invokeinterface #184, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1394: pop\n 1395: goto 1278\n 1398: aload 17\n 1400: checkcast #26 // class java/util/List\n 1403: nop\n 1404: astore 13\n 1406: aload 5\n 1408: aload 13\n 1410: checkcast #118 // class java/util/Collection\n 1413: invokevirtual #272 // Method java/util/PriorityQueue.addAll:(Ljava/util/Collection;)Z\n 1416: pop\n 1417: goto 89\n 1420: iload 6\n 1422: ireturn\n\n static int minimumHeatLoss$default(Day17, java.util.List, Day17$Coordinate, int, int, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: bipush 8\n 4: iand\n 5: ifeq 11\n 8: iconst_0\n 9: istore 4\n 11: aload_0\n 12: aload_1\n 13: aload_2\n 14: iload_3\n 15: iload 4\n 17: invokespecial #318 // Method minimumHeatLoss:(Ljava/util/List;LDay17$Coordinate;II)I\n 20: ireturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #24 // class Day17$Coordinate\n 9: dup\n 10: aload_1\n 11: iconst_0\n 12: invokeinterface #30, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 17: checkcast #32 // class java/lang/String\n 20: invokevirtual #36 // Method java/lang/String.length:()I\n 23: iconst_1\n 24: isub\n 25: aload_1\n 26: invokeinterface #39, 1 // InterfaceMethod java/util/List.size:()I\n 31: iconst_1\n 32: isub\n 33: invokespecial #42 // Method Day17$Coordinate.\"<init>\":(II)V\n 36: astore_2\n 37: aload_0\n 38: aload_1\n 39: aload_2\n 40: bipush 10\n 42: iconst_4\n 43: invokespecial #318 // Method minimumHeatLoss:(Ljava/util/List;LDay17$Coordinate;II)I\n 46: invokestatic #50 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 49: areturn\n\n private static final int minimumHeatLoss$lambda$0(Day17$CurrentStepInformation, Day17$CurrentStepInformation);\n Code:\n 0: aload_0\n 1: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 4: aload_1\n 5: invokevirtual #205 // Method Day17$CurrentStepInformation.getHeatLoss:()I\n 8: invokestatic #321 // Method kotlin/jvm/internal/Intrinsics.compare:(II)I\n 11: ireturn\n\n private static final int minimumHeatLoss$lambda$1(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #327, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: checkcast #199 // class java/lang/Number\n 11: invokevirtual #202 // Method java/lang/Number.intValue:()I\n 14: ireturn\n\n static {};\n Code:\n 0: new #2 // class Day17\n 3: dup\n 4: invokespecial #333 // Method \"<init>\":()V\n 7: putstatic #336 // Field INSTANCE:LDay17;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day17$WhenMappings.class", "javap": "Compiled from \"Day17.kt\"\npublic final class Day17$WhenMappings {\n public static final int[] $EnumSwitchMapping$0;\n\n static {};\n Code:\n 0: invokestatic #14 // Method Day17$Direction.values:()[LDay17$Direction;\n 3: arraylength\n 4: newarray int\n 6: astore_0\n 7: nop\n 8: aload_0\n 9: getstatic #18 // Field Day17$Direction.UP:LDay17$Direction;\n 12: invokevirtual #22 // Method Day17$Direction.ordinal:()I\n 15: iconst_1\n 16: iastore\n 17: goto 21\n 20: astore_1\n 21: nop\n 22: aload_0\n 23: getstatic #25 // Field Day17$Direction.DOWN:LDay17$Direction;\n 26: invokevirtual #22 // Method Day17$Direction.ordinal:()I\n 29: iconst_2\n 30: iastore\n 31: goto 35\n 34: astore_1\n 35: nop\n 36: aload_0\n 37: getstatic #28 // Field Day17$Direction.LEFT:LDay17$Direction;\n 40: invokevirtual #22 // Method Day17$Direction.ordinal:()I\n 43: iconst_3\n 44: iastore\n 45: goto 49\n 48: astore_1\n 49: nop\n 50: aload_0\n 51: getstatic #31 // Field Day17$Direction.RIGHT:LDay17$Direction;\n 54: invokevirtual #22 // Method Day17$Direction.ordinal:()I\n 57: iconst_4\n 58: iastore\n 59: goto 63\n 62: astore_1\n 63: aload_0\n 64: putstatic #35 // Field $EnumSwitchMapping$0:[I\n 67: return\n Exception table:\n from to target type\n 7 17 20 Class java/lang/NoSuchFieldError\n 21 31 34 Class java/lang/NoSuchFieldError\n 35 45 48 Class java/lang/NoSuchFieldError\n 49 59 62 Class java/lang/NoSuchFieldError\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day17$Coordinate.class", "javap": "Compiled from \"Day17.kt\"\npublic final class Day17$Coordinate {\n private final int x;\n\n private final int y;\n\n public Day17$Coordinate(int, int);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: iload_1\n 6: putfield #13 // Field x:I\n 9: aload_0\n 10: iload_2\n 11: putfield #16 // Field y:I\n 14: return\n\n public final int getX();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: ireturn\n\n public final int getY();\n Code:\n 0: aload_0\n 1: getfield #16 // Field y:I\n 4: ireturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: ireturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field y:I\n 4: ireturn\n\n public final Day17$Coordinate copy(int, int);\n Code:\n 0: new #2 // class Day17$Coordinate\n 3: dup\n 4: iload_1\n 5: iload_2\n 6: invokespecial #28 // Method \"<init>\":(II)V\n 9: areturn\n\n public static Day17$Coordinate copy$default(Day17$Coordinate, int, int, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #13 // Field x:I\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #16 // Field y:I\n 21: istore_2\n 22: aload_0\n 23: iload_1\n 24: iload_2\n 25: invokevirtual #32 // Method copy:(II)LDay17$Coordinate;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #37 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #39 // String Coordinate(x=\n 9: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field x:I\n 16: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #48 // String , y=\n 21: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field y:I\n 28: invokevirtual #46 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #51 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field x:I\n 4: invokestatic #59 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field y:I\n 16: invokestatic #59 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day17$Coordinate\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day17$Coordinate\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field x:I\n 25: aload_2\n 26: getfield #13 // Field x:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #16 // Field y:I\n 38: aload_2\n 39: getfield #16 // Field y:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: iconst_1\n 48: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day17$Direction.class", "javap": "Compiled from \"Day17.kt\"\npublic final class Day17$Direction extends java.lang.Enum<Day17$Direction> {\n public static final Day17$Direction UP;\n\n public static final Day17$Direction DOWN;\n\n public static final Day17$Direction LEFT;\n\n public static final Day17$Direction RIGHT;\n\n private static final Day17$Direction[] $VALUES;\n\n private static final kotlin.enums.EnumEntries $ENTRIES;\n\n private Day17$Direction();\n Code:\n 0: aload_0\n 1: aload_1\n 2: iload_2\n 3: invokespecial #10 // Method java/lang/Enum.\"<init>\":(Ljava/lang/String;I)V\n 6: return\n\n public static Day17$Direction[] values();\n Code:\n 0: getstatic #22 // Field $VALUES:[LDay17$Direction;\n 3: invokevirtual #28 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 6: checkcast #29 // class \"[LDay17$Direction;\"\n 9: areturn\n\n public static Day17$Direction valueOf(java.lang.String);\n Code:\n 0: ldc #2 // class Day17$Direction\n 2: aload_0\n 3: invokestatic #34 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;\n 6: checkcast #2 // class Day17$Direction\n 9: areturn\n\n public static kotlin.enums.EnumEntries<Day17$Direction> getEntries();\n Code:\n 0: getstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 3: areturn\n\n private static final Day17$Direction[] $values();\n Code:\n 0: iconst_4\n 1: anewarray #2 // class Day17$Direction\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: getstatic #47 // Field UP:LDay17$Direction;\n 10: aastore\n 11: aload_0\n 12: iconst_1\n 13: getstatic #50 // Field DOWN:LDay17$Direction;\n 16: aastore\n 17: aload_0\n 18: iconst_2\n 19: getstatic #53 // Field LEFT:LDay17$Direction;\n 22: aastore\n 23: aload_0\n 24: iconst_3\n 25: getstatic #56 // Field RIGHT:LDay17$Direction;\n 28: aastore\n 29: aload_0\n 30: areturn\n\n static {};\n Code:\n 0: new #2 // class Day17$Direction\n 3: dup\n 4: ldc #58 // String UP\n 6: iconst_0\n 7: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 10: putstatic #47 // Field UP:LDay17$Direction;\n 13: new #2 // class Day17$Direction\n 16: dup\n 17: ldc #60 // String DOWN\n 19: iconst_1\n 20: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 23: putstatic #50 // Field DOWN:LDay17$Direction;\n 26: new #2 // class Day17$Direction\n 29: dup\n 30: ldc #61 // String LEFT\n 32: iconst_2\n 33: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 36: putstatic #53 // Field LEFT:LDay17$Direction;\n 39: new #2 // class Day17$Direction\n 42: dup\n 43: ldc #62 // String RIGHT\n 45: iconst_3\n 46: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 49: putstatic #56 // Field RIGHT:LDay17$Direction;\n 52: invokestatic #64 // Method $values:()[LDay17$Direction;\n 55: putstatic #22 // Field $VALUES:[LDay17$Direction;\n 58: getstatic #22 // Field $VALUES:[LDay17$Direction;\n 61: checkcast #66 // class \"[Ljava/lang/Enum;\"\n 64: invokestatic #72 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;\n 67: putstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 70: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day17$CurrentStepInformation.class", "javap": "Compiled from \"Day17.kt\"\npublic final class Day17$CurrentStepInformation {\n private final Day17$Coordinate currentCoordinate;\n\n private final Day17$Direction currentDirection;\n\n private final int consecutiveDirectionSteps;\n\n private final int heatLoss;\n\n public Day17$CurrentStepInformation(Day17$Coordinate, Day17$Direction, int, int);\n Code:\n 0: aload_1\n 1: ldc #9 // String currentCoordinate\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String currentDirection\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 21: aload_0\n 22: aload_2\n 23: putfield #26 // Field currentDirection:LDay17$Direction;\n 26: aload_0\n 27: iload_3\n 28: putfield #30 // Field consecutiveDirectionSteps:I\n 31: aload_0\n 32: iload 4\n 34: putfield #33 // Field heatLoss:I\n 37: return\n\n public final Day17$Coordinate getCurrentCoordinate();\n Code:\n 0: aload_0\n 1: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 4: areturn\n\n public final Day17$Direction getCurrentDirection();\n Code:\n 0: aload_0\n 1: getfield #26 // Field currentDirection:LDay17$Direction;\n 4: areturn\n\n public final int getConsecutiveDirectionSteps();\n Code:\n 0: aload_0\n 1: getfield #30 // Field consecutiveDirectionSteps:I\n 4: ireturn\n\n public final int getHeatLoss();\n Code:\n 0: aload_0\n 1: getfield #33 // Field heatLoss:I\n 4: ireturn\n\n public final Day17$Coordinate component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 4: areturn\n\n public final Day17$Direction component2();\n Code:\n 0: aload_0\n 1: getfield #26 // Field currentDirection:LDay17$Direction;\n 4: areturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #30 // Field consecutiveDirectionSteps:I\n 4: ireturn\n\n public final int component4();\n Code:\n 0: aload_0\n 1: getfield #33 // Field heatLoss:I\n 4: ireturn\n\n public final Day17$CurrentStepInformation copy(Day17$Coordinate, Day17$Direction, int, int);\n Code:\n 0: aload_1\n 1: ldc #9 // String currentCoordinate\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String currentDirection\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day17$CurrentStepInformation\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: iload_3\n 19: iload 4\n 21: invokespecial #50 // Method \"<init>\":(LDay17$Coordinate;LDay17$Direction;II)V\n 24: areturn\n\n public static Day17$CurrentStepInformation copy$default(Day17$CurrentStepInformation, Day17$Coordinate, Day17$Direction, int, int, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 11: astore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #26 // Field currentDirection:LDay17$Direction;\n 23: astore_2\n 24: iload 5\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #30 // Field consecutiveDirectionSteps:I\n 35: istore_3\n 36: iload 5\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #33 // Field heatLoss:I\n 48: istore 4\n 50: aload_0\n 51: aload_1\n 52: aload_2\n 53: iload_3\n 54: iload 4\n 56: invokevirtual #54 // Method copy:(LDay17$Coordinate;LDay17$Direction;II)LDay17$CurrentStepInformation;\n 59: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #58 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #59 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #61 // String CurrentStepInformation(currentCoordinate=\n 9: invokevirtual #65 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 16: invokevirtual #68 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #70 // String , currentDirection=\n 21: invokevirtual #65 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #26 // Field currentDirection:LDay17$Direction;\n 28: invokevirtual #68 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #72 // String , consecutiveDirectionSteps=\n 33: invokevirtual #65 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #30 // Field consecutiveDirectionSteps:I\n 40: invokevirtual #75 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: ldc #77 // String , heatLoss=\n 45: invokevirtual #65 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #33 // Field heatLoss:I\n 52: invokevirtual #75 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 55: bipush 41\n 57: invokevirtual #80 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 60: invokevirtual #82 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 63: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 4: invokevirtual #87 // Method Day17$Coordinate.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #26 // Field currentDirection:LDay17$Direction;\n 16: invokevirtual #90 // Method Day17$Direction.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #30 // Field consecutiveDirectionSteps:I\n 29: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #33 // Field heatLoss:I\n 42: invokestatic #95 // Method java/lang/Integer.hashCode:(I)I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day17$CurrentStepInformation\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day17$CurrentStepInformation\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 25: aload_2\n 26: getfield #23 // Field currentCoordinate:LDay17$Coordinate;\n 29: invokestatic #103 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #26 // Field currentDirection:LDay17$Direction;\n 41: aload_2\n 42: getfield #26 // Field currentDirection:LDay17$Direction;\n 45: if_acmpeq 50\n 48: iconst_0\n 49: ireturn\n 50: aload_0\n 51: getfield #30 // Field consecutiveDirectionSteps:I\n 54: aload_2\n 55: getfield #30 // Field consecutiveDirectionSteps:I\n 58: if_icmpeq 63\n 61: iconst_0\n 62: ireturn\n 63: aload_0\n 64: getfield #33 // Field heatLoss:I\n 67: aload_2\n 68: getfield #33 // Field heatLoss:I\n 71: if_icmpeq 76\n 74: iconst_0\n 75: ireturn\n 76: iconst_1\n 77: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day19.kt
import kotlin.String import kotlin.collections.List object Day19 { private const val MIN_STATES = 1L private const val MAX_STATES = 4000L private const val ACCEPTED_STATE = "A" private const val REJECTED_STATE = "R" private const val START_STATE = "in" data class Part(val ratings: Map<String, Int>) { companion object { fun parse(input: String): Part { val ratings = input.drop(1).dropLast(1).split(",").map { val (id, rating) = it.split("=") id to rating.toInt() }.toMap() return Part(ratings) } } fun score(): Int = ratings.values.sum() } data class Rule(val key: String, val op: String, val value: Int, val nextState: String) { fun inverse(): Rule { val inverseOp = when (op) { "<" -> ">=" ">" -> "<=" else -> throw IllegalArgumentException("Cannot inverse op $op") } return Rule(key, inverseOp, value, nextState) } } data class Condition(val key: String, val op: String, val value: Int) { fun toMinAndMax(): MinAndMax { return when (op) { "<" -> MinAndMax(MIN_STATES, value.toLong() - 1, key) "<=" -> MinAndMax(MIN_STATES, value.toLong(), key) ">" -> MinAndMax(value.toLong() + 1, MAX_STATES, key) ">=" -> MinAndMax(value.toLong(), MAX_STATES, key) else -> throw IllegalArgumentException("Cannot inverse op $op") } } } data class CompositeCondition(val conditions: List<Condition>, val nextState: String) data class PathFinder(val jobs: Map<String, Job>) { fun findPathsToRejectedState(): List<Path> { val startJob = jobs[START_STATE]!! val paths = mutableListOf<Path>() paths.addAll(startJob.conditionsLeadingToRejectedState().map { Path(listOf(it)) }) val nextStates = ArrayDeque( startJob.nonTerminalConditions() .map { it to Path(listOf(it)) }) while (nextStates.isNotEmpty()) { val (nextRule, runningPath) = nextStates.removeFirst() val nextJob = jobs[nextRule.nextState]!! val failureStates = nextJob.conditionsLeadingToRejectedState() val failedPaths = failureStates.map { runningPath.with(it) } paths.addAll(failedPaths) val nonTerminalStates = nextJob.nonTerminalConditions() nextStates.addAll(nonTerminalStates.map { it to runningPath.with(it) }) } return paths } } data class Path(val compositeConditions: List<CompositeCondition>) { fun with(compositeCondition: CompositeCondition): Path { return Path(compositeConditions + compositeCondition) } } data class Job( val id: String, val rules: List<Pair<(Part) -> Boolean, String>>, val endState: String, val rawRules: List<Rule> ) { fun evaluate(part: Part): String { return rules.find { (rule, _) -> rule(part) }?.second ?: endState } fun conditionsLeadingToRejectedState(): List<CompositeCondition> { val rejectedRules = mutableListOf<CompositeCondition>() if (endState == REJECTED_STATE) { val endStateCompositeCondition = CompositeCondition( rawRules.map { it.inverse() }.map { Condition(it.key, it.op, it.value) }, REJECTED_STATE ) rejectedRules.add(endStateCompositeCondition) } rejectedRules.addAll(rawRules.withIndex().filter { (_, rule) -> rule.nextState == REJECTED_STATE } .map { (idx, rule) -> val inversedPreceedingRules = rawRules.subList(0, idx).map { it.inverse() }.map { Condition(it.key, it.op, it.value) } val thisRule = listOf(Condition(rule.key, rule.op, rule.value)) CompositeCondition(inversedPreceedingRules + thisRule, rule.nextState) }) return rejectedRules } fun nonTerminalConditions(): List<CompositeCondition> { val nonAcceptedNorRejectedConditions = mutableListOf<CompositeCondition>() if (endState != ACCEPTED_STATE && endState != REJECTED_STATE) { val endStateCompositeCondition = CompositeCondition( rawRules.map { it.inverse() }.map { Condition(it.key, it.op, it.value) }, endState ) nonAcceptedNorRejectedConditions.add(endStateCompositeCondition) } nonAcceptedNorRejectedConditions.addAll( rawRules.withIndex() .filter { (_, rule) -> rule.nextState != REJECTED_STATE && rule.nextState != ACCEPTED_STATE } .map { (idx, rule) -> val inversedPreceedingRules = rawRules.subList(0, idx).map { it.inverse() }.map { Condition(it.key, it.op, it.value) } val thisRule = listOf(Condition(rule.key, rule.op, rule.value)) CompositeCondition(inversedPreceedingRules + thisRule, rule.nextState) }) return nonAcceptedNorRejectedConditions } companion object { fun parse(input: String): Job { val curlyIndex = input.indexOf("{") val id = input.substring(0, curlyIndex).trim() val rawRules = input.substring(curlyIndex).drop(1).dropLast(1) val lastComma = rawRules.lastIndexOf(",") val endState = rawRules.substring(lastComma + 1).trim() val ops = mapOf("<" to { part: Part, value: Int, key: String -> part.ratings[key]!! < value }, ">" to { part: Part, value: Int, key: String -> part.ratings[key]!! > value }) val rules = rawRules.substring(0, lastComma).split(",").map { val pattern = """(\w+)([<>])(\d+):(\w+)""".toRegex() val matchResult = pattern.matchEntire(it.trim())!! val (key, op, value, nextState) = matchResult.destructured Rule(key, op, value.toInt(), nextState) } val rulesAsFunctions = rules.map { { part: Part -> ops[it.op]!!(part, it.value, it.key) } to it.nextState } return Job(id, rulesAsFunctions, endState, rules) } } } data class Workflow(val jobs: Map<String, Job>) { fun isAccepted(part: Part): Boolean { val startJob = jobs[START_STATE]!! var state = startJob.evaluate(part) while (state != ACCEPTED_STATE && state != REJECTED_STATE) { val job = jobs[state]!! state = job.evaluate(part) } return state == ACCEPTED_STATE } } fun part1(input: List<String>): String { val partitionIndex = input.withIndex().find { it.value.isEmpty() }!!.index val jobs = input.subList(0, partitionIndex).map { Job.parse(it) } val parts = input.subList(partitionIndex + 1, input.size).map { Part.parse(it) } val workflow = Workflow(jobs.associateBy { it.id }) return parts.filter { workflow.isAccepted(it) }.sumOf { it.score() }.toString() } data class MinAndMax(val min: Long, val max: Long, val key: String) { fun coerce(other: MinAndMax): MinAndMax { return MinAndMax(min.coerceAtLeast(other.min), max.coerceAtMost(other.max), key) } fun length(): Long = max - min + 1 } fun part2(input: List<String>): String { val partitionIndex = input.withIndex().find { it.value.isEmpty() }!!.index val jobs = input.subList(0, partitionIndex).map { Job.parse(it) } val rejectedPaths = PathFinder(jobs.associateBy { it.id }).findPathsToRejectedState() val minAndMaxes: List<Map<String, MinAndMax>> = rejectedPaths .filter { it.compositeConditions.isNotEmpty() } .map { path -> path.compositeConditions.flatMap { it.conditions } .map { it.toMinAndMax() }.groupBy { it.key } .mapValues { (_, minAndMaxes) -> minAndMaxes.reduce { a, b -> a.coerce(b) } } } val possibleRejectedStates = minAndMaxes.map { minAndMax -> listOf("x", "m", "a", "s").map { minAndMax[it] ?: MinAndMax(1, 4000, it) } .map { it.length() } .reduce { acc, num -> acc * num } }.sum() val possibleStates = 4000L * 4000L * 4000L * 4000L val delta = possibleStates - possibleRejectedStates return delta.toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Workflow.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Workflow {\n private final java.util.Map<java.lang.String, Day19$Job> jobs;\n\n public Day19$Workflow(java.util.Map<java.lang.String, Day19$Job>);\n Code:\n 0: aload_1\n 1: ldc #10 // String jobs\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #22 // Field jobs:Ljava/util/Map;\n 15: return\n\n public final java.util.Map<java.lang.String, Day19$Job> getJobs();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: areturn\n\n public final boolean isAccepted(Day19$Part);\n Code:\n 0: aload_1\n 1: ldc #31 // String part\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #22 // Field jobs:Ljava/util/Map;\n 10: ldc #33 // String in\n 12: invokeinterface #39, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 17: dup\n 18: invokestatic #43 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 21: checkcast #45 // class Day19$Job\n 24: astore_2\n 25: aload_2\n 26: aload_1\n 27: invokevirtual #49 // Method Day19$Job.evaluate:(LDay19$Part;)Ljava/lang/String;\n 30: astore_3\n 31: aload_3\n 32: ldc #51 // String A\n 34: invokestatic #55 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 37: ifne 78\n 40: aload_3\n 41: ldc #57 // String R\n 43: invokestatic #55 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 46: ifne 78\n 49: aload_0\n 50: getfield #22 // Field jobs:Ljava/util/Map;\n 53: aload_3\n 54: invokeinterface #39, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 59: dup\n 60: invokestatic #43 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 63: checkcast #45 // class Day19$Job\n 66: astore 4\n 68: aload 4\n 70: aload_1\n 71: invokevirtual #49 // Method Day19$Job.evaluate:(LDay19$Part;)Ljava/lang/String;\n 74: astore_3\n 75: goto 31\n 78: aload_3\n 79: ldc #51 // String A\n 81: invokestatic #55 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 84: ireturn\n\n public final java.util.Map<java.lang.String, Day19$Job> component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: areturn\n\n public final Day19$Workflow copy(java.util.Map<java.lang.String, Day19$Job>);\n Code:\n 0: aload_1\n 1: ldc #10 // String jobs\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day19$Workflow\n 9: dup\n 10: aload_1\n 11: invokespecial #71 // Method \"<init>\":(Ljava/util/Map;)V\n 14: areturn\n\n public static Day19$Workflow copy$default(Day19$Workflow, java.util.Map, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field jobs:Ljava/util/Map;\n 10: astore_1\n 11: aload_0\n 12: aload_1\n 13: invokevirtual #75 // Method copy:(Ljava/util/Map;)LDay19$Workflow;\n 16: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #79 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #80 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #82 // String Workflow(jobs=\n 9: invokevirtual #86 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field jobs:Ljava/util/Map;\n 16: invokevirtual #89 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: bipush 41\n 21: invokevirtual #92 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 24: invokevirtual #94 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 27: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: invokevirtual #98 // Method java/lang/Object.hashCode:()I\n 7: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$Workflow\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$Workflow\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field jobs:Ljava/util/Map;\n 25: aload_2\n 26: getfield #22 // Field jobs:Ljava/util/Map;\n 29: invokestatic #55 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: iconst_1\n 38: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$MinAndMax.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$MinAndMax {\n private final long min;\n\n private final long max;\n\n private final java.lang.String key;\n\n public Day19$MinAndMax(long, long, java.lang.String);\n Code:\n 0: aload 5\n 2: ldc #9 // String key\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokespecial #18 // Method java/lang/Object.\"<init>\":()V\n 11: aload_0\n 12: lload_1\n 13: putfield #22 // Field min:J\n 16: aload_0\n 17: lload_3\n 18: putfield #25 // Field max:J\n 21: aload_0\n 22: aload 5\n 24: putfield #28 // Field key:Ljava/lang/String;\n 27: return\n\n public final long getMin();\n Code:\n 0: aload_0\n 1: getfield #22 // Field min:J\n 4: lreturn\n\n public final long getMax();\n Code:\n 0: aload_0\n 1: getfield #25 // Field max:J\n 4: lreturn\n\n public final java.lang.String getKey();\n Code:\n 0: aload_0\n 1: getfield #28 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final Day19$MinAndMax coerce(Day19$MinAndMax);\n Code:\n 0: aload_1\n 1: ldc #39 // String other\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day19$MinAndMax\n 9: dup\n 10: aload_0\n 11: getfield #22 // Field min:J\n 14: aload_1\n 15: getfield #22 // Field min:J\n 18: invokestatic #45 // Method kotlin/ranges/RangesKt.coerceAtLeast:(JJ)J\n 21: aload_0\n 22: getfield #25 // Field max:J\n 25: aload_1\n 26: getfield #25 // Field max:J\n 29: invokestatic #48 // Method kotlin/ranges/RangesKt.coerceAtMost:(JJ)J\n 32: aload_0\n 33: getfield #28 // Field key:Ljava/lang/String;\n 36: invokespecial #50 // Method \"<init>\":(JJLjava/lang/String;)V\n 39: areturn\n\n public final long length();\n Code:\n 0: aload_0\n 1: getfield #25 // Field max:J\n 4: aload_0\n 5: getfield #22 // Field min:J\n 8: lsub\n 9: lconst_1\n 10: ladd\n 11: lreturn\n\n public final long component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field min:J\n 4: lreturn\n\n public final long component2();\n Code:\n 0: aload_0\n 1: getfield #25 // Field max:J\n 4: lreturn\n\n public final java.lang.String component3();\n Code:\n 0: aload_0\n 1: getfield #28 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final Day19$MinAndMax copy(long, long, java.lang.String);\n Code:\n 0: aload 5\n 2: ldc #9 // String key\n 4: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: new #2 // class Day19$MinAndMax\n 10: dup\n 11: lload_1\n 12: lload_3\n 13: aload 5\n 15: invokespecial #50 // Method \"<init>\":(JJLjava/lang/String;)V\n 18: areturn\n\n public static Day19$MinAndMax copy$default(Day19$MinAndMax, long, long, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload 6\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #22 // Field min:J\n 11: lstore_1\n 12: iload 6\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #25 // Field max:J\n 23: lstore_3\n 24: iload 6\n 26: iconst_4\n 27: iand\n 28: ifeq 37\n 31: aload_0\n 32: getfield #28 // Field key:Ljava/lang/String;\n 35: astore 5\n 37: aload_0\n 38: lload_1\n 39: lload_3\n 40: aload 5\n 42: invokevirtual #60 // Method copy:(JJLjava/lang/String;)LDay19$MinAndMax;\n 45: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #63 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #64 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #66 // String MinAndMax(min=\n 9: invokevirtual #70 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field min:J\n 16: invokevirtual #73 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 19: ldc #75 // String , max=\n 21: invokevirtual #70 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #25 // Field max:J\n 28: invokevirtual #73 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 31: ldc #77 // String , key=\n 33: invokevirtual #70 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #28 // Field key:Ljava/lang/String;\n 40: invokevirtual #70 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #80 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #82 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field min:J\n 4: invokestatic #89 // Method java/lang/Long.hashCode:(J)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #25 // Field max:J\n 16: invokestatic #89 // Method java/lang/Long.hashCode:(J)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #28 // Field key:Ljava/lang/String;\n 29: invokevirtual #93 // Method java/lang/String.hashCode:()I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$MinAndMax\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$MinAndMax\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field min:J\n 25: aload_2\n 26: getfield #22 // Field min:J\n 29: lcmp\n 30: ifeq 35\n 33: iconst_0\n 34: ireturn\n 35: aload_0\n 36: getfield #25 // Field max:J\n 39: aload_2\n 40: getfield #25 // Field max:J\n 43: lcmp\n 44: ifeq 49\n 47: iconst_0\n 48: ireturn\n 49: aload_0\n 50: getfield #28 // Field key:Ljava/lang/String;\n 53: aload_2\n 54: getfield #28 // Field key:Ljava/lang/String;\n 57: invokestatic #102 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 60: ifne 65\n 63: iconst_0\n 64: ireturn\n 65: iconst_1\n 66: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Job$Companion.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Job$Companion {\n private Day19$Job$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day19$Job parse(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #23 // class java/lang/CharSequence\n 10: ldc #25 // String {\n 12: iconst_0\n 13: iconst_0\n 14: bipush 6\n 16: aconst_null\n 17: invokestatic #31 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 20: istore_2\n 21: nop\n 22: aload_1\n 23: iconst_0\n 24: iload_2\n 25: invokevirtual #37 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 28: dup\n 29: ldc #39 // String substring(...)\n 31: invokestatic #42 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 34: checkcast #23 // class java/lang/CharSequence\n 37: invokestatic #46 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 40: invokevirtual #50 // Method java/lang/Object.toString:()Ljava/lang/String;\n 43: astore_3\n 44: aload_1\n 45: iload_2\n 46: invokevirtual #53 // Method java/lang/String.substring:(I)Ljava/lang/String;\n 49: dup\n 50: ldc #39 // String substring(...)\n 52: invokestatic #42 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 55: iconst_1\n 56: invokestatic #57 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;\n 59: iconst_1\n 60: invokestatic #60 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;\n 63: astore 4\n 65: aload 4\n 67: checkcast #23 // class java/lang/CharSequence\n 70: ldc #62 // String ,\n 72: iconst_0\n 73: iconst_0\n 74: bipush 6\n 76: aconst_null\n 77: invokestatic #65 // Method kotlin/text/StringsKt.lastIndexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 80: istore 5\n 82: nop\n 83: aload 4\n 85: iload 5\n 87: iconst_1\n 88: iadd\n 89: invokevirtual #53 // Method java/lang/String.substring:(I)Ljava/lang/String;\n 92: dup\n 93: ldc #39 // String substring(...)\n 95: invokestatic #42 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 98: checkcast #23 // class java/lang/CharSequence\n 101: invokestatic #46 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 104: invokevirtual #50 // Method java/lang/Object.toString:()Ljava/lang/String;\n 107: astore 6\n 109: iconst_2\n 110: anewarray #67 // class kotlin/Pair\n 113: astore 8\n 115: aload 8\n 117: iconst_0\n 118: ldc #69 // String <\n 120: invokedynamic #89, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function3;\n 125: invokestatic #95 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 128: aastore\n 129: aload 8\n 131: iconst_1\n 132: ldc #97 // String >\n 134: invokedynamic #102, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function3;\n 139: invokestatic #95 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 142: aastore\n 143: aload 8\n 145: invokestatic #108 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 148: astore 7\n 150: aload 4\n 152: iconst_0\n 153: iload 5\n 155: invokevirtual #37 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 158: dup\n 159: ldc #39 // String substring(...)\n 161: invokestatic #42 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 164: checkcast #23 // class java/lang/CharSequence\n 167: iconst_1\n 168: anewarray #33 // class java/lang/String\n 171: astore 9\n 173: aload 9\n 175: iconst_0\n 176: ldc #62 // String ,\n 178: aastore\n 179: aload 9\n 181: iconst_0\n 182: iconst_0\n 183: bipush 6\n 185: aconst_null\n 186: invokestatic #112 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 189: checkcast #114 // class java/lang/Iterable\n 192: astore 9\n 194: iconst_0\n 195: istore 10\n 197: aload 9\n 199: astore 11\n 201: new #116 // class java/util/ArrayList\n 204: dup\n 205: aload 9\n 207: bipush 10\n 209: invokestatic #122 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 212: invokespecial #125 // Method java/util/ArrayList.\"<init>\":(I)V\n 215: checkcast #127 // class java/util/Collection\n 218: astore 12\n 220: iconst_0\n 221: istore 13\n 223: aload 11\n 225: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 230: astore 14\n 232: aload 14\n 234: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 239: ifeq 424\n 242: aload 14\n 244: invokeinterface #141, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 249: astore 15\n 251: aload 12\n 253: aload 15\n 255: checkcast #33 // class java/lang/String\n 258: astore 16\n 260: astore 25\n 262: iconst_0\n 263: istore 17\n 265: new #143 // class kotlin/text/Regex\n 268: dup\n 269: ldc #145 // String (\\\\w+)([<>])(\\\\d+):(\\\\w+)\n 271: invokespecial #148 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 274: astore 18\n 276: aload 18\n 278: aload 16\n 280: checkcast #23 // class java/lang/CharSequence\n 283: invokestatic #46 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 286: invokevirtual #50 // Method java/lang/Object.toString:()Ljava/lang/String;\n 289: checkcast #23 // class java/lang/CharSequence\n 292: invokevirtual #152 // Method kotlin/text/Regex.matchEntire:(Ljava/lang/CharSequence;)Lkotlin/text/MatchResult;\n 295: dup\n 296: invokestatic #156 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 299: astore 19\n 301: aload 19\n 303: invokeinterface #162, 1 // InterfaceMethod kotlin/text/MatchResult.getDestructured:()Lkotlin/text/MatchResult$Destructured;\n 308: astore 20\n 310: aload 20\n 312: invokevirtual #168 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 315: invokeinterface #172, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 320: iconst_1\n 321: invokeinterface #178, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 326: checkcast #33 // class java/lang/String\n 329: astore 21\n 331: aload 20\n 333: invokevirtual #168 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 336: invokeinterface #172, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 341: iconst_2\n 342: invokeinterface #178, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 347: checkcast #33 // class java/lang/String\n 350: astore 22\n 352: aload 20\n 354: invokevirtual #168 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 357: invokeinterface #172, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 362: iconst_3\n 363: invokeinterface #178, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 368: checkcast #33 // class java/lang/String\n 371: astore 23\n 373: aload 20\n 375: invokevirtual #168 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 378: invokeinterface #172, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 383: iconst_4\n 384: invokeinterface #178, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 389: checkcast #33 // class java/lang/String\n 392: astore 24\n 394: new #180 // class Day19$Rule\n 397: dup\n 398: aload 21\n 400: aload 22\n 402: aload 23\n 404: invokestatic #186 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 407: aload 24\n 409: invokespecial #189 // Method Day19$Rule.\"<init>\":(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V\n 412: aload 25\n 414: swap\n 415: invokeinterface #193, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 420: pop\n 421: goto 232\n 424: aload 12\n 426: checkcast #174 // class java/util/List\n 429: nop\n 430: astore 8\n 432: aload 8\n 434: checkcast #114 // class java/lang/Iterable\n 437: astore 10\n 439: iconst_0\n 440: istore 11\n 442: aload 10\n 444: astore 12\n 446: new #116 // class java/util/ArrayList\n 449: dup\n 450: aload 10\n 452: bipush 10\n 454: invokestatic #122 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 457: invokespecial #125 // Method java/util/ArrayList.\"<init>\":(I)V\n 460: checkcast #127 // class java/util/Collection\n 463: astore 13\n 465: iconst_0\n 466: istore 14\n 468: aload 12\n 470: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 475: astore 15\n 477: aload 15\n 479: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 484: ifeq 539\n 487: aload 15\n 489: invokeinterface #141, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 494: astore 16\n 496: aload 13\n 498: aload 16\n 500: checkcast #180 // class Day19$Rule\n 503: astore 17\n 505: astore 25\n 507: iconst_0\n 508: istore 18\n 510: aload 7\n 512: aload 17\n 514: invokedynamic #205, 0 // InvokeDynamic #2:invoke:(Ljava/util/Map;LDay19$Rule;)Lkotlin/jvm/functions/Function1;\n 519: aload 17\n 521: invokevirtual #208 // Method Day19$Rule.getNextState:()Ljava/lang/String;\n 524: invokestatic #95 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 527: aload 25\n 529: swap\n 530: invokeinterface #193, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 535: pop\n 536: goto 477\n 539: aload 13\n 541: checkcast #174 // class java/util/List\n 544: nop\n 545: astore 9\n 547: new #210 // class Day19$Job\n 550: dup\n 551: aload_3\n 552: aload 9\n 554: aload 6\n 556: aload 8\n 558: invokespecial #213 // Method Day19$Job.\"<init>\":(Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/util/List;)V\n 561: areturn\n\n private static final boolean parse$lambda$0(Day19$Part, int, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #252 // String part\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #253 // String key\n 9: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #259 // Method Day19$Part.getRatings:()Ljava/util/Map;\n 16: aload_2\n 17: invokeinterface #261, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 22: dup\n 23: invokestatic #156 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 26: checkcast #263 // class java/lang/Number\n 29: invokevirtual #267 // Method java/lang/Number.intValue:()I\n 32: iload_1\n 33: if_icmpge 40\n 36: iconst_1\n 37: goto 41\n 40: iconst_0\n 41: ireturn\n\n private static final boolean parse$lambda$1(Day19$Part, int, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #252 // String part\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #253 // String key\n 9: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #259 // Method Day19$Part.getRatings:()Ljava/util/Map;\n 16: aload_2\n 17: invokeinterface #261, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 22: dup\n 23: invokestatic #156 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 26: checkcast #263 // class java/lang/Number\n 29: invokevirtual #267 // Method java/lang/Number.intValue:()I\n 32: iload_1\n 33: if_icmple 40\n 36: iconst_1\n 37: goto 41\n 40: iconst_0\n 41: ireturn\n\n private static final boolean parse$lambda$4$lambda$3(java.util.Map, Day19$Rule, Day19$Part);\n Code:\n 0: aload_2\n 1: ldc #252 // String part\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokevirtual #271 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 11: invokeinterface #261, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 16: dup\n 17: invokestatic #156 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 20: checkcast #273 // class kotlin/jvm/functions/Function3\n 23: aload_2\n 24: aload_1\n 25: invokevirtual #276 // Method Day19$Rule.getValue:()I\n 28: invokestatic #280 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 31: aload_1\n 32: invokevirtual #283 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 35: invokeinterface #285, 4 // InterfaceMethod kotlin/jvm/functions/Function3.invoke:(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 40: checkcast #287 // class java/lang/Boolean\n 43: invokevirtual #290 // Method java/lang/Boolean.booleanValue:()Z\n 46: ireturn\n\n public Day19$Job$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #294 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Job.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Job {\n public static final Day19$Job$Companion Companion;\n\n private final java.lang.String id;\n\n private final java.util.List<kotlin.Pair<kotlin.jvm.functions.Function1<Day19$Part, java.lang.Boolean>, java.lang.String>> rules;\n\n private final java.lang.String endState;\n\n private final java.util.List<Day19$Rule> rawRules;\n\n public Day19$Job(java.lang.String, java.util.List<? extends kotlin.Pair<? extends kotlin.jvm.functions.Function1<? super Day19$Part, java.lang.Boolean>, java.lang.String>>, java.lang.String, java.util.List<Day19$Rule>);\n Code:\n 0: aload_1\n 1: ldc #10 // String id\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String rules\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_3\n 13: ldc #20 // String endState\n 15: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload 4\n 20: ldc #22 // String rawRules\n 22: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 25: aload_0\n 26: invokespecial #25 // Method java/lang/Object.\"<init>\":()V\n 29: aload_0\n 30: aload_1\n 31: putfield #28 // Field id:Ljava/lang/String;\n 34: aload_0\n 35: aload_2\n 36: putfield #31 // Field rules:Ljava/util/List;\n 39: aload_0\n 40: aload_3\n 41: putfield #33 // Field endState:Ljava/lang/String;\n 44: aload_0\n 45: aload 4\n 47: putfield #35 // Field rawRules:Ljava/util/List;\n 50: return\n\n public final java.lang.String getId();\n Code:\n 0: aload_0\n 1: getfield #28 // Field id:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<kotlin.Pair<kotlin.jvm.functions.Function1<Day19$Part, java.lang.Boolean>, java.lang.String>> getRules();\n Code:\n 0: aload_0\n 1: getfield #31 // Field rules:Ljava/util/List;\n 4: areturn\n\n public final java.lang.String getEndState();\n Code:\n 0: aload_0\n 1: getfield #33 // Field endState:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day19$Rule> getRawRules();\n Code:\n 0: aload_0\n 1: getfield #35 // Field rawRules:Ljava/util/List;\n 4: areturn\n\n public final java.lang.String evaluate(Day19$Part);\n Code:\n 0: aload_1\n 1: ldc #49 // String part\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #31 // Field rules:Ljava/util/List;\n 10: checkcast #51 // class java/lang/Iterable\n 13: astore_2\n 14: aload_2\n 15: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 20: astore_3\n 21: aload_3\n 22: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 27: ifeq 80\n 30: aload_3\n 31: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 36: astore 4\n 38: aload 4\n 40: checkcast #67 // class kotlin/Pair\n 43: astore 5\n 45: iconst_0\n 46: istore 6\n 48: aload 5\n 50: invokevirtual #70 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 53: checkcast #72 // class kotlin/jvm/functions/Function1\n 56: astore 7\n 58: aload 7\n 60: aload_1\n 61: invokeinterface #76, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 66: checkcast #78 // class java/lang/Boolean\n 69: invokevirtual #81 // Method java/lang/Boolean.booleanValue:()Z\n 72: ifeq 21\n 75: aload 4\n 77: goto 81\n 80: aconst_null\n 81: checkcast #67 // class kotlin/Pair\n 84: dup\n 85: ifnull 98\n 88: invokevirtual #84 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 91: checkcast #86 // class java/lang/String\n 94: dup\n 95: ifnonnull 103\n 98: pop\n 99: aload_0\n 100: getfield #33 // Field endState:Ljava/lang/String;\n 103: areturn\n\n public final java.util.List<Day19$CompositeCondition> conditionsLeadingToRejectedState();\n Code:\n 0: new #95 // class java/util/ArrayList\n 3: dup\n 4: invokespecial #96 // Method java/util/ArrayList.\"<init>\":()V\n 7: checkcast #98 // class java/util/List\n 10: astore_1\n 11: aload_0\n 12: getfield #33 // Field endState:Ljava/lang/String;\n 15: ldc #100 // String R\n 17: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 20: ifeq 263\n 23: aload_0\n 24: getfield #35 // Field rawRules:Ljava/util/List;\n 27: checkcast #51 // class java/lang/Iterable\n 30: astore_3\n 31: iconst_0\n 32: istore 4\n 34: aload_3\n 35: astore 5\n 37: new #95 // class java/util/ArrayList\n 40: dup\n 41: aload_3\n 42: bipush 10\n 44: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 47: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 50: checkcast #115 // class java/util/Collection\n 53: astore 6\n 55: iconst_0\n 56: istore 7\n 58: aload 5\n 60: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 65: astore 8\n 67: aload 8\n 69: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 74: ifeq 117\n 77: aload 8\n 79: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 9\n 86: aload 6\n 88: aload 9\n 90: checkcast #117 // class Day19$Rule\n 93: astore 10\n 95: astore 26\n 97: iconst_0\n 98: istore 11\n 100: aload 10\n 102: invokevirtual #121 // Method Day19$Rule.inverse:()LDay19$Rule;\n 105: aload 26\n 107: swap\n 108: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 113: pop\n 114: goto 67\n 117: aload 6\n 119: checkcast #98 // class java/util/List\n 122: nop\n 123: checkcast #51 // class java/lang/Iterable\n 126: astore_3\n 127: nop\n 128: iconst_0\n 129: istore 4\n 131: aload_3\n 132: astore 5\n 134: new #95 // class java/util/ArrayList\n 137: dup\n 138: aload_3\n 139: bipush 10\n 141: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 144: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 147: checkcast #115 // class java/util/Collection\n 150: astore 6\n 152: iconst_0\n 153: istore 7\n 155: aload 5\n 157: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 162: astore 8\n 164: aload 8\n 166: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 171: ifeq 231\n 174: aload 8\n 176: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 181: astore 9\n 183: aload 6\n 185: aload 9\n 187: checkcast #117 // class Day19$Rule\n 190: astore 10\n 192: astore 26\n 194: iconst_0\n 195: istore 11\n 197: new #127 // class Day19$Condition\n 200: dup\n 201: aload 10\n 203: invokevirtual #130 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 206: aload 10\n 208: invokevirtual #133 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 211: aload 10\n 213: invokevirtual #137 // Method Day19$Rule.getValue:()I\n 216: invokespecial #140 // Method Day19$Condition.\"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 219: aload 26\n 221: swap\n 222: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 227: pop\n 228: goto 164\n 231: aload 6\n 233: checkcast #98 // class java/util/List\n 236: nop\n 237: ldc #100 // String R\n 239: astore 27\n 241: astore 28\n 243: new #142 // class Day19$CompositeCondition\n 246: dup\n 247: aload 28\n 249: aload 27\n 251: invokespecial #145 // Method Day19$CompositeCondition.\"<init>\":(Ljava/util/List;Ljava/lang/String;)V\n 254: astore_2\n 255: aload_1\n 256: aload_2\n 257: invokeinterface #146, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 262: pop\n 263: aload_1\n 264: aload_0\n 265: getfield #35 // Field rawRules:Ljava/util/List;\n 268: checkcast #51 // class java/lang/Iterable\n 271: invokestatic #150 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 274: astore_2\n 275: astore 24\n 277: iconst_0\n 278: istore_3\n 279: aload_2\n 280: astore 4\n 282: new #95 // class java/util/ArrayList\n 285: dup\n 286: invokespecial #96 // Method java/util/ArrayList.\"<init>\":()V\n 289: checkcast #115 // class java/util/Collection\n 292: astore 5\n 294: iconst_0\n 295: istore 6\n 297: aload 4\n 299: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 304: astore 7\n 306: aload 7\n 308: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 313: ifeq 371\n 316: aload 7\n 318: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 323: astore 8\n 325: aload 8\n 327: checkcast #152 // class kotlin/collections/IndexedValue\n 330: astore 9\n 332: iconst_0\n 333: istore 10\n 335: aload 9\n 337: invokevirtual #155 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 340: checkcast #117 // class Day19$Rule\n 343: astore 11\n 345: aload 11\n 347: invokevirtual #158 // Method Day19$Rule.getNextState:()Ljava/lang/String;\n 350: ldc #100 // String R\n 352: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 355: ifeq 306\n 358: aload 5\n 360: aload 8\n 362: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 367: pop\n 368: goto 306\n 371: aload 5\n 373: checkcast #98 // class java/util/List\n 376: nop\n 377: aload 24\n 379: swap\n 380: checkcast #51 // class java/lang/Iterable\n 383: astore_2\n 384: astore 24\n 386: iconst_0\n 387: istore_3\n 388: aload_2\n 389: astore 4\n 391: new #95 // class java/util/ArrayList\n 394: dup\n 395: aload_2\n 396: bipush 10\n 398: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 401: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 404: checkcast #115 // class java/util/Collection\n 407: astore 5\n 409: iconst_0\n 410: istore 6\n 412: aload 4\n 414: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 419: astore 7\n 421: aload 7\n 423: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 428: ifeq 765\n 431: aload 7\n 433: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 438: astore 8\n 440: aload 5\n 442: aload 8\n 444: checkcast #152 // class kotlin/collections/IndexedValue\n 447: astore 9\n 449: astore 25\n 451: iconst_0\n 452: istore 10\n 454: aload 9\n 456: invokevirtual #160 // Method kotlin/collections/IndexedValue.component1:()I\n 459: istore 11\n 461: aload 9\n 463: invokevirtual #155 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 466: checkcast #117 // class Day19$Rule\n 469: astore 12\n 471: aload_0\n 472: getfield #35 // Field rawRules:Ljava/util/List;\n 475: iconst_0\n 476: iload 11\n 478: invokeinterface #164, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 483: checkcast #51 // class java/lang/Iterable\n 486: astore 13\n 488: iconst_0\n 489: istore 14\n 491: aload 13\n 493: astore 15\n 495: new #95 // class java/util/ArrayList\n 498: dup\n 499: aload 13\n 501: bipush 10\n 503: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 506: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 509: checkcast #115 // class java/util/Collection\n 512: astore 16\n 514: iconst_0\n 515: istore 17\n 517: aload 15\n 519: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 524: astore 18\n 526: aload 18\n 528: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 533: ifeq 576\n 536: aload 18\n 538: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 543: astore 19\n 545: aload 16\n 547: aload 19\n 549: checkcast #117 // class Day19$Rule\n 552: astore 20\n 554: astore 21\n 556: iconst_0\n 557: istore 22\n 559: aload 20\n 561: invokevirtual #121 // Method Day19$Rule.inverse:()LDay19$Rule;\n 564: aload 21\n 566: swap\n 567: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 572: pop\n 573: goto 526\n 576: aload 16\n 578: checkcast #98 // class java/util/List\n 581: nop\n 582: checkcast #51 // class java/lang/Iterable\n 585: astore 13\n 587: nop\n 588: iconst_0\n 589: istore 14\n 591: aload 13\n 593: astore 15\n 595: new #95 // class java/util/ArrayList\n 598: dup\n 599: aload 13\n 601: bipush 10\n 603: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 606: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 609: checkcast #115 // class java/util/Collection\n 612: astore 16\n 614: iconst_0\n 615: istore 17\n 617: aload 15\n 619: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 624: astore 18\n 626: aload 18\n 628: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 633: ifeq 693\n 636: aload 18\n 638: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 643: astore 19\n 645: aload 16\n 647: aload 19\n 649: checkcast #117 // class Day19$Rule\n 652: astore 20\n 654: astore 21\n 656: iconst_0\n 657: istore 22\n 659: new #127 // class Day19$Condition\n 662: dup\n 663: aload 20\n 665: invokevirtual #130 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 668: aload 20\n 670: invokevirtual #133 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 673: aload 20\n 675: invokevirtual #137 // Method Day19$Rule.getValue:()I\n 678: invokespecial #140 // Method Day19$Condition.\"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 681: aload 21\n 683: swap\n 684: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 689: pop\n 690: goto 626\n 693: aload 16\n 695: checkcast #98 // class java/util/List\n 698: nop\n 699: astore 23\n 701: new #127 // class Day19$Condition\n 704: dup\n 705: aload 12\n 707: invokevirtual #130 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 710: aload 12\n 712: invokevirtual #133 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 715: aload 12\n 717: invokevirtual #137 // Method Day19$Rule.getValue:()I\n 720: invokespecial #140 // Method Day19$Condition.\"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 723: invokestatic #168 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 726: astore 13\n 728: new #142 // class Day19$CompositeCondition\n 731: dup\n 732: aload 23\n 734: checkcast #115 // class java/util/Collection\n 737: aload 13\n 739: checkcast #51 // class java/lang/Iterable\n 742: invokestatic #172 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 745: aload 12\n 747: invokevirtual #158 // Method Day19$Rule.getNextState:()Ljava/lang/String;\n 750: invokespecial #145 // Method Day19$CompositeCondition.\"<init>\":(Ljava/util/List;Ljava/lang/String;)V\n 753: aload 25\n 755: swap\n 756: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 761: pop\n 762: goto 421\n 765: aload 5\n 767: checkcast #98 // class java/util/List\n 770: nop\n 771: aload 24\n 773: swap\n 774: checkcast #115 // class java/util/Collection\n 777: invokeinterface #176, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 782: pop\n 783: aload_1\n 784: areturn\n\n public final java.util.List<Day19$CompositeCondition> nonTerminalConditions();\n Code:\n 0: new #95 // class java/util/ArrayList\n 3: dup\n 4: invokespecial #96 // Method java/util/ArrayList.\"<init>\":()V\n 7: checkcast #98 // class java/util/List\n 10: astore_1\n 11: aload_0\n 12: getfield #33 // Field endState:Ljava/lang/String;\n 15: ldc #207 // String A\n 17: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 20: ifne 277\n 23: aload_0\n 24: getfield #33 // Field endState:Ljava/lang/String;\n 27: ldc #100 // String R\n 29: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 277\n 35: aload_0\n 36: getfield #35 // Field rawRules:Ljava/util/List;\n 39: checkcast #51 // class java/lang/Iterable\n 42: astore_3\n 43: iconst_0\n 44: istore 4\n 46: aload_3\n 47: astore 5\n 49: new #95 // class java/util/ArrayList\n 52: dup\n 53: aload_3\n 54: bipush 10\n 56: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 59: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 62: checkcast #115 // class java/util/Collection\n 65: astore 6\n 67: iconst_0\n 68: istore 7\n 70: aload 5\n 72: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 77: astore 8\n 79: aload 8\n 81: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 86: ifeq 129\n 89: aload 8\n 91: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 96: astore 9\n 98: aload 6\n 100: aload 9\n 102: checkcast #117 // class Day19$Rule\n 105: astore 10\n 107: astore 26\n 109: iconst_0\n 110: istore 11\n 112: aload 10\n 114: invokevirtual #121 // Method Day19$Rule.inverse:()LDay19$Rule;\n 117: aload 26\n 119: swap\n 120: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 125: pop\n 126: goto 79\n 129: aload 6\n 131: checkcast #98 // class java/util/List\n 134: nop\n 135: checkcast #51 // class java/lang/Iterable\n 138: astore_3\n 139: nop\n 140: iconst_0\n 141: istore 4\n 143: aload_3\n 144: astore 5\n 146: new #95 // class java/util/ArrayList\n 149: dup\n 150: aload_3\n 151: bipush 10\n 153: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 156: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 159: checkcast #115 // class java/util/Collection\n 162: astore 6\n 164: iconst_0\n 165: istore 7\n 167: aload 5\n 169: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 174: astore 8\n 176: aload 8\n 178: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 183: ifeq 243\n 186: aload 8\n 188: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 193: astore 9\n 195: aload 6\n 197: aload 9\n 199: checkcast #117 // class Day19$Rule\n 202: astore 10\n 204: astore 26\n 206: iconst_0\n 207: istore 11\n 209: new #127 // class Day19$Condition\n 212: dup\n 213: aload 10\n 215: invokevirtual #130 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 218: aload 10\n 220: invokevirtual #133 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 223: aload 10\n 225: invokevirtual #137 // Method Day19$Rule.getValue:()I\n 228: invokespecial #140 // Method Day19$Condition.\"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 231: aload 26\n 233: swap\n 234: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 239: pop\n 240: goto 176\n 243: aload 6\n 245: checkcast #98 // class java/util/List\n 248: nop\n 249: aload_0\n 250: getfield #33 // Field endState:Ljava/lang/String;\n 253: astore 27\n 255: astore 28\n 257: new #142 // class Day19$CompositeCondition\n 260: dup\n 261: aload 28\n 263: aload 27\n 265: invokespecial #145 // Method Day19$CompositeCondition.\"<init>\":(Ljava/util/List;Ljava/lang/String;)V\n 268: astore_2\n 269: aload_1\n 270: aload_2\n 271: invokeinterface #146, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 276: pop\n 277: aload_1\n 278: aload_0\n 279: getfield #35 // Field rawRules:Ljava/util/List;\n 282: checkcast #51 // class java/lang/Iterable\n 285: invokestatic #150 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 288: astore_2\n 289: astore 24\n 291: iconst_0\n 292: istore_3\n 293: aload_2\n 294: astore 4\n 296: new #95 // class java/util/ArrayList\n 299: dup\n 300: invokespecial #96 // Method java/util/ArrayList.\"<init>\":()V\n 303: checkcast #115 // class java/util/Collection\n 306: astore 5\n 308: iconst_0\n 309: istore 6\n 311: aload 4\n 313: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 318: astore 7\n 320: aload 7\n 322: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 327: ifeq 406\n 330: aload 7\n 332: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 337: astore 8\n 339: aload 8\n 341: checkcast #152 // class kotlin/collections/IndexedValue\n 344: astore 9\n 346: iconst_0\n 347: istore 10\n 349: aload 9\n 351: invokevirtual #155 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 354: checkcast #117 // class Day19$Rule\n 357: astore 11\n 359: aload 11\n 361: invokevirtual #158 // Method Day19$Rule.getNextState:()Ljava/lang/String;\n 364: ldc #100 // String R\n 366: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 369: ifne 389\n 372: aload 11\n 374: invokevirtual #158 // Method Day19$Rule.getNextState:()Ljava/lang/String;\n 377: ldc #207 // String A\n 379: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 382: ifne 389\n 385: iconst_1\n 386: goto 390\n 389: iconst_0\n 390: ifeq 320\n 393: aload 5\n 395: aload 8\n 397: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 402: pop\n 403: goto 320\n 406: aload 5\n 408: checkcast #98 // class java/util/List\n 411: nop\n 412: aload 24\n 414: swap\n 415: checkcast #51 // class java/lang/Iterable\n 418: astore_2\n 419: astore 24\n 421: iconst_0\n 422: istore_3\n 423: aload_2\n 424: astore 4\n 426: new #95 // class java/util/ArrayList\n 429: dup\n 430: aload_2\n 431: bipush 10\n 433: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 436: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 439: checkcast #115 // class java/util/Collection\n 442: astore 5\n 444: iconst_0\n 445: istore 6\n 447: aload 4\n 449: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 454: astore 7\n 456: aload 7\n 458: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 463: ifeq 800\n 466: aload 7\n 468: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 473: astore 8\n 475: aload 5\n 477: aload 8\n 479: checkcast #152 // class kotlin/collections/IndexedValue\n 482: astore 9\n 484: astore 25\n 486: iconst_0\n 487: istore 10\n 489: aload 9\n 491: invokevirtual #160 // Method kotlin/collections/IndexedValue.component1:()I\n 494: istore 11\n 496: aload 9\n 498: invokevirtual #155 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 501: checkcast #117 // class Day19$Rule\n 504: astore 12\n 506: aload_0\n 507: getfield #35 // Field rawRules:Ljava/util/List;\n 510: iconst_0\n 511: iload 11\n 513: invokeinterface #164, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 518: checkcast #51 // class java/lang/Iterable\n 521: astore 13\n 523: iconst_0\n 524: istore 14\n 526: aload 13\n 528: astore 15\n 530: new #95 // class java/util/ArrayList\n 533: dup\n 534: aload 13\n 536: bipush 10\n 538: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 541: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 544: checkcast #115 // class java/util/Collection\n 547: astore 16\n 549: iconst_0\n 550: istore 17\n 552: aload 15\n 554: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 559: astore 18\n 561: aload 18\n 563: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 568: ifeq 611\n 571: aload 18\n 573: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 578: astore 19\n 580: aload 16\n 582: aload 19\n 584: checkcast #117 // class Day19$Rule\n 587: astore 20\n 589: astore 21\n 591: iconst_0\n 592: istore 22\n 594: aload 20\n 596: invokevirtual #121 // Method Day19$Rule.inverse:()LDay19$Rule;\n 599: aload 21\n 601: swap\n 602: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 607: pop\n 608: goto 561\n 611: aload 16\n 613: checkcast #98 // class java/util/List\n 616: nop\n 617: checkcast #51 // class java/lang/Iterable\n 620: astore 13\n 622: nop\n 623: iconst_0\n 624: istore 14\n 626: aload 13\n 628: astore 15\n 630: new #95 // class java/util/ArrayList\n 633: dup\n 634: aload 13\n 636: bipush 10\n 638: invokestatic #110 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 641: invokespecial #113 // Method java/util/ArrayList.\"<init>\":(I)V\n 644: checkcast #115 // class java/util/Collection\n 647: astore 16\n 649: iconst_0\n 650: istore 17\n 652: aload 15\n 654: invokeinterface #55, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 659: astore 18\n 661: aload 18\n 663: invokeinterface #61, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 668: ifeq 728\n 671: aload 18\n 673: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 678: astore 19\n 680: aload 16\n 682: aload 19\n 684: checkcast #117 // class Day19$Rule\n 687: astore 20\n 689: astore 21\n 691: iconst_0\n 692: istore 22\n 694: new #127 // class Day19$Condition\n 697: dup\n 698: aload 20\n 700: invokevirtual #130 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 703: aload 20\n 705: invokevirtual #133 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 708: aload 20\n 710: invokevirtual #137 // Method Day19$Rule.getValue:()I\n 713: invokespecial #140 // Method Day19$Condition.\"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 716: aload 21\n 718: swap\n 719: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 724: pop\n 725: goto 661\n 728: aload 16\n 730: checkcast #98 // class java/util/List\n 733: nop\n 734: astore 23\n 736: new #127 // class Day19$Condition\n 739: dup\n 740: aload 12\n 742: invokevirtual #130 // Method Day19$Rule.getKey:()Ljava/lang/String;\n 745: aload 12\n 747: invokevirtual #133 // Method Day19$Rule.getOp:()Ljava/lang/String;\n 750: aload 12\n 752: invokevirtual #137 // Method Day19$Rule.getValue:()I\n 755: invokespecial #140 // Method Day19$Condition.\"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 758: invokestatic #168 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 761: astore 13\n 763: new #142 // class Day19$CompositeCondition\n 766: dup\n 767: aload 23\n 769: checkcast #115 // class java/util/Collection\n 772: aload 13\n 774: checkcast #51 // class java/lang/Iterable\n 777: invokestatic #172 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 780: aload 12\n 782: invokevirtual #158 // Method Day19$Rule.getNextState:()Ljava/lang/String;\n 785: invokespecial #145 // Method Day19$CompositeCondition.\"<init>\":(Ljava/util/List;Ljava/lang/String;)V\n 788: aload 25\n 790: swap\n 791: invokeinterface #125, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 796: pop\n 797: goto 456\n 800: aload 5\n 802: checkcast #98 // class java/util/List\n 805: nop\n 806: aload 24\n 808: swap\n 809: checkcast #115 // class java/util/Collection\n 812: invokeinterface #176, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 817: pop\n 818: aload_1\n 819: areturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #28 // Field id:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<kotlin.Pair<kotlin.jvm.functions.Function1<Day19$Part, java.lang.Boolean>, java.lang.String>> component2();\n Code:\n 0: aload_0\n 1: getfield #31 // Field rules:Ljava/util/List;\n 4: areturn\n\n public final java.lang.String component3();\n Code:\n 0: aload_0\n 1: getfield #33 // Field endState:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day19$Rule> component4();\n Code:\n 0: aload_0\n 1: getfield #35 // Field rawRules:Ljava/util/List;\n 4: areturn\n\n public final Day19$Job copy(java.lang.String, java.util.List<? extends kotlin.Pair<? extends kotlin.jvm.functions.Function1<? super Day19$Part, java.lang.Boolean>, java.lang.String>>, java.lang.String, java.util.List<Day19$Rule>);\n Code:\n 0: aload_1\n 1: ldc #10 // String id\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String rules\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_3\n 13: ldc #20 // String endState\n 15: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 18: aload 4\n 20: ldc #22 // String rawRules\n 22: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 25: new #2 // class Day19$Job\n 28: dup\n 29: aload_1\n 30: aload_2\n 31: aload_3\n 32: aload 4\n 34: invokespecial #221 // Method \"<init>\":(Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/util/List;)V\n 37: areturn\n\n public static Day19$Job copy$default(Day19$Job, java.lang.String, java.util.List, java.lang.String, java.util.List, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #28 // Field id:Ljava/lang/String;\n 11: astore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #31 // Field rules:Ljava/util/List;\n 23: astore_2\n 24: iload 5\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #33 // Field endState:Ljava/lang/String;\n 35: astore_3\n 36: iload 5\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #35 // Field rawRules:Ljava/util/List;\n 48: astore 4\n 50: aload_0\n 51: aload_1\n 52: aload_2\n 53: aload_3\n 54: aload 4\n 56: invokevirtual #225 // Method copy:(Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/util/List;)LDay19$Job;\n 59: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #228 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #229 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #231 // String Job(id=\n 9: invokevirtual #235 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #28 // Field id:Ljava/lang/String;\n 16: invokevirtual #235 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #237 // String , rules=\n 21: invokevirtual #235 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #31 // Field rules:Ljava/util/List;\n 28: invokevirtual #240 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #242 // String , endState=\n 33: invokevirtual #235 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #33 // Field endState:Ljava/lang/String;\n 40: invokevirtual #235 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 43: ldc #244 // String , rawRules=\n 45: invokevirtual #235 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #35 // Field rawRules:Ljava/util/List;\n 52: invokevirtual #240 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 55: bipush 41\n 57: invokevirtual #247 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 60: invokevirtual #249 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 63: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #28 // Field id:Ljava/lang/String;\n 4: invokevirtual #252 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #31 // Field rules:Ljava/util/List;\n 16: invokevirtual #253 // Method java/lang/Object.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #33 // Field endState:Ljava/lang/String;\n 29: invokevirtual #252 // Method java/lang/String.hashCode:()I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #35 // Field rawRules:Ljava/util/List;\n 42: invokevirtual #253 // Method java/lang/Object.hashCode:()I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$Job\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$Job\n 20: astore_2\n 21: aload_0\n 22: getfield #28 // Field id:Ljava/lang/String;\n 25: aload_2\n 26: getfield #28 // Field id:Ljava/lang/String;\n 29: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #31 // Field rules:Ljava/util/List;\n 41: aload_2\n 42: getfield #31 // Field rules:Ljava/util/List;\n 45: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #33 // Field endState:Ljava/lang/String;\n 57: aload_2\n 58: getfield #33 // Field endState:Ljava/lang/String;\n 61: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 64: ifne 69\n 67: iconst_0\n 68: ireturn\n 69: aload_0\n 70: getfield #35 // Field rawRules:Ljava/util/List;\n 73: aload_2\n 74: getfield #35 // Field rawRules:Ljava/util/List;\n 77: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 80: ifne 85\n 83: iconst_0\n 84: ireturn\n 85: iconst_1\n 86: ireturn\n\n static {};\n Code:\n 0: new #260 // class Day19$Job$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #263 // Method Day19$Job$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #267 // Field Companion:LDay19$Job$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Condition.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Condition {\n private final java.lang.String key;\n\n private final java.lang.String op;\n\n private final int value;\n\n public Day19$Condition(java.lang.String, java.lang.String, int);\n Code:\n 0: aload_1\n 1: ldc #9 // String key\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String op\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #23 // Field key:Ljava/lang/String;\n 21: aload_0\n 22: aload_2\n 23: putfield #25 // Field op:Ljava/lang/String;\n 26: aload_0\n 27: iload_3\n 28: putfield #29 // Field value:I\n 31: return\n\n public final java.lang.String getKey();\n Code:\n 0: aload_0\n 1: getfield #23 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String getOp();\n Code:\n 0: aload_0\n 1: getfield #25 // Field op:Ljava/lang/String;\n 4: areturn\n\n public final int getValue();\n Code:\n 0: aload_0\n 1: getfield #29 // Field value:I\n 4: ireturn\n\n public final Day19$MinAndMax toMinAndMax();\n Code:\n 0: aload_0\n 1: getfield #25 // Field op:Ljava/lang/String;\n 4: astore_1\n 5: aload_1\n 6: invokevirtual #43 // Method java/lang/String.hashCode:()I\n 9: lookupswitch { // 4\n 60: 64\n 62: 76\n 1921: 52\n 1983: 88\n default: 188\n }\n 52: aload_1\n 53: ldc #45 // String <=\n 55: invokevirtual #49 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 58: ifne 122\n 61: goto 188\n 64: aload_1\n 65: ldc #51 // String <\n 67: invokevirtual #49 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 70: ifne 100\n 73: goto 188\n 76: aload_1\n 77: ldc #53 // String >\n 79: invokevirtual #49 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 82: ifne 142\n 85: goto 188\n 88: aload_1\n 89: ldc #55 // String >=\n 91: invokevirtual #49 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 94: ifne 166\n 97: goto 188\n 100: new #57 // class Day19$MinAndMax\n 103: dup\n 104: lconst_1\n 105: aload_0\n 106: getfield #29 // Field value:I\n 109: i2l\n 110: lconst_1\n 111: lsub\n 112: aload_0\n 113: getfield #23 // Field key:Ljava/lang/String;\n 116: invokespecial #60 // Method Day19$MinAndMax.\"<init>\":(JJLjava/lang/String;)V\n 119: goto 218\n 122: new #57 // class Day19$MinAndMax\n 125: dup\n 126: lconst_1\n 127: aload_0\n 128: getfield #29 // Field value:I\n 131: i2l\n 132: aload_0\n 133: getfield #23 // Field key:Ljava/lang/String;\n 136: invokespecial #60 // Method Day19$MinAndMax.\"<init>\":(JJLjava/lang/String;)V\n 139: goto 218\n 142: new #57 // class Day19$MinAndMax\n 145: dup\n 146: aload_0\n 147: getfield #29 // Field value:I\n 150: i2l\n 151: lconst_1\n 152: ladd\n 153: ldc2_w #61 // long 4000l\n 156: aload_0\n 157: getfield #23 // Field key:Ljava/lang/String;\n 160: invokespecial #60 // Method Day19$MinAndMax.\"<init>\":(JJLjava/lang/String;)V\n 163: goto 218\n 166: new #57 // class Day19$MinAndMax\n 169: dup\n 170: aload_0\n 171: getfield #29 // Field value:I\n 174: i2l\n 175: ldc2_w #61 // long 4000l\n 178: aload_0\n 179: getfield #23 // Field key:Ljava/lang/String;\n 182: invokespecial #60 // Method Day19$MinAndMax.\"<init>\":(JJLjava/lang/String;)V\n 185: goto 218\n 188: new #64 // class java/lang/IllegalArgumentException\n 191: dup\n 192: new #66 // class java/lang/StringBuilder\n 195: dup\n 196: invokespecial #67 // Method java/lang/StringBuilder.\"<init>\":()V\n 199: ldc #69 // String Cannot inverse op\n 201: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 204: aload_0\n 205: getfield #25 // Field op:Ljava/lang/String;\n 208: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 211: invokevirtual #76 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 214: invokespecial #79 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 217: athrow\n 218: areturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #25 // Field op:Ljava/lang/String;\n 4: areturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #29 // Field value:I\n 4: ireturn\n\n public final Day19$Condition copy(java.lang.String, java.lang.String, int);\n Code:\n 0: aload_1\n 1: ldc #9 // String key\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String op\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day19$Condition\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: iload_3\n 19: invokespecial #86 // Method \"<init>\":(Ljava/lang/String;Ljava/lang/String;I)V\n 22: areturn\n\n public static Day19$Condition copy$default(Day19$Condition, java.lang.String, java.lang.String, int, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #23 // Field key:Ljava/lang/String;\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #25 // Field op:Ljava/lang/String;\n 23: astore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #29 // Field value:I\n 35: istore_3\n 36: aload_0\n 37: aload_1\n 38: aload_2\n 39: iload_3\n 40: invokevirtual #90 // Method copy:(Ljava/lang/String;Ljava/lang/String;I)LDay19$Condition;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #66 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #67 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #92 // String Condition(key=\n 9: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field key:Ljava/lang/String;\n 16: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #94 // String , op=\n 21: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #25 // Field op:Ljava/lang/String;\n 28: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: ldc #96 // String , value=\n 33: invokevirtual #73 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #29 // Field value:I\n 40: invokevirtual #99 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #102 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #76 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field key:Ljava/lang/String;\n 4: invokevirtual #43 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #25 // Field op:Ljava/lang/String;\n 16: invokevirtual #43 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #29 // Field value:I\n 29: invokestatic #107 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$Condition\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$Condition\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field key:Ljava/lang/String;\n 25: aload_2\n 26: getfield #23 // Field key:Ljava/lang/String;\n 29: invokestatic #113 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #25 // Field op:Ljava/lang/String;\n 41: aload_2\n 42: getfield #25 // Field op:Ljava/lang/String;\n 45: invokestatic #113 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #29 // Field value:I\n 57: aload_2\n 58: getfield #29 // Field value:I\n 61: if_icmpeq 66\n 64: iconst_0\n 65: ireturn\n 66: iconst_1\n 67: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$CompositeCondition.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$CompositeCondition {\n private final java.util.List<Day19$Condition> conditions;\n\n private final java.lang.String nextState;\n\n public Day19$CompositeCondition(java.util.List<Day19$Condition>, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #10 // String conditions\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String nextState\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #24 // Field conditions:Ljava/util/List;\n 21: aload_0\n 22: aload_2\n 23: putfield #27 // Field nextState:Ljava/lang/String;\n 26: return\n\n public final java.util.List<Day19$Condition> getConditions();\n Code:\n 0: aload_0\n 1: getfield #24 // Field conditions:Ljava/util/List;\n 4: areturn\n\n public final java.lang.String getNextState();\n Code:\n 0: aload_0\n 1: getfield #27 // Field nextState:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day19$Condition> component1();\n Code:\n 0: aload_0\n 1: getfield #24 // Field conditions:Ljava/util/List;\n 4: areturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field nextState:Ljava/lang/String;\n 4: areturn\n\n public final Day19$CompositeCondition copy(java.util.List<Day19$Condition>, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #10 // String conditions\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String nextState\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day19$CompositeCondition\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: invokespecial #41 // Method \"<init>\":(Ljava/util/List;Ljava/lang/String;)V\n 21: areturn\n\n public static Day19$CompositeCondition copy$default(Day19$CompositeCondition, java.util.List, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #24 // Field conditions:Ljava/util/List;\n 10: astore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #27 // Field nextState:Ljava/lang/String;\n 21: astore_2\n 22: aload_0\n 23: aload_1\n 24: aload_2\n 25: invokevirtual #45 // Method copy:(Ljava/util/List;Ljava/lang/String;)LDay19$CompositeCondition;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #48 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #49 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #51 // String CompositeCondition(conditions=\n 9: invokevirtual #55 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #24 // Field conditions:Ljava/util/List;\n 16: invokevirtual #58 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #60 // String , nextState=\n 21: invokevirtual #55 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field nextState:Ljava/lang/String;\n 28: invokevirtual #55 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #63 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #65 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #24 // Field conditions:Ljava/util/List;\n 4: invokevirtual #69 // Method java/lang/Object.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field nextState:Ljava/lang/String;\n 16: invokevirtual #72 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$CompositeCondition\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$CompositeCondition\n 20: astore_2\n 21: aload_0\n 22: getfield #24 // Field conditions:Ljava/util/List;\n 25: aload_2\n 26: getfield #24 // Field conditions:Ljava/util/List;\n 29: invokestatic #81 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field nextState:Ljava/lang/String;\n 41: aload_2\n 42: getfield #27 // Field nextState:Ljava/lang/String;\n 45: invokestatic #81 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: iconst_1\n 54: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Part.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Part {\n public static final Day19$Part$Companion Companion;\n\n private final java.util.Map<java.lang.String, java.lang.Integer> ratings;\n\n public Day19$Part(java.util.Map<java.lang.String, java.lang.Integer>);\n Code:\n 0: aload_1\n 1: ldc #10 // String ratings\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #22 // Field ratings:Ljava/util/Map;\n 15: return\n\n public final java.util.Map<java.lang.String, java.lang.Integer> getRatings();\n Code:\n 0: aload_0\n 1: getfield #22 // Field ratings:Ljava/util/Map;\n 4: areturn\n\n public final int score();\n Code:\n 0: aload_0\n 1: getfield #22 // Field ratings:Ljava/util/Map;\n 4: invokeinterface #35, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 9: checkcast #37 // class java/lang/Iterable\n 12: invokestatic #43 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 15: ireturn\n\n public final java.util.Map<java.lang.String, java.lang.Integer> component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field ratings:Ljava/util/Map;\n 4: areturn\n\n public final Day19$Part copy(java.util.Map<java.lang.String, java.lang.Integer>);\n Code:\n 0: aload_1\n 1: ldc #10 // String ratings\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day19$Part\n 9: dup\n 10: aload_1\n 11: invokespecial #49 // Method \"<init>\":(Ljava/util/Map;)V\n 14: areturn\n\n public static Day19$Part copy$default(Day19$Part, java.util.Map, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field ratings:Ljava/util/Map;\n 10: astore_1\n 11: aload_0\n 12: aload_1\n 13: invokevirtual #53 // Method copy:(Ljava/util/Map;)LDay19$Part;\n 16: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #57 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #58 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #60 // String Part(ratings=\n 9: invokevirtual #64 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field ratings:Ljava/util/Map;\n 16: invokevirtual #67 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: bipush 41\n 21: invokevirtual #70 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 24: invokevirtual #72 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 27: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field ratings:Ljava/util/Map;\n 4: invokevirtual #75 // Method java/lang/Object.hashCode:()I\n 7: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$Part\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$Part\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field ratings:Ljava/util/Map;\n 25: aload_2\n 26: getfield #22 // Field ratings:Ljava/util/Map;\n 29: invokestatic #82 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: iconst_1\n 38: ireturn\n\n static {};\n Code:\n 0: new #87 // class Day19$Part$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #90 // Method Day19$Part$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #94 // Field Companion:LDay19$Part$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Rule.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Rule {\n private final java.lang.String key;\n\n private final java.lang.String op;\n\n private final int value;\n\n private final java.lang.String nextState;\n\n public Day19$Rule(java.lang.String, java.lang.String, int, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #9 // String key\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String op\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload 4\n 14: ldc #19 // String nextState\n 16: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: invokespecial #22 // Method java/lang/Object.\"<init>\":()V\n 23: aload_0\n 24: aload_1\n 25: putfield #25 // Field key:Ljava/lang/String;\n 28: aload_0\n 29: aload_2\n 30: putfield #27 // Field op:Ljava/lang/String;\n 33: aload_0\n 34: iload_3\n 35: putfield #31 // Field value:I\n 38: aload_0\n 39: aload 4\n 41: putfield #33 // Field nextState:Ljava/lang/String;\n 44: return\n\n public final java.lang.String getKey();\n Code:\n 0: aload_0\n 1: getfield #25 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String getOp();\n Code:\n 0: aload_0\n 1: getfield #27 // Field op:Ljava/lang/String;\n 4: areturn\n\n public final int getValue();\n Code:\n 0: aload_0\n 1: getfield #31 // Field value:I\n 4: ireturn\n\n public final java.lang.String getNextState();\n Code:\n 0: aload_0\n 1: getfield #33 // Field nextState:Ljava/lang/String;\n 4: areturn\n\n public final Day19$Rule inverse();\n Code:\n 0: aload_0\n 1: getfield #27 // Field op:Ljava/lang/String;\n 4: astore_2\n 5: aload_2\n 6: ldc #45 // String <\n 8: invokestatic #49 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 11: ifeq 19\n 14: ldc #51 // String >=\n 16: goto 63\n 19: aload_2\n 20: ldc #53 // String >\n 22: invokestatic #49 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 25: ifeq 33\n 28: ldc #55 // String <=\n 30: goto 63\n 33: new #57 // class java/lang/IllegalArgumentException\n 36: dup\n 37: new #59 // class java/lang/StringBuilder\n 40: dup\n 41: invokespecial #60 // Method java/lang/StringBuilder.\"<init>\":()V\n 44: ldc #62 // String Cannot inverse op\n 46: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 49: aload_0\n 50: getfield #27 // Field op:Ljava/lang/String;\n 53: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 56: invokevirtual #69 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 59: invokespecial #72 // Method java/lang/IllegalArgumentException.\"<init>\":(Ljava/lang/String;)V\n 62: athrow\n 63: astore_1\n 64: new #2 // class Day19$Rule\n 67: dup\n 68: aload_0\n 69: getfield #25 // Field key:Ljava/lang/String;\n 72: aload_1\n 73: aload_0\n 74: getfield #31 // Field value:I\n 77: aload_0\n 78: getfield #33 // Field nextState:Ljava/lang/String;\n 81: invokespecial #74 // Method \"<init>\":(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V\n 84: areturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #25 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final java.lang.String component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field op:Ljava/lang/String;\n 4: areturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #31 // Field value:I\n 4: ireturn\n\n public final java.lang.String component4();\n Code:\n 0: aload_0\n 1: getfield #33 // Field nextState:Ljava/lang/String;\n 4: areturn\n\n public final Day19$Rule copy(java.lang.String, java.lang.String, int, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #9 // String key\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String op\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload 4\n 14: ldc #19 // String nextState\n 16: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: new #2 // class Day19$Rule\n 22: dup\n 23: aload_1\n 24: aload_2\n 25: iload_3\n 26: aload 4\n 28: invokespecial #74 // Method \"<init>\":(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V\n 31: areturn\n\n public static Day19$Rule copy$default(Day19$Rule, java.lang.String, java.lang.String, int, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #25 // Field key:Ljava/lang/String;\n 11: astore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field op:Ljava/lang/String;\n 23: astore_2\n 24: iload 5\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #31 // Field value:I\n 35: istore_3\n 36: iload 5\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #33 // Field nextState:Ljava/lang/String;\n 48: astore 4\n 50: aload_0\n 51: aload_1\n 52: aload_2\n 53: iload_3\n 54: aload 4\n 56: invokevirtual #87 // Method copy:(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)LDay19$Rule;\n 59: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #59 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #60 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #89 // String Rule(key=\n 9: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #25 // Field key:Ljava/lang/String;\n 16: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #91 // String , op=\n 21: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field op:Ljava/lang/String;\n 28: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 31: ldc #93 // String , value=\n 33: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #31 // Field value:I\n 40: invokevirtual #96 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: ldc #98 // String , nextState=\n 45: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #33 // Field nextState:Ljava/lang/String;\n 52: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 55: bipush 41\n 57: invokevirtual #101 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 60: invokevirtual #69 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 63: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #25 // Field key:Ljava/lang/String;\n 4: invokevirtual #104 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field op:Ljava/lang/String;\n 16: invokevirtual #104 // Method java/lang/String.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #31 // Field value:I\n 29: invokestatic #109 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #33 // Field nextState:Ljava/lang/String;\n 42: invokevirtual #104 // Method java/lang/String.hashCode:()I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$Rule\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$Rule\n 20: astore_2\n 21: aload_0\n 22: getfield #25 // Field key:Ljava/lang/String;\n 25: aload_2\n 26: getfield #25 // Field key:Ljava/lang/String;\n 29: invokestatic #49 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field op:Ljava/lang/String;\n 41: aload_2\n 42: getfield #27 // Field op:Ljava/lang/String;\n 45: invokestatic #49 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #31 // Field value:I\n 57: aload_2\n 58: getfield #31 // Field value:I\n 61: if_icmpeq 66\n 64: iconst_0\n 65: ireturn\n 66: aload_0\n 67: getfield #33 // Field nextState:Ljava/lang/String;\n 70: aload_2\n 71: getfield #33 // Field nextState:Ljava/lang/String;\n 74: invokestatic #49 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 77: ifne 82\n 80: iconst_0\n 81: ireturn\n 82: iconst_1\n 83: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Path.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Path {\n private final java.util.List<Day19$CompositeCondition> compositeConditions;\n\n public Day19$Path(java.util.List<Day19$CompositeCondition>);\n Code:\n 0: aload_1\n 1: ldc #10 // String compositeConditions\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #22 // Field compositeConditions:Ljava/util/List;\n 15: return\n\n public final java.util.List<Day19$CompositeCondition> getCompositeConditions();\n Code:\n 0: aload_0\n 1: getfield #22 // Field compositeConditions:Ljava/util/List;\n 4: areturn\n\n public final Day19$Path with(Day19$CompositeCondition);\n Code:\n 0: aload_1\n 1: ldc #31 // String compositeCondition\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day19$Path\n 9: dup\n 10: aload_0\n 11: getfield #22 // Field compositeConditions:Ljava/util/List;\n 14: checkcast #33 // class java/util/Collection\n 17: aload_1\n 18: invokestatic #39 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;\n 21: invokespecial #41 // Method \"<init>\":(Ljava/util/List;)V\n 24: areturn\n\n public final java.util.List<Day19$CompositeCondition> component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field compositeConditions:Ljava/util/List;\n 4: areturn\n\n public final Day19$Path copy(java.util.List<Day19$CompositeCondition>);\n Code:\n 0: aload_1\n 1: ldc #10 // String compositeConditions\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day19$Path\n 9: dup\n 10: aload_1\n 11: invokespecial #41 // Method \"<init>\":(Ljava/util/List;)V\n 14: areturn\n\n public static Day19$Path copy$default(Day19$Path, java.util.List, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field compositeConditions:Ljava/util/List;\n 10: astore_1\n 11: aload_0\n 12: aload_1\n 13: invokevirtual #50 // Method copy:(Ljava/util/List;)LDay19$Path;\n 16: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #54 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #55 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #57 // String Path(compositeConditions=\n 9: invokevirtual #61 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field compositeConditions:Ljava/util/List;\n 16: invokevirtual #64 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: bipush 41\n 21: invokevirtual #67 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 24: invokevirtual #69 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 27: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field compositeConditions:Ljava/util/List;\n 4: invokevirtual #73 // Method java/lang/Object.hashCode:()I\n 7: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$Path\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$Path\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field compositeConditions:Ljava/util/List;\n 25: aload_2\n 26: getfield #22 // Field compositeConditions:Ljava/util/List;\n 29: invokestatic #80 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: iconst_1\n 38: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$Part$Companion.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$Part$Companion {\n private Day19$Part$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day19$Part parse(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: iconst_1\n 8: invokestatic #27 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;\n 11: iconst_1\n 12: invokestatic #30 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;\n 15: checkcast #32 // class java/lang/CharSequence\n 18: iconst_1\n 19: anewarray #34 // class java/lang/String\n 22: astore_3\n 23: aload_3\n 24: iconst_0\n 25: ldc #36 // String ,\n 27: aastore\n 28: aload_3\n 29: iconst_0\n 30: iconst_0\n 31: bipush 6\n 33: aconst_null\n 34: invokestatic #40 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 37: checkcast #42 // class java/lang/Iterable\n 40: astore_3\n 41: iconst_0\n 42: istore 4\n 44: aload_3\n 45: astore 5\n 47: new #44 // class java/util/ArrayList\n 50: dup\n 51: aload_3\n 52: bipush 10\n 54: invokestatic #50 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 57: invokespecial #53 // Method java/util/ArrayList.\"<init>\":(I)V\n 60: checkcast #55 // class java/util/Collection\n 63: astore 6\n 65: iconst_0\n 66: istore 7\n 68: aload 5\n 70: invokeinterface #59, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 75: astore 8\n 77: aload 8\n 79: invokeinterface #65, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 84: ifeq 190\n 87: aload 8\n 89: invokeinterface #69, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 94: astore 9\n 96: aload 6\n 98: aload 9\n 100: checkcast #34 // class java/lang/String\n 103: astore 10\n 105: astore 15\n 107: iconst_0\n 108: istore 11\n 110: aload 10\n 112: checkcast #32 // class java/lang/CharSequence\n 115: iconst_1\n 116: anewarray #34 // class java/lang/String\n 119: astore 12\n 121: aload 12\n 123: iconst_0\n 124: ldc #71 // String =\n 126: aastore\n 127: aload 12\n 129: iconst_0\n 130: iconst_0\n 131: bipush 6\n 133: aconst_null\n 134: invokestatic #40 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 137: astore 13\n 139: aload 13\n 141: iconst_0\n 142: invokeinterface #77, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 147: checkcast #34 // class java/lang/String\n 150: astore 12\n 152: aload 13\n 154: iconst_1\n 155: invokeinterface #77, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 160: checkcast #34 // class java/lang/String\n 163: astore 14\n 165: aload 12\n 167: aload 14\n 169: invokestatic #83 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 172: invokestatic #87 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 175: invokestatic #93 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 178: aload 15\n 180: swap\n 181: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 186: pop\n 187: goto 77\n 190: aload 6\n 192: checkcast #73 // class java/util/List\n 195: nop\n 196: checkcast #42 // class java/lang/Iterable\n 199: invokestatic #103 // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;\n 202: astore_2\n 203: new #105 // class Day19$Part\n 206: dup\n 207: aload_2\n 208: invokespecial #108 // Method Day19$Part.\"<init>\":(Ljava/util/Map;)V\n 211: areturn\n\n public Day19$Part$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #127 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19$PathFinder.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19$PathFinder {\n private final java.util.Map<java.lang.String, Day19$Job> jobs;\n\n public Day19$PathFinder(java.util.Map<java.lang.String, Day19$Job>);\n Code:\n 0: aload_1\n 1: ldc #10 // String jobs\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #22 // Field jobs:Ljava/util/Map;\n 15: return\n\n public final java.util.Map<java.lang.String, Day19$Job> getJobs();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: areturn\n\n public final java.util.List<Day19$Path> findPathsToRejectedState();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: ldc #32 // String in\n 6: invokeinterface #38, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 11: dup\n 12: invokestatic #42 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 15: checkcast #44 // class Day19$Job\n 18: astore_1\n 19: new #46 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #47 // Method java/util/ArrayList.\"<init>\":()V\n 26: checkcast #49 // class java/util/List\n 29: astore_2\n 30: aload_2\n 31: aload_1\n 32: invokevirtual #52 // Method Day19$Job.conditionsLeadingToRejectedState:()Ljava/util/List;\n 35: checkcast #54 // class java/lang/Iterable\n 38: astore_3\n 39: astore 20\n 41: iconst_0\n 42: istore 4\n 44: aload_3\n 45: astore 5\n 47: new #46 // class java/util/ArrayList\n 50: dup\n 51: aload_3\n 52: bipush 10\n 54: invokestatic #60 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 57: invokespecial #63 // Method java/util/ArrayList.\"<init>\":(I)V\n 60: checkcast #65 // class java/util/Collection\n 63: astore 6\n 65: iconst_0\n 66: istore 7\n 68: aload 5\n 70: invokeinterface #69, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 75: astore 8\n 77: aload 8\n 79: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 84: ifeq 134\n 87: aload 8\n 89: invokeinterface #79, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 94: astore 9\n 96: aload 6\n 98: aload 9\n 100: checkcast #81 // class Day19$CompositeCondition\n 103: astore 10\n 105: astore 21\n 107: iconst_0\n 108: istore 11\n 110: new #83 // class Day19$Path\n 113: dup\n 114: aload 10\n 116: invokestatic #87 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 119: invokespecial #90 // Method Day19$Path.\"<init>\":(Ljava/util/List;)V\n 122: aload 21\n 124: swap\n 125: invokeinterface #94, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 130: pop\n 131: goto 77\n 134: aload 6\n 136: checkcast #49 // class java/util/List\n 139: nop\n 140: aload 20\n 142: swap\n 143: checkcast #65 // class java/util/Collection\n 146: invokeinterface #98, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 151: pop\n 152: aload_1\n 153: invokevirtual #101 // Method Day19$Job.nonTerminalConditions:()Ljava/util/List;\n 156: checkcast #54 // class java/lang/Iterable\n 159: astore 4\n 161: nop\n 162: iconst_0\n 163: istore 5\n 165: aload 4\n 167: astore 6\n 169: new #46 // class java/util/ArrayList\n 172: dup\n 173: aload 4\n 175: bipush 10\n 177: invokestatic #60 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 180: invokespecial #63 // Method java/util/ArrayList.\"<init>\":(I)V\n 183: checkcast #65 // class java/util/Collection\n 186: astore 7\n 188: iconst_0\n 189: istore 8\n 191: aload 6\n 193: invokeinterface #69, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 198: astore 9\n 200: aload 9\n 202: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 207: ifeq 262\n 210: aload 9\n 212: invokeinterface #79, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 217: astore 10\n 219: aload 7\n 221: aload 10\n 223: checkcast #81 // class Day19$CompositeCondition\n 226: astore 11\n 228: astore 22\n 230: iconst_0\n 231: istore 12\n 233: aload 11\n 235: new #83 // class Day19$Path\n 238: dup\n 239: aload 11\n 241: invokestatic #87 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 244: invokespecial #90 // Method Day19$Path.\"<init>\":(Ljava/util/List;)V\n 247: invokestatic #107 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 250: aload 22\n 252: swap\n 253: invokeinterface #94, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 258: pop\n 259: goto 200\n 262: aload 7\n 264: checkcast #49 // class java/util/List\n 267: nop\n 268: checkcast #65 // class java/util/Collection\n 271: astore 23\n 273: new #109 // class kotlin/collections/ArrayDeque\n 276: dup\n 277: aload 23\n 279: invokespecial #112 // Method kotlin/collections/ArrayDeque.\"<init>\":(Ljava/util/Collection;)V\n 282: astore_3\n 283: aload_3\n 284: checkcast #65 // class java/util/Collection\n 287: invokeinterface #115, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 292: ifne 299\n 295: iconst_1\n 296: goto 300\n 299: iconst_0\n 300: ifeq 610\n 303: aload_3\n 304: invokevirtual #118 // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;\n 307: checkcast #120 // class kotlin/Pair\n 310: astore 4\n 312: aload 4\n 314: invokevirtual #123 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 317: checkcast #81 // class Day19$CompositeCondition\n 320: astore 5\n 322: aload 4\n 324: invokevirtual #126 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 327: checkcast #83 // class Day19$Path\n 330: astore 6\n 332: aload_0\n 333: getfield #22 // Field jobs:Ljava/util/Map;\n 336: aload 5\n 338: invokevirtual #130 // Method Day19$CompositeCondition.getNextState:()Ljava/lang/String;\n 341: invokeinterface #38, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 346: dup\n 347: invokestatic #42 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 350: checkcast #44 // class Day19$Job\n 353: astore 7\n 355: aload 7\n 357: invokevirtual #52 // Method Day19$Job.conditionsLeadingToRejectedState:()Ljava/util/List;\n 360: astore 8\n 362: aload 8\n 364: checkcast #54 // class java/lang/Iterable\n 367: astore 10\n 369: iconst_0\n 370: istore 11\n 372: aload 10\n 374: astore 12\n 376: new #46 // class java/util/ArrayList\n 379: dup\n 380: aload 10\n 382: bipush 10\n 384: invokestatic #60 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 387: invokespecial #63 // Method java/util/ArrayList.\"<init>\":(I)V\n 390: checkcast #65 // class java/util/Collection\n 393: astore 13\n 395: iconst_0\n 396: istore 14\n 398: aload 12\n 400: invokeinterface #69, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 405: astore 15\n 407: aload 15\n 409: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 414: ifeq 459\n 417: aload 15\n 419: invokeinterface #79, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 424: astore 16\n 426: aload 13\n 428: aload 16\n 430: checkcast #81 // class Day19$CompositeCondition\n 433: astore 17\n 435: astore 20\n 437: iconst_0\n 438: istore 18\n 440: aload 6\n 442: aload 17\n 444: invokevirtual #134 // Method Day19$Path.with:(LDay19$CompositeCondition;)LDay19$Path;\n 447: aload 20\n 449: swap\n 450: invokeinterface #94, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 455: pop\n 456: goto 407\n 459: aload 13\n 461: checkcast #49 // class java/util/List\n 464: nop\n 465: astore 9\n 467: aload_2\n 468: aload 9\n 470: checkcast #65 // class java/util/Collection\n 473: invokeinterface #98, 2 // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z\n 478: pop\n 479: aload 7\n 481: invokevirtual #101 // Method Day19$Job.nonTerminalConditions:()Ljava/util/List;\n 484: astore 10\n 486: aload_3\n 487: aload 10\n 489: checkcast #54 // class java/lang/Iterable\n 492: astore 11\n 494: astore 20\n 496: iconst_0\n 497: istore 12\n 499: aload 11\n 501: astore 13\n 503: new #46 // class java/util/ArrayList\n 506: dup\n 507: aload 11\n 509: bipush 10\n 511: invokestatic #60 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 514: invokespecial #63 // Method java/util/ArrayList.\"<init>\":(I)V\n 517: checkcast #65 // class java/util/Collection\n 520: astore 14\n 522: iconst_0\n 523: istore 15\n 525: aload 13\n 527: invokeinterface #69, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 532: astore 16\n 534: aload 16\n 536: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 541: ifeq 591\n 544: aload 16\n 546: invokeinterface #79, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 551: astore 17\n 553: aload 14\n 555: aload 17\n 557: checkcast #81 // class Day19$CompositeCondition\n 560: astore 18\n 562: astore 21\n 564: iconst_0\n 565: istore 19\n 567: aload 18\n 569: aload 6\n 571: aload 18\n 573: invokevirtual #134 // Method Day19$Path.with:(LDay19$CompositeCondition;)LDay19$Path;\n 576: invokestatic #107 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 579: aload 21\n 581: swap\n 582: invokeinterface #94, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 587: pop\n 588: goto 534\n 591: aload 14\n 593: checkcast #49 // class java/util/List\n 596: nop\n 597: aload 20\n 599: swap\n 600: checkcast #65 // class java/util/Collection\n 603: invokevirtual #135 // Method kotlin/collections/ArrayDeque.addAll:(Ljava/util/Collection;)Z\n 606: pop\n 607: goto 283\n 610: aload_2\n 611: areturn\n\n public final java.util.Map<java.lang.String, Day19$Job> component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: areturn\n\n public final Day19$PathFinder copy(java.util.Map<java.lang.String, Day19$Job>);\n Code:\n 0: aload_1\n 1: ldc #10 // String jobs\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day19$PathFinder\n 9: dup\n 10: aload_1\n 11: invokespecial #169 // Method \"<init>\":(Ljava/util/Map;)V\n 14: areturn\n\n public static Day19$PathFinder copy$default(Day19$PathFinder, java.util.Map, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field jobs:Ljava/util/Map;\n 10: astore_1\n 11: aload_0\n 12: aload_1\n 13: invokevirtual #173 // Method copy:(Ljava/util/Map;)LDay19$PathFinder;\n 16: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #176 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #177 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #179 // String PathFinder(jobs=\n 9: invokevirtual #183 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field jobs:Ljava/util/Map;\n 16: invokevirtual #186 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: bipush 41\n 21: invokevirtual #189 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 24: invokevirtual #191 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 27: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field jobs:Ljava/util/Map;\n 4: invokevirtual #195 // Method java/lang/Object.hashCode:()I\n 7: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day19$PathFinder\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day19$PathFinder\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field jobs:Ljava/util/Map;\n 25: aload_2\n 26: getfield #22 // Field jobs:Ljava/util/Map;\n 29: invokestatic #201 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: iconst_1\n 38: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day19.class", "javap": "Compiled from \"Day19.kt\"\npublic final class Day19 {\n public static final Day19 INSTANCE;\n\n private static final long MIN_STATES;\n\n private static final long MAX_STATES;\n\n private static final java.lang.String ACCEPTED_STATE;\n\n private static final java.lang.String REJECTED_STATE;\n\n private static final java.lang.String START_STATE;\n\n private Day19();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: invokestatic #30 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 13: astore 4\n 15: aload 4\n 17: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 22: astore 5\n 24: aload 5\n 26: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 31: ifeq 83\n 34: aload 5\n 36: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 41: astore 6\n 43: aload 6\n 45: checkcast #46 // class kotlin/collections/IndexedValue\n 48: astore 7\n 50: iconst_0\n 51: istore 8\n 53: aload 7\n 55: invokevirtual #49 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 58: checkcast #51 // class java/lang/CharSequence\n 61: invokeinterface #55, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 66: ifne 73\n 69: iconst_1\n 70: goto 74\n 73: iconst_0\n 74: nop\n 75: ifeq 24\n 78: aload 6\n 80: goto 84\n 83: aconst_null\n 84: dup\n 85: invokestatic #59 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 88: checkcast #46 // class kotlin/collections/IndexedValue\n 91: invokevirtual #62 // Method kotlin/collections/IndexedValue.getIndex:()I\n 94: istore_2\n 95: aload_1\n 96: iconst_0\n 97: iload_2\n 98: invokeinterface #68, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 103: checkcast #24 // class java/lang/Iterable\n 106: astore 4\n 108: iconst_0\n 109: istore 5\n 111: aload 4\n 113: astore 6\n 115: new #70 // class java/util/ArrayList\n 118: dup\n 119: aload 4\n 121: bipush 10\n 123: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 126: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 129: checkcast #79 // class java/util/Collection\n 132: astore 7\n 134: iconst_0\n 135: istore 8\n 137: aload 6\n 139: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 144: astore 9\n 146: aload 9\n 148: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 153: ifeq 199\n 156: aload 9\n 158: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 163: astore 10\n 165: aload 7\n 167: aload 10\n 169: checkcast #81 // class java/lang/String\n 172: astore 11\n 174: astore 16\n 176: iconst_0\n 177: istore 12\n 179: getstatic #87 // Field Day19$Job.Companion:LDay19$Job$Companion;\n 182: aload 11\n 184: invokevirtual #93 // Method Day19$Job$Companion.parse:(Ljava/lang/String;)LDay19$Job;\n 187: aload 16\n 189: swap\n 190: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 195: pop\n 196: goto 146\n 199: aload 7\n 201: checkcast #64 // class java/util/List\n 204: nop\n 205: astore_3\n 206: aload_1\n 207: iload_2\n 208: iconst_1\n 209: iadd\n 210: aload_1\n 211: invokeinterface #100, 1 // InterfaceMethod java/util/List.size:()I\n 216: invokeinterface #68, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 221: checkcast #24 // class java/lang/Iterable\n 224: astore 5\n 226: iconst_0\n 227: istore 6\n 229: aload 5\n 231: astore 7\n 233: new #70 // class java/util/ArrayList\n 236: dup\n 237: aload 5\n 239: bipush 10\n 241: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 244: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 247: checkcast #79 // class java/util/Collection\n 250: astore 8\n 252: iconst_0\n 253: istore 9\n 255: aload 7\n 257: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 262: astore 10\n 264: aload 10\n 266: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 271: ifeq 317\n 274: aload 10\n 276: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 281: astore 11\n 283: aload 8\n 285: aload 11\n 287: checkcast #81 // class java/lang/String\n 290: astore 12\n 292: astore 16\n 294: iconst_0\n 295: istore 13\n 297: getstatic #105 // Field Day19$Part.Companion:LDay19$Part$Companion;\n 300: aload 12\n 302: invokevirtual #110 // Method Day19$Part$Companion.parse:(Ljava/lang/String;)LDay19$Part;\n 305: aload 16\n 307: swap\n 308: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 313: pop\n 314: goto 264\n 317: aload 8\n 319: checkcast #64 // class java/util/List\n 322: nop\n 323: astore 4\n 325: aload_3\n 326: checkcast #24 // class java/lang/Iterable\n 329: astore 6\n 331: iconst_0\n 332: istore 7\n 334: aload 6\n 336: bipush 10\n 338: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 341: invokestatic #116 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 344: bipush 16\n 346: invokestatic #122 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 349: istore 8\n 351: aload 6\n 353: astore 9\n 355: new #124 // class java/util/LinkedHashMap\n 358: dup\n 359: iload 8\n 361: invokespecial #125 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 364: checkcast #127 // class java/util/Map\n 367: astore 10\n 369: iconst_0\n 370: istore 11\n 372: aload 9\n 374: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 379: astore 12\n 381: aload 12\n 383: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 388: ifeq 433\n 391: aload 12\n 393: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 398: astore 13\n 400: aload 10\n 402: aload 13\n 404: checkcast #83 // class Day19$Job\n 407: astore 14\n 409: astore 18\n 411: iconst_0\n 412: istore 15\n 414: aload 14\n 416: invokevirtual #131 // Method Day19$Job.getId:()Ljava/lang/String;\n 419: aload 18\n 421: swap\n 422: aload 13\n 424: invokeinterface #135, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 429: pop\n 430: goto 381\n 433: aload 10\n 435: nop\n 436: astore 19\n 438: new #137 // class Day19$Workflow\n 441: dup\n 442: aload 19\n 444: invokespecial #140 // Method Day19$Workflow.\"<init>\":(Ljava/util/Map;)V\n 447: astore 5\n 449: aload 4\n 451: checkcast #24 // class java/lang/Iterable\n 454: astore 6\n 456: iconst_0\n 457: istore 7\n 459: aload 6\n 461: astore 8\n 463: new #70 // class java/util/ArrayList\n 466: dup\n 467: invokespecial #141 // Method java/util/ArrayList.\"<init>\":()V\n 470: checkcast #79 // class java/util/Collection\n 473: astore 9\n 475: iconst_0\n 476: istore 10\n 478: aload 8\n 480: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 485: astore 11\n 487: aload 11\n 489: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 494: ifeq 539\n 497: aload 11\n 499: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 504: astore 12\n 506: aload 12\n 508: checkcast #102 // class Day19$Part\n 511: astore 13\n 513: iconst_0\n 514: istore 14\n 516: aload 5\n 518: aload 13\n 520: invokevirtual #145 // Method Day19$Workflow.isAccepted:(LDay19$Part;)Z\n 523: ifeq 487\n 526: aload 9\n 528: aload 12\n 530: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 535: pop\n 536: goto 487\n 539: aload 9\n 541: checkcast #64 // class java/util/List\n 544: nop\n 545: checkcast #24 // class java/lang/Iterable\n 548: astore 6\n 550: iconst_0\n 551: istore 7\n 553: aload 6\n 555: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 560: astore 8\n 562: aload 8\n 564: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 569: ifeq 612\n 572: aload 8\n 574: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 579: astore 9\n 581: iload 7\n 583: aload 9\n 585: checkcast #102 // class Day19$Part\n 588: astore 10\n 590: istore 16\n 592: iconst_0\n 593: istore 11\n 595: aload 10\n 597: invokevirtual #148 // Method Day19$Part.score:()I\n 600: istore 17\n 602: iload 16\n 604: iload 17\n 606: iadd\n 607: istore 7\n 609: goto 562\n 612: iload 7\n 614: invokestatic #152 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 617: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: invokestatic #30 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 13: astore 4\n 15: aload 4\n 17: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 22: astore 5\n 24: aload 5\n 26: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 31: ifeq 83\n 34: aload 5\n 36: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 41: astore 6\n 43: aload 6\n 45: checkcast #46 // class kotlin/collections/IndexedValue\n 48: astore 7\n 50: iconst_0\n 51: istore 8\n 53: aload 7\n 55: invokevirtual #49 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 58: checkcast #51 // class java/lang/CharSequence\n 61: invokeinterface #55, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 66: ifne 73\n 69: iconst_1\n 70: goto 74\n 73: iconst_0\n 74: nop\n 75: ifeq 24\n 78: aload 6\n 80: goto 84\n 83: aconst_null\n 84: dup\n 85: invokestatic #59 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 88: checkcast #46 // class kotlin/collections/IndexedValue\n 91: invokevirtual #62 // Method kotlin/collections/IndexedValue.getIndex:()I\n 94: istore_2\n 95: aload_1\n 96: iconst_0\n 97: iload_2\n 98: invokeinterface #68, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 103: checkcast #24 // class java/lang/Iterable\n 106: astore 4\n 108: iconst_0\n 109: istore 5\n 111: aload 4\n 113: astore 6\n 115: new #70 // class java/util/ArrayList\n 118: dup\n 119: aload 4\n 121: bipush 10\n 123: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 126: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 129: checkcast #79 // class java/util/Collection\n 132: astore 7\n 134: iconst_0\n 135: istore 8\n 137: aload 6\n 139: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 144: astore 9\n 146: aload 9\n 148: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 153: ifeq 199\n 156: aload 9\n 158: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 163: astore 10\n 165: aload 7\n 167: aload 10\n 169: checkcast #81 // class java/lang/String\n 172: astore 11\n 174: astore 40\n 176: iconst_0\n 177: istore 12\n 179: getstatic #87 // Field Day19$Job.Companion:LDay19$Job$Companion;\n 182: aload 11\n 184: invokevirtual #93 // Method Day19$Job$Companion.parse:(Ljava/lang/String;)LDay19$Job;\n 187: aload 40\n 189: swap\n 190: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 195: pop\n 196: goto 146\n 199: aload 7\n 201: checkcast #64 // class java/util/List\n 204: nop\n 205: astore_3\n 206: aload_3\n 207: checkcast #24 // class java/lang/Iterable\n 210: astore 5\n 212: iconst_0\n 213: istore 6\n 215: aload 5\n 217: bipush 10\n 219: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 222: invokestatic #116 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 225: bipush 16\n 227: invokestatic #122 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 230: istore 7\n 232: aload 5\n 234: astore 8\n 236: new #124 // class java/util/LinkedHashMap\n 239: dup\n 240: iload 7\n 242: invokespecial #125 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 245: checkcast #127 // class java/util/Map\n 248: astore 9\n 250: iconst_0\n 251: istore 10\n 253: aload 8\n 255: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 260: astore 11\n 262: aload 11\n 264: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 269: ifeq 314\n 272: aload 11\n 274: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 279: astore 12\n 281: aload 9\n 283: aload 12\n 285: checkcast #83 // class Day19$Job\n 288: astore 13\n 290: astore 41\n 292: iconst_0\n 293: istore 14\n 295: aload 13\n 297: invokevirtual #131 // Method Day19$Job.getId:()Ljava/lang/String;\n 300: aload 41\n 302: swap\n 303: aload 12\n 305: invokeinterface #135, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 310: pop\n 311: goto 262\n 314: aload 9\n 316: nop\n 317: astore 42\n 319: new #193 // class Day19$PathFinder\n 322: dup\n 323: aload 42\n 325: invokespecial #194 // Method Day19$PathFinder.\"<init>\":(Ljava/util/Map;)V\n 328: invokevirtual #198 // Method Day19$PathFinder.findPathsToRejectedState:()Ljava/util/List;\n 331: astore 4\n 333: aload 4\n 335: checkcast #24 // class java/lang/Iterable\n 338: astore 6\n 340: nop\n 341: iconst_0\n 342: istore 7\n 344: aload 6\n 346: astore 8\n 348: new #70 // class java/util/ArrayList\n 351: dup\n 352: invokespecial #141 // Method java/util/ArrayList.\"<init>\":()V\n 355: checkcast #79 // class java/util/Collection\n 358: astore 9\n 360: iconst_0\n 361: istore 10\n 363: aload 8\n 365: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 370: astore 11\n 372: aload 11\n 374: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 379: ifeq 439\n 382: aload 11\n 384: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 389: astore 12\n 391: aload 12\n 393: checkcast #200 // class Day19$Path\n 396: astore 13\n 398: iconst_0\n 399: istore 14\n 401: aload 13\n 403: invokevirtual #203 // Method Day19$Path.getCompositeConditions:()Ljava/util/List;\n 406: checkcast #79 // class java/util/Collection\n 409: invokeinterface #206, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 414: ifne 421\n 417: iconst_1\n 418: goto 422\n 421: iconst_0\n 422: nop\n 423: ifeq 372\n 426: aload 9\n 428: aload 12\n 430: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 435: pop\n 436: goto 372\n 439: aload 9\n 441: checkcast #64 // class java/util/List\n 444: nop\n 445: checkcast #24 // class java/lang/Iterable\n 448: astore 6\n 450: nop\n 451: iconst_0\n 452: istore 7\n 454: aload 6\n 456: astore 8\n 458: new #70 // class java/util/ArrayList\n 461: dup\n 462: aload 6\n 464: bipush 10\n 466: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 469: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 472: checkcast #79 // class java/util/Collection\n 475: astore 9\n 477: iconst_0\n 478: istore 10\n 480: aload 8\n 482: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 487: astore 11\n 489: aload 11\n 491: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 496: ifeq 1131\n 499: aload 11\n 501: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 506: astore 12\n 508: aload 9\n 510: aload 12\n 512: checkcast #200 // class Day19$Path\n 515: astore 13\n 517: astore 40\n 519: iconst_0\n 520: istore 14\n 522: aload 13\n 524: invokevirtual #203 // Method Day19$Path.getCompositeConditions:()Ljava/util/List;\n 527: checkcast #24 // class java/lang/Iterable\n 530: astore 15\n 532: iconst_0\n 533: istore 16\n 535: aload 15\n 537: astore 17\n 539: new #70 // class java/util/ArrayList\n 542: dup\n 543: invokespecial #141 // Method java/util/ArrayList.\"<init>\":()V\n 546: checkcast #79 // class java/util/Collection\n 549: astore 18\n 551: iconst_0\n 552: istore 19\n 554: aload 17\n 556: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 561: astore 20\n 563: aload 20\n 565: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 570: ifeq 613\n 573: aload 20\n 575: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 580: astore 21\n 582: aload 21\n 584: checkcast #208 // class Day19$CompositeCondition\n 587: astore 22\n 589: iconst_0\n 590: istore 23\n 592: aload 22\n 594: invokevirtual #211 // Method Day19$CompositeCondition.getConditions:()Ljava/util/List;\n 597: checkcast #24 // class java/lang/Iterable\n 600: astore 22\n 602: aload 18\n 604: aload 22\n 606: invokestatic #215 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 609: pop\n 610: goto 563\n 613: aload 18\n 615: checkcast #64 // class java/util/List\n 618: nop\n 619: checkcast #24 // class java/lang/Iterable\n 622: astore 15\n 624: nop\n 625: iconst_0\n 626: istore 16\n 628: aload 15\n 630: astore 17\n 632: new #70 // class java/util/ArrayList\n 635: dup\n 636: aload 15\n 638: bipush 10\n 640: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 643: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 646: checkcast #79 // class java/util/Collection\n 649: astore 18\n 651: iconst_0\n 652: istore 19\n 654: aload 17\n 656: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 661: astore 20\n 663: aload 20\n 665: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 670: ifeq 713\n 673: aload 20\n 675: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 680: astore 21\n 682: aload 18\n 684: aload 21\n 686: checkcast #217 // class Day19$Condition\n 689: astore 22\n 691: astore 24\n 693: iconst_0\n 694: istore 23\n 696: aload 22\n 698: invokevirtual #221 // Method Day19$Condition.toMinAndMax:()LDay19$MinAndMax;\n 701: aload 24\n 703: swap\n 704: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 709: pop\n 710: goto 663\n 713: aload 18\n 715: checkcast #64 // class java/util/List\n 718: nop\n 719: checkcast #24 // class java/lang/Iterable\n 722: astore 15\n 724: nop\n 725: iconst_0\n 726: istore 16\n 728: aload 15\n 730: astore 17\n 732: new #124 // class java/util/LinkedHashMap\n 735: dup\n 736: invokespecial #222 // Method java/util/LinkedHashMap.\"<init>\":()V\n 739: checkcast #127 // class java/util/Map\n 742: astore 18\n 744: iconst_0\n 745: istore 19\n 747: aload 17\n 749: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 754: astore 20\n 756: aload 20\n 758: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 763: ifeq 868\n 766: aload 20\n 768: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 773: astore 21\n 775: aload 21\n 777: checkcast #224 // class Day19$MinAndMax\n 780: astore 22\n 782: iconst_0\n 783: istore 23\n 785: aload 22\n 787: invokevirtual #227 // Method Day19$MinAndMax.getKey:()Ljava/lang/String;\n 790: astore 25\n 792: aload 18\n 794: astore 26\n 796: iconst_0\n 797: istore 27\n 799: aload 26\n 801: aload 25\n 803: invokeinterface #231, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 808: astore 28\n 810: aload 28\n 812: ifnonnull 847\n 815: iconst_0\n 816: istore 29\n 818: new #70 // class java/util/ArrayList\n 821: dup\n 822: invokespecial #141 // Method java/util/ArrayList.\"<init>\":()V\n 825: checkcast #64 // class java/util/List\n 828: astore 29\n 830: aload 26\n 832: aload 25\n 834: aload 29\n 836: invokeinterface #135, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 841: pop\n 842: aload 29\n 844: goto 849\n 847: aload 28\n 849: nop\n 850: checkcast #64 // class java/util/List\n 853: astore 22\n 855: aload 22\n 857: aload 21\n 859: invokeinterface #232, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 864: pop\n 865: goto 756\n 868: aload 18\n 870: nop\n 871: astore 15\n 873: nop\n 874: iconst_0\n 875: istore 16\n 877: aload 15\n 879: astore 17\n 881: new #124 // class java/util/LinkedHashMap\n 884: dup\n 885: aload 15\n 887: invokeinterface #233, 1 // InterfaceMethod java/util/Map.size:()I\n 892: invokestatic #116 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 895: invokespecial #125 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 898: checkcast #127 // class java/util/Map\n 901: astore 18\n 903: iconst_0\n 904: istore 19\n 906: aload 17\n 908: invokeinterface #237, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 913: checkcast #24 // class java/lang/Iterable\n 916: astore 20\n 918: iconst_0\n 919: istore 21\n 921: aload 20\n 923: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 928: astore 22\n 930: aload 22\n 932: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 937: ifeq 1114\n 940: aload 22\n 942: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 947: astore 23\n 949: aload 18\n 951: aload 23\n 953: checkcast #239 // class java/util/Map$Entry\n 956: astore 25\n 958: astore 26\n 960: iconst_0\n 961: istore 27\n 963: aload 25\n 965: invokeinterface #241, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 970: aload 26\n 972: swap\n 973: aload 23\n 975: checkcast #239 // class java/util/Map$Entry\n 978: astore 28\n 980: astore 30\n 982: astore 24\n 984: iconst_0\n 985: istore 29\n 987: aload 28\n 989: invokeinterface #242, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 994: checkcast #64 // class java/util/List\n 997: astore 31\n 999: aload 31\n 1001: checkcast #24 // class java/lang/Iterable\n 1004: astore 32\n 1006: iconst_0\n 1007: istore 33\n 1009: aload 32\n 1011: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1016: astore 34\n 1018: aload 34\n 1020: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1025: ifne 1038\n 1028: new #244 // class java/lang/UnsupportedOperationException\n 1031: dup\n 1032: ldc #246 // String Empty collection can\\'t be reduced.\n 1034: invokespecial #249 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 1037: athrow\n 1038: aload 34\n 1040: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1045: astore 35\n 1047: aload 34\n 1049: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1054: ifeq 1091\n 1057: aload 35\n 1059: aload 34\n 1061: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1066: checkcast #224 // class Day19$MinAndMax\n 1069: astore 36\n 1071: checkcast #224 // class Day19$MinAndMax\n 1074: astore 37\n 1076: iconst_0\n 1077: istore 38\n 1079: aload 37\n 1081: aload 36\n 1083: invokevirtual #253 // Method Day19$MinAndMax.coerce:(LDay19$MinAndMax;)LDay19$MinAndMax;\n 1086: astore 35\n 1088: goto 1047\n 1091: aload 35\n 1093: checkcast #224 // class Day19$MinAndMax\n 1096: nop\n 1097: astore 39\n 1099: aload 24\n 1101: aload 30\n 1103: aload 39\n 1105: invokeinterface #135, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1110: pop\n 1111: goto 930\n 1114: aload 18\n 1116: nop\n 1117: nop\n 1118: nop\n 1119: aload 40\n 1121: swap\n 1122: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1127: pop\n 1128: goto 489\n 1131: aload 9\n 1133: checkcast #64 // class java/util/List\n 1136: nop\n 1137: astore 5\n 1139: aload 5\n 1141: checkcast #24 // class java/lang/Iterable\n 1144: astore 8\n 1146: iconst_0\n 1147: istore 9\n 1149: aload 8\n 1151: astore 10\n 1153: new #70 // class java/util/ArrayList\n 1156: dup\n 1157: aload 8\n 1159: bipush 10\n 1161: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1164: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 1167: checkcast #79 // class java/util/Collection\n 1170: astore 11\n 1172: iconst_0\n 1173: istore 12\n 1175: aload 10\n 1177: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1182: astore 13\n 1184: aload 13\n 1186: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1191: ifeq 1604\n 1194: aload 13\n 1196: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1201: astore 14\n 1203: aload 11\n 1205: aload 14\n 1207: checkcast #127 // class java/util/Map\n 1210: astore 15\n 1212: astore 40\n 1214: iconst_0\n 1215: istore 16\n 1217: iconst_4\n 1218: anewarray #81 // class java/lang/String\n 1221: astore 17\n 1223: aload 17\n 1225: iconst_0\n 1226: ldc #255 // String x\n 1228: aastore\n 1229: aload 17\n 1231: iconst_1\n 1232: ldc_w #257 // String m\n 1235: aastore\n 1236: aload 17\n 1238: iconst_2\n 1239: ldc_w #259 // String a\n 1242: aastore\n 1243: aload 17\n 1245: iconst_3\n 1246: ldc_w #261 // String s\n 1249: aastore\n 1250: aload 17\n 1252: invokestatic #265 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 1255: checkcast #24 // class java/lang/Iterable\n 1258: astore 17\n 1260: iconst_0\n 1261: istore 18\n 1263: aload 17\n 1265: astore 19\n 1267: new #70 // class java/util/ArrayList\n 1270: dup\n 1271: aload 17\n 1273: bipush 10\n 1275: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1278: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 1281: checkcast #79 // class java/util/Collection\n 1284: astore 20\n 1286: iconst_0\n 1287: istore 21\n 1289: aload 19\n 1291: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1296: astore 22\n 1298: aload 22\n 1300: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1305: ifeq 1373\n 1308: aload 22\n 1310: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1315: astore 23\n 1317: aload 20\n 1319: aload 23\n 1321: checkcast #81 // class java/lang/String\n 1324: astore 24\n 1326: astore 25\n 1328: iconst_0\n 1329: istore 26\n 1331: aload 15\n 1333: aload 24\n 1335: invokeinterface #231, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 1340: checkcast #224 // class Day19$MinAndMax\n 1343: dup\n 1344: ifnonnull 1361\n 1347: pop\n 1348: new #224 // class Day19$MinAndMax\n 1351: dup\n 1352: lconst_1\n 1353: ldc2_w #266 // long 4000l\n 1356: aload 24\n 1358: invokespecial #270 // Method Day19$MinAndMax.\"<init>\":(JJLjava/lang/String;)V\n 1361: aload 25\n 1363: swap\n 1364: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1369: pop\n 1370: goto 1298\n 1373: aload 20\n 1375: checkcast #64 // class java/util/List\n 1378: nop\n 1379: checkcast #24 // class java/lang/Iterable\n 1382: astore 17\n 1384: nop\n 1385: iconst_0\n 1386: istore 18\n 1388: aload 17\n 1390: astore 19\n 1392: new #70 // class java/util/ArrayList\n 1395: dup\n 1396: aload 17\n 1398: bipush 10\n 1400: invokestatic #74 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1403: invokespecial #77 // Method java/util/ArrayList.\"<init>\":(I)V\n 1406: checkcast #79 // class java/util/Collection\n 1409: astore 20\n 1411: iconst_0\n 1412: istore 21\n 1414: aload 19\n 1416: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1421: astore 22\n 1423: aload 22\n 1425: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1430: ifeq 1476\n 1433: aload 22\n 1435: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1440: astore 23\n 1442: aload 20\n 1444: aload 23\n 1446: checkcast #224 // class Day19$MinAndMax\n 1449: astore 24\n 1451: astore 25\n 1453: iconst_0\n 1454: istore 26\n 1456: aload 24\n 1458: invokevirtual #273 // Method Day19$MinAndMax.length:()J\n 1461: invokestatic #278 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 1464: aload 25\n 1466: swap\n 1467: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1472: pop\n 1473: goto 1423\n 1476: aload 20\n 1478: checkcast #64 // class java/util/List\n 1481: nop\n 1482: checkcast #24 // class java/lang/Iterable\n 1485: astore 17\n 1487: nop\n 1488: iconst_0\n 1489: istore 18\n 1491: aload 17\n 1493: invokeinterface #34, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1498: astore 19\n 1500: aload 19\n 1502: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1507: ifne 1520\n 1510: new #244 // class java/lang/UnsupportedOperationException\n 1513: dup\n 1514: ldc #246 // String Empty collection can\\'t be reduced.\n 1516: invokespecial #249 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 1519: athrow\n 1520: aload 19\n 1522: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1527: astore 20\n 1529: aload 19\n 1531: invokeinterface #40, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1536: ifeq 1580\n 1539: aload 20\n 1541: aload 19\n 1543: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1548: checkcast #280 // class java/lang/Number\n 1551: invokevirtual #283 // Method java/lang/Number.longValue:()J\n 1554: lstore 27\n 1556: checkcast #280 // class java/lang/Number\n 1559: invokevirtual #283 // Method java/lang/Number.longValue:()J\n 1562: lstore 29\n 1564: iconst_0\n 1565: istore 26\n 1567: lload 29\n 1569: lload 27\n 1571: lmul\n 1572: invokestatic #278 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 1575: astore 20\n 1577: goto 1529\n 1580: aload 20\n 1582: checkcast #280 // class java/lang/Number\n 1585: invokevirtual #283 // Method java/lang/Number.longValue:()J\n 1588: nop\n 1589: invokestatic #278 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 1592: aload 40\n 1594: swap\n 1595: invokeinterface #97, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1600: pop\n 1601: goto 1184\n 1604: aload 11\n 1606: checkcast #64 // class java/util/List\n 1609: nop\n 1610: checkcast #24 // class java/lang/Iterable\n 1613: invokestatic #287 // Method kotlin/collections/CollectionsKt.sumOfLong:(Ljava/lang/Iterable;)J\n 1616: lstore 6\n 1618: ldc2_w #288 // long 256000000000000l\n 1621: lstore 8\n 1623: lload 8\n 1625: lload 6\n 1627: lsub\n 1628: lstore 10\n 1630: lload 10\n 1632: invokestatic #292 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 1635: areturn\n\n static {};\n Code:\n 0: new #2 // class Day19\n 3: dup\n 4: invokespecial #352 // Method \"<init>\":()V\n 7: putstatic #355 // Field INSTANCE:LDay19;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day7.kt
import kotlin.String import kotlin.collections.List object Day7 { interface CardHand : Comparable<CardHand> { val maxSimilarCards: Int val bid: Long val secondMaxSimilarCards: Int val cards: CharArray val cardValues: Map<Char, Int> fun score(rank: Int): Long { return bid * rank } override fun compareTo(other: CardHand): Int { return compareBy<CardHand> { it.maxSimilarCards } .thenBy { it.secondMaxSimilarCards } .then { first, second -> val thisCardValues = first.cards.map { cardValues[it] ?: 0 } val otherCardValues = second.cards.map { cardValues[it] ?: 0 } thisCardValues.zip(otherCardValues).map { it.first - it.second }.firstOrNull { it != 0 } ?: 0 } .compare(this, other) } } data class CamelCardHandWithJokers(override val cards: CharArray, override val bid: Long) : CardHand { override val maxSimilarCards: Int private val possibleCards: CharArray = arrayOf('J', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'Q', 'K', 'A').toCharArray() override val secondMaxSimilarCards: Int override val cardValues = possibleCards.zip(possibleCards.indices).toMap() init { val numJokers = cards.count { it == 'J' } val nonJokers = cards.filter { it != 'J' }.groupBy { it }.mapValues { it.value.size } val values = nonJokers.values.sortedDescending() val maxNonJokers = values.firstOrNull() ?: 0 val secondMaxNonJokers = values.drop(1).firstOrNull() ?: 0 maxSimilarCards = maxNonJokers + numJokers secondMaxSimilarCards = secondMaxNonJokers } companion object { fun parse(input: String): CamelCardHandWithJokers { val (cards, bid) = input.split(" ") return CamelCardHandWithJokers(cards.toCharArray(), bid.toLong()) } } } data class CamelCardHand(override val cards: CharArray, override val bid: Long) : CardHand { override val maxSimilarCards: Int override val secondMaxSimilarCards: Int private val possibleCards: CharArray = arrayOf('2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A').toCharArray() override val cardValues = possibleCards.zip(possibleCards.indices).toMap() init { val grouped = cards.groupBy { it }.mapValues { it.value.size } val values = grouped.values.sortedDescending() maxSimilarCards = values.first() secondMaxSimilarCards = values.drop(1).firstOrNull() ?: 0 } companion object { fun parse(input: String): CamelCardHand { val (cards, bid) = input.split(" ") return CamelCardHand(cards.toCharArray(), bid.toLong()) } } } fun part1(input: List<String>): String { val hands = input.map(CamelCardHand::parse) return score(hands).toString() } fun part2(input: List<String>): String { val hands = input.map(CamelCardHandWithJokers::parse) return score(hands).toString() } private fun score(hands: List<CardHand>): Long { val sortedHands = hands.sorted() return sortedHands.zip(sortedHands.indices).sumOf { (hand, index) -> hand.score(index + 1) } } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CardHand$DefaultImpls$compareTo$$inlined$thenBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day7$CardHand$DefaultImpls$compareTo$$inlined$thenBy$1<T> implements java.util.Comparator {\n final java.util.Comparator $this_thenBy;\n\n public Day7$CardHand$DefaultImpls$compareTo$$inlined$thenBy$1(java.util.Comparator);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #18 // Field $this_thenBy:Ljava/util/Comparator;\n 5: aload_0\n 6: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 9: return\n\n public final int compare(T, T);\n Code:\n 0: aload_0\n 1: getfield #18 // Field $this_thenBy:Ljava/util/Comparator;\n 4: aload_1\n 5: aload_2\n 6: invokeinterface #29, 3 // InterfaceMethod java/util/Comparator.compare:(Ljava/lang/Object;Ljava/lang/Object;)I\n 11: istore_3\n 12: iload_3\n 13: ifeq 20\n 16: iload_3\n 17: goto 72\n 20: aload_1\n 21: checkcast #31 // class Day7$CardHand\n 24: astore 4\n 26: iconst_0\n 27: istore 5\n 29: aload 4\n 31: invokeinterface #35, 1 // InterfaceMethod Day7$CardHand.getSecondMaxSimilarCards:()I\n 36: invokestatic #41 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 39: checkcast #43 // class java/lang/Comparable\n 42: aload_2\n 43: checkcast #31 // class Day7$CardHand\n 46: astore 4\n 48: astore 6\n 50: iconst_0\n 51: istore 5\n 53: aload 4\n 55: invokeinterface #35, 1 // InterfaceMethod Day7$CardHand.getSecondMaxSimilarCards:()I\n 60: invokestatic #41 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 63: checkcast #43 // class java/lang/Comparable\n 66: aload 6\n 68: swap\n 69: invokestatic #49 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 72: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7 {\n public static final Day7 INSTANCE;\n\n private Day7();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_3\n 11: getstatic #30 // Field Day7$CamelCardHand.Companion:LDay7$CamelCardHand$Companion;\n 14: astore 4\n 16: iconst_0\n 17: istore 5\n 19: aload_3\n 20: astore 6\n 22: new #32 // class java/util/ArrayList\n 25: dup\n 26: aload_3\n 27: bipush 10\n 29: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 32: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 35: checkcast #43 // class java/util/Collection\n 38: astore 7\n 40: iconst_0\n 41: istore 8\n 43: aload 6\n 45: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 50: astore 9\n 52: aload 9\n 54: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 59: ifeq 104\n 62: aload 9\n 64: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 69: astore 10\n 71: aload 7\n 73: aload 10\n 75: checkcast #59 // class java/lang/String\n 78: astore 11\n 80: astore 13\n 82: iconst_0\n 83: istore 12\n 85: aload 4\n 87: aload 11\n 89: invokevirtual #65 // Method Day7$CamelCardHand$Companion.parse:(Ljava/lang/String;)LDay7$CamelCardHand;\n 92: aload 13\n 94: swap\n 95: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 100: pop\n 101: goto 52\n 104: aload 7\n 106: checkcast #71 // class java/util/List\n 109: nop\n 110: astore_2\n 111: aload_0\n 112: aload_2\n 113: invokespecial #75 // Method score:(Ljava/util/List;)J\n 116: invokestatic #79 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 119: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_3\n 11: getstatic #100 // Field Day7$CamelCardHandWithJokers.Companion:LDay7$CamelCardHandWithJokers$Companion;\n 14: astore 4\n 16: iconst_0\n 17: istore 5\n 19: aload_3\n 20: astore 6\n 22: new #32 // class java/util/ArrayList\n 25: dup\n 26: aload_3\n 27: bipush 10\n 29: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 32: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 35: checkcast #43 // class java/util/Collection\n 38: astore 7\n 40: iconst_0\n 41: istore 8\n 43: aload 6\n 45: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 50: astore 9\n 52: aload 9\n 54: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 59: ifeq 104\n 62: aload 9\n 64: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 69: astore 10\n 71: aload 7\n 73: aload 10\n 75: checkcast #59 // class java/lang/String\n 78: astore 11\n 80: astore 13\n 82: iconst_0\n 83: istore 12\n 85: aload 4\n 87: aload 11\n 89: invokevirtual #105 // Method Day7$CamelCardHandWithJokers$Companion.parse:(Ljava/lang/String;)LDay7$CamelCardHandWithJokers;\n 92: aload 13\n 94: swap\n 95: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 100: pop\n 101: goto 52\n 104: aload 7\n 106: checkcast #71 // class java/util/List\n 109: nop\n 110: astore_2\n 111: aload_0\n 112: aload_2\n 113: invokespecial #75 // Method score:(Ljava/util/List;)J\n 116: invokestatic #79 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 119: areturn\n\n private final long score(java.util.List<? extends Day7$CardHand>);\n Code:\n 0: aload_1\n 1: checkcast #24 // class java/lang/Iterable\n 4: invokestatic #111 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;\n 7: astore_2\n 8: aload_2\n 9: checkcast #24 // class java/lang/Iterable\n 12: aload_2\n 13: checkcast #43 // class java/util/Collection\n 16: invokestatic #115 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 19: checkcast #24 // class java/lang/Iterable\n 22: invokestatic #119 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 25: checkcast #24 // class java/lang/Iterable\n 28: astore_3\n 29: lconst_0\n 30: lstore 4\n 32: aload_3\n 33: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 38: astore 6\n 40: aload 6\n 42: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 47: ifeq 119\n 50: aload 6\n 52: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 57: astore 7\n 59: lload 4\n 61: aload 7\n 63: checkcast #121 // class kotlin/Pair\n 66: astore 8\n 68: lstore 12\n 70: iconst_0\n 71: istore 9\n 73: aload 8\n 75: invokevirtual #124 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 78: checkcast #126 // class Day7$CardHand\n 81: astore 10\n 83: aload 8\n 85: invokevirtual #129 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 88: checkcast #131 // class java/lang/Number\n 91: invokevirtual #135 // Method java/lang/Number.intValue:()I\n 94: istore 11\n 96: aload 10\n 98: iload 11\n 100: iconst_1\n 101: iadd\n 102: invokeinterface #138, 2 // InterfaceMethod Day7$CardHand.score:(I)J\n 107: lstore 14\n 109: lload 12\n 111: lload 14\n 113: ladd\n 114: lstore 4\n 116: goto 40\n 119: lload 4\n 121: lreturn\n\n static {};\n Code:\n 0: new #2 // class Day7\n 3: dup\n 4: invokespecial #145 // Method \"<init>\":()V\n 7: putstatic #148 // Field INSTANCE:LDay7;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CamelCardHand.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7$CamelCardHand implements Day7$CardHand {\n public static final Day7$CamelCardHand$Companion Companion;\n\n private final char[] cards;\n\n private final long bid;\n\n private final int maxSimilarCards;\n\n private final int secondMaxSimilarCards;\n\n private final char[] possibleCards;\n\n private final java.util.Map<java.lang.Character, java.lang.Integer> cardValues;\n\n public Day7$CamelCardHand(char[], long);\n Code:\n 0: aload_1\n 1: ldc #11 // String cards\n 3: invokestatic #17 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #23 // Field cards:[C\n 15: aload_0\n 16: lload_2\n 17: putfield #27 // Field bid:J\n 20: aload_0\n 21: bipush 13\n 23: anewarray #29 // class java/lang/Character\n 26: astore 4\n 28: aload 4\n 30: iconst_0\n 31: bipush 50\n 33: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 36: aastore\n 37: aload 4\n 39: iconst_1\n 40: bipush 51\n 42: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 45: aastore\n 46: aload 4\n 48: iconst_2\n 49: bipush 52\n 51: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 54: aastore\n 55: aload 4\n 57: iconst_3\n 58: bipush 53\n 60: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 63: aastore\n 64: aload 4\n 66: iconst_4\n 67: bipush 54\n 69: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 72: aastore\n 73: aload 4\n 75: iconst_5\n 76: bipush 55\n 78: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 81: aastore\n 82: aload 4\n 84: bipush 6\n 86: bipush 56\n 88: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 91: aastore\n 92: aload 4\n 94: bipush 7\n 96: bipush 57\n 98: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 101: aastore\n 102: aload 4\n 104: bipush 8\n 106: bipush 84\n 108: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 111: aastore\n 112: aload 4\n 114: bipush 9\n 116: bipush 74\n 118: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 121: aastore\n 122: aload 4\n 124: bipush 10\n 126: bipush 81\n 128: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 131: aastore\n 132: aload 4\n 134: bipush 11\n 136: bipush 75\n 138: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 141: aastore\n 142: aload 4\n 144: bipush 12\n 146: bipush 65\n 148: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 151: aastore\n 152: aload 4\n 154: invokestatic #39 // Method kotlin/collections/ArraysKt.toCharArray:([Ljava/lang/Character;)[C\n 157: putfield #42 // Field possibleCards:[C\n 160: aload_0\n 161: aload_0\n 162: getfield #42 // Field possibleCards:[C\n 165: aload_0\n 166: getfield #42 // Field possibleCards:[C\n 169: invokestatic #46 // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;\n 172: checkcast #48 // class java/lang/Iterable\n 175: invokestatic #52 // Method kotlin/collections/ArraysKt.zip:([CLjava/lang/Iterable;)Ljava/util/List;\n 178: checkcast #48 // class java/lang/Iterable\n 181: invokestatic #58 // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;\n 184: putfield #62 // Field cardValues:Ljava/util/Map;\n 187: nop\n 188: aload_0\n 189: invokevirtual #66 // Method getCards:()[C\n 192: astore 5\n 194: iconst_0\n 195: istore 6\n 197: aload 5\n 199: astore 7\n 201: new #68 // class java/util/LinkedHashMap\n 204: dup\n 205: invokespecial #69 // Method java/util/LinkedHashMap.\"<init>\":()V\n 208: checkcast #71 // class java/util/Map\n 211: astore 8\n 213: iconst_0\n 214: istore 9\n 216: iconst_0\n 217: istore 10\n 219: aload 7\n 221: arraylength\n 222: istore 11\n 224: iload 10\n 226: iload 11\n 228: if_icmpge 334\n 231: aload 7\n 233: iload 10\n 235: caload\n 236: istore 12\n 238: iload 12\n 240: istore 13\n 242: iconst_0\n 243: istore 14\n 245: iload 13\n 247: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 250: astore 15\n 252: aload 8\n 254: astore 16\n 256: iconst_0\n 257: istore 17\n 259: aload 16\n 261: aload 15\n 263: invokeinterface #75, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 268: astore 18\n 270: aload 18\n 272: ifnonnull 307\n 275: iconst_0\n 276: istore 19\n 278: new #77 // class java/util/ArrayList\n 281: dup\n 282: invokespecial #78 // Method java/util/ArrayList.\"<init>\":()V\n 285: checkcast #80 // class java/util/List\n 288: astore 19\n 290: aload 16\n 292: aload 15\n 294: aload 19\n 296: invokeinterface #84, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 301: pop\n 302: aload 19\n 304: goto 309\n 307: aload 18\n 309: nop\n 310: checkcast #80 // class java/util/List\n 313: astore 13\n 315: aload 13\n 317: iload 12\n 319: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 322: invokeinterface #88, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 327: pop\n 328: iinc 10, 1\n 331: goto 224\n 334: aload 8\n 336: nop\n 337: astore 5\n 339: nop\n 340: iconst_0\n 341: istore 6\n 343: aload 5\n 345: astore 7\n 347: new #68 // class java/util/LinkedHashMap\n 350: dup\n 351: aload 5\n 353: invokeinterface #92, 1 // InterfaceMethod java/util/Map.size:()I\n 358: invokestatic #96 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 361: invokespecial #99 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 364: checkcast #71 // class java/util/Map\n 367: astore 8\n 369: iconst_0\n 370: istore 9\n 372: aload 7\n 374: invokeinterface #103, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 379: checkcast #48 // class java/lang/Iterable\n 382: astore 10\n 384: iconst_0\n 385: istore 11\n 387: aload 10\n 389: invokeinterface #107, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 394: astore 12\n 396: aload 12\n 398: invokeinterface #113, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 403: ifeq 488\n 406: aload 12\n 408: invokeinterface #117, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 413: astore 13\n 415: aload 8\n 417: aload 13\n 419: checkcast #119 // class java/util/Map$Entry\n 422: astore 14\n 424: astore 15\n 426: iconst_0\n 427: istore 16\n 429: aload 14\n 431: invokeinterface #122, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 436: aload 15\n 438: swap\n 439: aload 13\n 441: checkcast #119 // class java/util/Map$Entry\n 444: astore 17\n 446: astore 21\n 448: astore 20\n 450: iconst_0\n 451: istore 18\n 453: aload 17\n 455: invokeinterface #125, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 460: checkcast #80 // class java/util/List\n 463: invokeinterface #126, 1 // InterfaceMethod java/util/List.size:()I\n 468: invokestatic #131 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 471: astore 22\n 473: aload 20\n 475: aload 21\n 477: aload 22\n 479: invokeinterface #84, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 484: pop\n 485: goto 396\n 488: aload 8\n 490: nop\n 491: nop\n 492: astore 4\n 494: aload 4\n 496: invokeinterface #135, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 501: checkcast #48 // class java/lang/Iterable\n 504: invokestatic #141 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 507: astore 5\n 509: aload_0\n 510: aload 5\n 512: invokestatic #145 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 515: checkcast #147 // class java/lang/Number\n 518: invokevirtual #150 // Method java/lang/Number.intValue:()I\n 521: putfield #154 // Field maxSimilarCards:I\n 524: aload_0\n 525: aload 5\n 527: checkcast #48 // class java/lang/Iterable\n 530: iconst_1\n 531: invokestatic #158 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 534: invokestatic #161 // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 537: checkcast #128 // class java/lang/Integer\n 540: dup\n 541: ifnull 550\n 544: invokevirtual #162 // Method java/lang/Integer.intValue:()I\n 547: goto 552\n 550: pop\n 551: iconst_0\n 552: putfield #165 // Field secondMaxSimilarCards:I\n 555: nop\n 556: return\n\n public char[] getCards();\n Code:\n 0: aload_0\n 1: getfield #23 // Field cards:[C\n 4: areturn\n\n public long getBid();\n Code:\n 0: aload_0\n 1: getfield #27 // Field bid:J\n 4: lreturn\n\n public int getMaxSimilarCards();\n Code:\n 0: aload_0\n 1: getfield #154 // Field maxSimilarCards:I\n 4: ireturn\n\n public int getSecondMaxSimilarCards();\n Code:\n 0: aload_0\n 1: getfield #165 // Field secondMaxSimilarCards:I\n 4: ireturn\n\n public java.util.Map<java.lang.Character, java.lang.Integer> getCardValues();\n Code:\n 0: aload_0\n 1: getfield #62 // Field cardValues:Ljava/util/Map;\n 4: areturn\n\n public final char[] component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field cards:[C\n 4: areturn\n\n public final long component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field bid:J\n 4: lreturn\n\n public final Day7$CamelCardHand copy(char[], long);\n Code:\n 0: aload_1\n 1: ldc #11 // String cards\n 3: invokestatic #17 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day7$CamelCardHand\n 9: dup\n 10: aload_1\n 11: lload_2\n 12: invokespecial #214 // Method \"<init>\":([CJ)V\n 15: areturn\n\n public static Day7$CamelCardHand copy$default(Day7$CamelCardHand, char[], long, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #23 // Field cards:[C\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field bid:J\n 23: lstore_2\n 24: aload_0\n 25: aload_1\n 26: lload_2\n 27: invokevirtual #218 // Method copy:([CJ)LDay7$CamelCardHand;\n 30: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #222 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #223 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #225 // String CamelCardHand(cards=\n 9: invokevirtual #229 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field cards:[C\n 16: invokestatic #234 // Method java/util/Arrays.toString:([C)Ljava/lang/String;\n 19: invokevirtual #229 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: ldc #236 // String , bid=\n 24: invokevirtual #229 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 27: aload_0\n 28: getfield #27 // Field bid:J\n 31: invokevirtual #239 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 34: bipush 41\n 36: invokevirtual #242 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 39: invokevirtual #244 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 42: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field cards:[C\n 4: invokestatic #248 // Method java/util/Arrays.hashCode:([C)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field bid:J\n 16: invokestatic #253 // Method java/lang/Long.hashCode:(J)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day7$CamelCardHand\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day7$CamelCardHand\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field cards:[C\n 25: aload_2\n 26: getfield #23 // Field cards:[C\n 29: invokestatic #260 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field bid:J\n 41: aload_2\n 42: getfield #27 // Field bid:J\n 45: lcmp\n 46: ifeq 51\n 49: iconst_0\n 50: ireturn\n 51: iconst_1\n 52: ireturn\n\n public long score(int);\n Code:\n 0: aload_0\n 1: iload_1\n 2: invokestatic #268 // Method Day7$CardHand$DefaultImpls.score:(LDay7$CardHand;I)J\n 5: lreturn\n\n public int compareTo(Day7$CardHand);\n Code:\n 0: aload_0\n 1: aload_1\n 2: invokestatic #274 // Method Day7$CardHand$DefaultImpls.compareTo:(LDay7$CardHand;LDay7$CardHand;)I\n 5: ireturn\n\n public int compareTo(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #6 // class Day7$CardHand\n 5: invokevirtual #278 // Method compareTo:(LDay7$CardHand;)I\n 8: ireturn\n\n static {};\n Code:\n 0: new #281 // class Day7$CamelCardHand$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #284 // Method Day7$CamelCardHand$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #288 // Field Companion:LDay7$CamelCardHand$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CamelCardHand$Companion.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7$CamelCardHand$Companion {\n private Day7$CamelCardHand$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day7$CamelCardHand parse(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #23 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #25 // class java/lang/String\n 14: astore_3\n 15: aload_3\n 16: iconst_0\n 17: ldc #27 // String\n 19: aastore\n 20: aload_3\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: astore_2\n 30: aload_2\n 31: iconst_0\n 32: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 37: checkcast #25 // class java/lang/String\n 40: astore_3\n 41: aload_2\n 42: iconst_1\n 43: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 48: checkcast #25 // class java/lang/String\n 51: astore 4\n 53: new #41 // class Day7$CamelCardHand\n 56: dup\n 57: aload_3\n 58: invokevirtual #45 // Method java/lang/String.toCharArray:()[C\n 61: dup\n 62: ldc #47 // String toCharArray(...)\n 64: invokestatic #50 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 67: aload 4\n 69: invokestatic #56 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 72: invokespecial #59 // Method Day7$CamelCardHand.\"<init>\":([CJ)V\n 75: areturn\n\n public Day7$CamelCardHand$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #64 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CardHand$DefaultImpls.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7$CardHand$DefaultImpls {\n public static long score(Day7$CardHand, int);\n Code:\n 0: aload_0\n 1: invokeinterface #13, 1 // InterfaceMethod Day7$CardHand.getBid:()J\n 6: iload_1\n 7: i2l\n 8: lmul\n 9: lreturn\n\n public static int compareTo(Day7$CardHand, Day7$CardHand);\n Code:\n 0: aload_1\n 1: ldc #21 // String other\n 3: invokestatic #27 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #29 // class Day7$CardHand$DefaultImpls$compareTo$$inlined$compareBy$1\n 9: dup\n 10: invokespecial #33 // Method Day7$CardHand$DefaultImpls$compareTo$$inlined$compareBy$1.\"<init>\":()V\n 13: checkcast #35 // class java/util/Comparator\n 16: astore_2\n 17: new #37 // class Day7$CardHand$DefaultImpls$compareTo$$inlined$thenBy$1\n 20: dup\n 21: aload_2\n 22: invokespecial #40 // Method Day7$CardHand$DefaultImpls$compareTo$$inlined$thenBy$1.\"<init>\":(Ljava/util/Comparator;)V\n 25: checkcast #35 // class java/util/Comparator\n 28: aload_0\n 29: invokedynamic #60, 0 // InvokeDynamic #0:invoke:(LDay7$CardHand;)Lkotlin/jvm/functions/Function2;\n 34: invokedynamic #71, 0 // InvokeDynamic #1:compare:(Lkotlin/jvm/functions/Function2;)Ljava/util/Comparator;\n 39: invokestatic #77 // Method kotlin/comparisons/ComparisonsKt.then:(Ljava/util/Comparator;Ljava/util/Comparator;)Ljava/util/Comparator;\n 42: aload_0\n 43: aload_1\n 44: invokeinterface #79, 3 // InterfaceMethod java/util/Comparator.compare:(Ljava/lang/Object;Ljava/lang/Object;)I\n 49: ireturn\n\n private static int compareTo$lambda$6(Day7$CardHand, Day7$CardHand, Day7$CardHand);\n Code:\n 0: aload_1\n 1: invokeinterface #83, 1 // InterfaceMethod Day7$CardHand.getCards:()[C\n 6: astore 4\n 8: iconst_0\n 9: istore 5\n 11: aload 4\n 13: astore 6\n 15: new #85 // class java/util/ArrayList\n 18: dup\n 19: aload 4\n 21: arraylength\n 22: invokespecial #88 // Method java/util/ArrayList.\"<init>\":(I)V\n 25: checkcast #90 // class java/util/Collection\n 28: astore 7\n 30: iconst_0\n 31: istore 8\n 33: iconst_0\n 34: istore 9\n 36: aload 6\n 38: arraylength\n 39: istore 10\n 41: iload 9\n 43: iload 10\n 45: if_icmpge 115\n 48: aload 6\n 50: iload 9\n 52: caload\n 53: istore 11\n 55: aload 7\n 57: iload 11\n 59: istore 12\n 61: astore 15\n 63: iconst_0\n 64: istore 13\n 66: aload_0\n 67: invokeinterface #94, 1 // InterfaceMethod Day7$CardHand.getCardValues:()Ljava/util/Map;\n 72: iload 12\n 74: invokestatic #100 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 77: invokeinterface #106, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 82: checkcast #108 // class java/lang/Integer\n 85: dup\n 86: ifnull 95\n 89: invokevirtual #112 // Method java/lang/Integer.intValue:()I\n 92: goto 97\n 95: pop\n 96: iconst_0\n 97: invokestatic #115 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 100: aload 15\n 102: swap\n 103: invokeinterface #119, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 108: pop\n 109: iinc 9, 1\n 112: goto 41\n 115: aload 7\n 117: checkcast #121 // class java/util/List\n 120: nop\n 121: astore_3\n 122: aload_2\n 123: invokeinterface #83, 1 // InterfaceMethod Day7$CardHand.getCards:()[C\n 128: astore 5\n 130: iconst_0\n 131: istore 6\n 133: aload 5\n 135: astore 7\n 137: new #85 // class java/util/ArrayList\n 140: dup\n 141: aload 5\n 143: arraylength\n 144: invokespecial #88 // Method java/util/ArrayList.\"<init>\":(I)V\n 147: checkcast #90 // class java/util/Collection\n 150: astore 8\n 152: iconst_0\n 153: istore 9\n 155: iconst_0\n 156: istore 10\n 158: aload 7\n 160: arraylength\n 161: istore 11\n 163: iload 10\n 165: iload 11\n 167: if_icmpge 237\n 170: aload 7\n 172: iload 10\n 174: caload\n 175: istore 12\n 177: aload 8\n 179: iload 12\n 181: istore 13\n 183: astore 15\n 185: iconst_0\n 186: istore 14\n 188: aload_0\n 189: invokeinterface #94, 1 // InterfaceMethod Day7$CardHand.getCardValues:()Ljava/util/Map;\n 194: iload 13\n 196: invokestatic #100 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 199: invokeinterface #106, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 204: checkcast #108 // class java/lang/Integer\n 207: dup\n 208: ifnull 217\n 211: invokevirtual #112 // Method java/lang/Integer.intValue:()I\n 214: goto 219\n 217: pop\n 218: iconst_0\n 219: invokestatic #115 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 222: aload 15\n 224: swap\n 225: invokeinterface #119, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 230: pop\n 231: iinc 10, 1\n 234: goto 163\n 237: aload 8\n 239: checkcast #121 // class java/util/List\n 242: nop\n 243: astore 4\n 245: aload_3\n 246: checkcast #123 // class java/lang/Iterable\n 249: aload 4\n 251: checkcast #123 // class java/lang/Iterable\n 254: invokestatic #129 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 257: checkcast #123 // class java/lang/Iterable\n 260: astore 6\n 262: iconst_0\n 263: istore 7\n 265: aload 6\n 267: astore 8\n 269: new #85 // class java/util/ArrayList\n 272: dup\n 273: aload 6\n 275: bipush 10\n 277: invokestatic #133 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 280: invokespecial #88 // Method java/util/ArrayList.\"<init>\":(I)V\n 283: checkcast #90 // class java/util/Collection\n 286: astore 9\n 288: iconst_0\n 289: istore 10\n 291: aload 8\n 293: invokeinterface #137, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 298: astore 11\n 300: aload 11\n 302: invokeinterface #143, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 307: ifeq 371\n 310: aload 11\n 312: invokeinterface #147, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 317: astore 12\n 319: aload 9\n 321: aload 12\n 323: checkcast #149 // class kotlin/Pair\n 326: astore 13\n 328: astore 15\n 330: iconst_0\n 331: istore 14\n 333: aload 13\n 335: invokevirtual #152 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 338: checkcast #154 // class java/lang/Number\n 341: invokevirtual #155 // Method java/lang/Number.intValue:()I\n 344: aload 13\n 346: invokevirtual #158 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 349: checkcast #154 // class java/lang/Number\n 352: invokevirtual #155 // Method java/lang/Number.intValue:()I\n 355: isub\n 356: invokestatic #115 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 359: aload 15\n 361: swap\n 362: invokeinterface #119, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 367: pop\n 368: goto 300\n 371: aload 9\n 373: checkcast #121 // class java/util/List\n 376: nop\n 377: checkcast #123 // class java/lang/Iterable\n 380: astore 6\n 382: iconst_0\n 383: istore 7\n 385: aload 6\n 387: invokeinterface #137, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 392: astore 8\n 394: aload 8\n 396: invokeinterface #143, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 401: ifeq 444\n 404: aload 8\n 406: invokeinterface #147, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 411: astore 9\n 413: aload 9\n 415: checkcast #154 // class java/lang/Number\n 418: invokevirtual #155 // Method java/lang/Number.intValue:()I\n 421: istore 10\n 423: iconst_0\n 424: istore 11\n 426: iload 10\n 428: ifeq 435\n 431: iconst_1\n 432: goto 436\n 435: iconst_0\n 436: ifeq 394\n 439: aload 9\n 441: goto 445\n 444: aconst_null\n 445: checkcast #108 // class java/lang/Integer\n 448: dup\n 449: ifnull 458\n 452: invokevirtual #112 // Method java/lang/Integer.intValue:()I\n 455: goto 460\n 458: pop\n 459: iconst_0\n 460: ireturn\n\n private static int compareTo$lambda$7(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #189, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: checkcast #154 // class java/lang/Number\n 11: invokevirtual #155 // Method java/lang/Number.intValue:()I\n 14: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CardHand.class", "javap": "Compiled from \"Day7.kt\"\npublic interface Day7$CardHand extends java.lang.Comparable<Day7$CardHand> {\n public abstract int getMaxSimilarCards();\n\n public abstract long getBid();\n\n public abstract int getSecondMaxSimilarCards();\n\n public abstract char[] getCards();\n\n public abstract java.util.Map<java.lang.Character, java.lang.Integer> getCardValues();\n\n public abstract long score(int);\n\n public abstract int compareTo(Day7$CardHand);\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CamelCardHandWithJokers$Companion.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7$CamelCardHandWithJokers$Companion {\n private Day7$CamelCardHandWithJokers$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day7$CamelCardHandWithJokers parse(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #23 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #25 // class java/lang/String\n 14: astore_3\n 15: aload_3\n 16: iconst_0\n 17: ldc #27 // String\n 19: aastore\n 20: aload_3\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: astore_2\n 30: aload_2\n 31: iconst_0\n 32: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 37: checkcast #25 // class java/lang/String\n 40: astore_3\n 41: aload_2\n 42: iconst_1\n 43: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 48: checkcast #25 // class java/lang/String\n 51: astore 4\n 53: new #41 // class Day7$CamelCardHandWithJokers\n 56: dup\n 57: aload_3\n 58: invokevirtual #45 // Method java/lang/String.toCharArray:()[C\n 61: dup\n 62: ldc #47 // String toCharArray(...)\n 64: invokestatic #50 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 67: aload 4\n 69: invokestatic #56 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 72: invokespecial #59 // Method Day7$CamelCardHandWithJokers.\"<init>\":([CJ)V\n 75: areturn\n\n public Day7$CamelCardHandWithJokers$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #64 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CamelCardHandWithJokers.class", "javap": "Compiled from \"Day7.kt\"\npublic final class Day7$CamelCardHandWithJokers implements Day7$CardHand {\n public static final Day7$CamelCardHandWithJokers$Companion Companion;\n\n private final char[] cards;\n\n private final long bid;\n\n private final int maxSimilarCards;\n\n private final char[] possibleCards;\n\n private final int secondMaxSimilarCards;\n\n private final java.util.Map<java.lang.Character, java.lang.Integer> cardValues;\n\n public Day7$CamelCardHandWithJokers(char[], long);\n Code:\n 0: aload_1\n 1: ldc #11 // String cards\n 3: invokestatic #17 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #23 // Field cards:[C\n 15: aload_0\n 16: lload_2\n 17: putfield #27 // Field bid:J\n 20: aload_0\n 21: bipush 13\n 23: anewarray #29 // class java/lang/Character\n 26: astore 4\n 28: aload 4\n 30: iconst_0\n 31: bipush 74\n 33: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 36: aastore\n 37: aload 4\n 39: iconst_1\n 40: bipush 50\n 42: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 45: aastore\n 46: aload 4\n 48: iconst_2\n 49: bipush 51\n 51: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 54: aastore\n 55: aload 4\n 57: iconst_3\n 58: bipush 52\n 60: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 63: aastore\n 64: aload 4\n 66: iconst_4\n 67: bipush 53\n 69: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 72: aastore\n 73: aload 4\n 75: iconst_5\n 76: bipush 54\n 78: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 81: aastore\n 82: aload 4\n 84: bipush 6\n 86: bipush 55\n 88: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 91: aastore\n 92: aload 4\n 94: bipush 7\n 96: bipush 56\n 98: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 101: aastore\n 102: aload 4\n 104: bipush 8\n 106: bipush 57\n 108: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 111: aastore\n 112: aload 4\n 114: bipush 9\n 116: bipush 84\n 118: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 121: aastore\n 122: aload 4\n 124: bipush 10\n 126: bipush 81\n 128: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 131: aastore\n 132: aload 4\n 134: bipush 11\n 136: bipush 75\n 138: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 141: aastore\n 142: aload 4\n 144: bipush 12\n 146: bipush 65\n 148: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 151: aastore\n 152: aload 4\n 154: invokestatic #39 // Method kotlin/collections/ArraysKt.toCharArray:([Ljava/lang/Character;)[C\n 157: putfield #42 // Field possibleCards:[C\n 160: aload_0\n 161: aload_0\n 162: getfield #42 // Field possibleCards:[C\n 165: aload_0\n 166: getfield #42 // Field possibleCards:[C\n 169: invokestatic #46 // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;\n 172: checkcast #48 // class java/lang/Iterable\n 175: invokestatic #52 // Method kotlin/collections/ArraysKt.zip:([CLjava/lang/Iterable;)Ljava/util/List;\n 178: checkcast #48 // class java/lang/Iterable\n 181: invokestatic #58 // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;\n 184: putfield #62 // Field cardValues:Ljava/util/Map;\n 187: nop\n 188: aload_0\n 189: invokevirtual #66 // Method getCards:()[C\n 192: astore 5\n 194: iconst_0\n 195: istore 6\n 197: iconst_0\n 198: istore 7\n 200: iconst_0\n 201: istore 8\n 203: aload 5\n 205: arraylength\n 206: istore 9\n 208: iload 8\n 210: iload 9\n 212: if_icmpge 253\n 215: aload 5\n 217: iload 8\n 219: caload\n 220: istore 10\n 222: iload 10\n 224: istore 11\n 226: iconst_0\n 227: istore 12\n 229: iload 11\n 231: bipush 74\n 233: if_icmpne 240\n 236: iconst_1\n 237: goto 241\n 240: iconst_0\n 241: ifeq 247\n 244: iinc 7, 1\n 247: iinc 8, 1\n 250: goto 208\n 253: iload 7\n 255: istore 4\n 257: aload_0\n 258: invokevirtual #66 // Method getCards:()[C\n 261: astore 6\n 263: iconst_0\n 264: istore 7\n 266: aload 6\n 268: astore 8\n 270: new #68 // class java/util/ArrayList\n 273: dup\n 274: invokespecial #69 // Method java/util/ArrayList.\"<init>\":()V\n 277: checkcast #71 // class java/util/Collection\n 280: astore 9\n 282: iconst_0\n 283: istore 10\n 285: iconst_0\n 286: istore 11\n 288: aload 8\n 290: arraylength\n 291: istore 12\n 293: iload 11\n 295: iload 12\n 297: if_icmpge 348\n 300: aload 8\n 302: iload 11\n 304: caload\n 305: istore 13\n 307: iload 13\n 309: istore 14\n 311: iconst_0\n 312: istore 15\n 314: iload 14\n 316: bipush 74\n 318: if_icmpeq 325\n 321: iconst_1\n 322: goto 326\n 325: iconst_0\n 326: ifeq 342\n 329: aload 9\n 331: iload 13\n 333: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 336: invokeinterface #75, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 341: pop\n 342: iinc 11, 1\n 345: goto 293\n 348: aload 9\n 350: checkcast #77 // class java/util/List\n 353: nop\n 354: checkcast #48 // class java/lang/Iterable\n 357: astore 6\n 359: nop\n 360: iconst_0\n 361: istore 7\n 363: aload 6\n 365: astore 8\n 367: new #79 // class java/util/LinkedHashMap\n 370: dup\n 371: invokespecial #80 // Method java/util/LinkedHashMap.\"<init>\":()V\n 374: checkcast #82 // class java/util/Map\n 377: astore 9\n 379: iconst_0\n 380: istore 10\n 382: aload 8\n 384: invokeinterface #86, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 389: astore 11\n 391: aload 11\n 393: invokeinterface #92, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 398: ifeq 506\n 401: aload 11\n 403: invokeinterface #96, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 408: astore 12\n 410: aload 12\n 412: checkcast #29 // class java/lang/Character\n 415: invokevirtual #100 // Method java/lang/Character.charValue:()C\n 418: istore 13\n 420: iconst_0\n 421: istore 14\n 423: iload 13\n 425: invokestatic #33 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 428: astore 15\n 430: aload 9\n 432: astore 16\n 434: iconst_0\n 435: istore 17\n 437: aload 16\n 439: aload 15\n 441: invokeinterface #104, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 446: astore 18\n 448: aload 18\n 450: ifnonnull 485\n 453: iconst_0\n 454: istore 19\n 456: new #68 // class java/util/ArrayList\n 459: dup\n 460: invokespecial #69 // Method java/util/ArrayList.\"<init>\":()V\n 463: checkcast #77 // class java/util/List\n 466: astore 19\n 468: aload 16\n 470: aload 15\n 472: aload 19\n 474: invokeinterface #108, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 479: pop\n 480: aload 19\n 482: goto 487\n 485: aload 18\n 487: nop\n 488: checkcast #77 // class java/util/List\n 491: astore 13\n 493: aload 13\n 495: aload 12\n 497: invokeinterface #109, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 502: pop\n 503: goto 391\n 506: aload 9\n 508: nop\n 509: astore 6\n 511: nop\n 512: iconst_0\n 513: istore 7\n 515: aload 6\n 517: astore 8\n 519: new #79 // class java/util/LinkedHashMap\n 522: dup\n 523: aload 6\n 525: invokeinterface #113, 1 // InterfaceMethod java/util/Map.size:()I\n 530: invokestatic #117 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 533: invokespecial #120 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 536: checkcast #82 // class java/util/Map\n 539: astore 9\n 541: iconst_0\n 542: istore 10\n 544: aload 8\n 546: invokeinterface #124, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 551: checkcast #48 // class java/lang/Iterable\n 554: astore 11\n 556: iconst_0\n 557: istore 12\n 559: aload 11\n 561: invokeinterface #86, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 566: astore 13\n 568: aload 13\n 570: invokeinterface #92, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 575: ifeq 660\n 578: aload 13\n 580: invokeinterface #96, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 585: astore 14\n 587: aload 9\n 589: aload 14\n 591: checkcast #126 // class java/util/Map$Entry\n 594: astore 15\n 596: astore 16\n 598: iconst_0\n 599: istore 17\n 601: aload 15\n 603: invokeinterface #129, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 608: aload 16\n 610: swap\n 611: aload 14\n 613: checkcast #126 // class java/util/Map$Entry\n 616: astore 18\n 618: astore 21\n 620: astore 20\n 622: iconst_0\n 623: istore 19\n 625: aload 18\n 627: invokeinterface #132, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 632: checkcast #77 // class java/util/List\n 635: invokeinterface #133, 1 // InterfaceMethod java/util/List.size:()I\n 640: invokestatic #138 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 643: astore 22\n 645: aload 20\n 647: aload 21\n 649: aload 22\n 651: invokeinterface #108, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 656: pop\n 657: goto 568\n 660: aload 9\n 662: nop\n 663: nop\n 664: astore 5\n 666: aload 5\n 668: invokeinterface #142, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 673: checkcast #48 // class java/lang/Iterable\n 676: invokestatic #148 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;\n 679: astore 6\n 681: aload 6\n 683: invokestatic #152 // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 686: checkcast #135 // class java/lang/Integer\n 689: dup\n 690: ifnull 699\n 693: invokevirtual #155 // Method java/lang/Integer.intValue:()I\n 696: goto 701\n 699: pop\n 700: iconst_0\n 701: istore 7\n 703: aload 6\n 705: checkcast #48 // class java/lang/Iterable\n 708: iconst_1\n 709: invokestatic #159 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 712: invokestatic #152 // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 715: checkcast #135 // class java/lang/Integer\n 718: dup\n 719: ifnull 728\n 722: invokevirtual #155 // Method java/lang/Integer.intValue:()I\n 725: goto 730\n 728: pop\n 729: iconst_0\n 730: istore 8\n 732: aload_0\n 733: iload 7\n 735: iload 4\n 737: iadd\n 738: putfield #163 // Field maxSimilarCards:I\n 741: aload_0\n 742: iload 8\n 744: putfield #166 // Field secondMaxSimilarCards:I\n 747: nop\n 748: return\n\n public char[] getCards();\n Code:\n 0: aload_0\n 1: getfield #23 // Field cards:[C\n 4: areturn\n\n public long getBid();\n Code:\n 0: aload_0\n 1: getfield #27 // Field bid:J\n 4: lreturn\n\n public int getMaxSimilarCards();\n Code:\n 0: aload_0\n 1: getfield #163 // Field maxSimilarCards:I\n 4: ireturn\n\n public int getSecondMaxSimilarCards();\n Code:\n 0: aload_0\n 1: getfield #166 // Field secondMaxSimilarCards:I\n 4: ireturn\n\n public java.util.Map<java.lang.Character, java.lang.Integer> getCardValues();\n Code:\n 0: aload_0\n 1: getfield #62 // Field cardValues:Ljava/util/Map;\n 4: areturn\n\n public final char[] component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field cards:[C\n 4: areturn\n\n public final long component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field bid:J\n 4: lreturn\n\n public final Day7$CamelCardHandWithJokers copy(char[], long);\n Code:\n 0: aload_1\n 1: ldc #11 // String cards\n 3: invokestatic #17 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day7$CamelCardHandWithJokers\n 9: dup\n 10: aload_1\n 11: lload_2\n 12: invokespecial #229 // Method \"<init>\":([CJ)V\n 15: areturn\n\n public static Day7$CamelCardHandWithJokers copy$default(Day7$CamelCardHandWithJokers, char[], long, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #23 // Field cards:[C\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field bid:J\n 23: lstore_2\n 24: aload_0\n 25: aload_1\n 26: lload_2\n 27: invokevirtual #233 // Method copy:([CJ)LDay7$CamelCardHandWithJokers;\n 30: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #237 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #238 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #240 // String CamelCardHandWithJokers(cards=\n 9: invokevirtual #244 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field cards:[C\n 16: invokestatic #249 // Method java/util/Arrays.toString:([C)Ljava/lang/String;\n 19: invokevirtual #244 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: ldc #251 // String , bid=\n 24: invokevirtual #244 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 27: aload_0\n 28: getfield #27 // Field bid:J\n 31: invokevirtual #254 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 34: bipush 41\n 36: invokevirtual #257 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 39: invokevirtual #259 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 42: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field cards:[C\n 4: invokestatic #263 // Method java/util/Arrays.hashCode:([C)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field bid:J\n 16: invokestatic #268 // Method java/lang/Long.hashCode:(J)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day7$CamelCardHandWithJokers\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day7$CamelCardHandWithJokers\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field cards:[C\n 25: aload_2\n 26: getfield #23 // Field cards:[C\n 29: invokestatic #275 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field bid:J\n 41: aload_2\n 42: getfield #27 // Field bid:J\n 45: lcmp\n 46: ifeq 51\n 49: iconst_0\n 50: ireturn\n 51: iconst_1\n 52: ireturn\n\n public long score(int);\n Code:\n 0: aload_0\n 1: iload_1\n 2: invokestatic #283 // Method Day7$CardHand$DefaultImpls.score:(LDay7$CardHand;I)J\n 5: lreturn\n\n public int compareTo(Day7$CardHand);\n Code:\n 0: aload_0\n 1: aload_1\n 2: invokestatic #289 // Method Day7$CardHand$DefaultImpls.compareTo:(LDay7$CardHand;LDay7$CardHand;)I\n 5: ireturn\n\n public int compareTo(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: checkcast #6 // class Day7$CardHand\n 5: invokevirtual #293 // Method compareTo:(LDay7$CardHand;)I\n 8: ireturn\n\n static {};\n Code:\n 0: new #296 // class Day7$CamelCardHandWithJokers$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #299 // Method Day7$CamelCardHandWithJokers$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #303 // Field Companion:LDay7$CamelCardHandWithJokers$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day7$CardHand$DefaultImpls$compareTo$$inlined$compareBy$1.class", "javap": "Compiled from \"Comparisons.kt\"\npublic final class Day7$CardHand$DefaultImpls$compareTo$$inlined$compareBy$1<T> implements java.util.Comparator {\n public Day7$CardHand$DefaultImpls$compareTo$$inlined$compareBy$1();\n Code:\n 0: aload_0\n 1: invokespecial #16 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final int compare(T, T);\n Code:\n 0: aload_1\n 1: checkcast #23 // class Day7$CardHand\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: invokeinterface #27, 1 // InterfaceMethod Day7$CardHand.getMaxSimilarCards:()I\n 14: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 17: checkcast #35 // class java/lang/Comparable\n 20: aload_2\n 21: checkcast #23 // class Day7$CardHand\n 24: astore_3\n 25: astore 5\n 27: iconst_0\n 28: istore 4\n 30: aload_3\n 31: invokeinterface #27, 1 // InterfaceMethod Day7$CardHand.getMaxSimilarCards:()I\n 36: invokestatic #33 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 39: checkcast #35 // class java/lang/Comparable\n 42: aload 5\n 44: swap\n 45: invokestatic #41 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I\n 48: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day13.kt
import kotlin.String import kotlin.collections.List object Day13 { private const val NORMAL_MULTIPLIER = 100 private const val TRANSPOSED_MULTIPLIER = 1 fun part1(input: List<String>): String { val grids = parseGrids(input) return grids.sumOf { grid -> // Transposed is actually columns val transposedGrid = transpose(grid) scoreExact(grid, NORMAL_MULTIPLIER) + scoreExact(transposedGrid, TRANSPOSED_MULTIPLIER) }.toString() } private fun scoreExact(grid: List<String>, multiplier: Int): Int { return findLinesOfExactness(grid).find { isMirror(it, grid) }?.let { // Normal is rows, so rows above val rowsAbove = it.first + 1 return rowsAbove * multiplier } ?: 0 } private fun isMirror(it: Pair<Int, Int>, grid: List<String>): Boolean { val (a, b) = it if (a < 0 || b >= grid.size) { return true } return grid[a] == grid[b] && isMirror(a - 1 to b + 1, grid) } /** * Return the rows in which there is a line of exactness */ private fun findLinesOfExactness(grid: List<String>): List<Pair<Int, Int>> { return grid.withIndex().zipWithNext().filter { (a, b) -> a.value == b.value } .map { (a, b) -> a.index to b.index } } fun transpose(grid: List<String>): List<String> { val transposedGrid = List(grid[0].length) { CharArray(grid.size) } for (i in grid.indices) { for (j in grid[0].indices) { transposedGrid[j][i] = grid[i][j] } } return transposedGrid.map { it.joinToString("") } } private fun parseGrids(input: List<String>): List<List<String>> { val emptyIndexes = listOf(-1) + input.withIndex().filter { (_, b) -> b.isBlank() }.map { (i, _) -> i } + listOf(input.size) return emptyIndexes.zipWithNext().map { (a, b) -> input.subList(a + 1, b) } } fun part2(input: List<String>): String { val grids = parseGrids(input) return grids.sumOf { grid -> // Transposed is actually columns val transposedGrid = transpose(grid) scoreSmudged(grid, NORMAL_MULTIPLIER) + scoreSmudged(transposedGrid, TRANSPOSED_MULTIPLIER) }.toString() } private fun scoreSmudged(grid: List<String>, multiplier: Int): Int { val rowsOfMaybeExactness = findLinesOfExactness(grid) + findLinesOffByOne(grid) return rowsOfMaybeExactness.find { isAlmostMirror(it, grid, 0) }?.let { // Normal is rows, so rows above val rowsAbove = it.first + 1 rowsAbove * multiplier } ?: 0 } private fun findLinesOffByOne(grid: List<String>): List<Pair<Int, Int>> { return grid.withIndex().zipWithNext().filter { (a, b) -> isOffByOne(a.value, b.value) } .map { (a, b) -> a.index to b.index } } private fun isAlmostMirror(it: Pair<Int, Int>, grid: List<String>, offByOneCount: Int): Boolean { if (offByOneCount > 1) { return false } val (a, b) = it if (a < 0 || b >= grid.size) { return offByOneCount == 1 } val offByOne = isOffByOne(grid[a], grid[b]) val offByMoreThanOne = !offByOne && grid[a] != grid[b] if (offByMoreThanOne) { return false } val newCount = if (offByOne) { offByOneCount + 1 } else { offByOneCount } return isAlmostMirror(a - 1 to b + 1, grid, newCount) } private fun isOffByOne(a: String, b: String): Boolean { return a.toCharArray().zip(b.toCharArray()) .count { (a, b) -> a != b } == 1 } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day13.class", "javap": "Compiled from \"Day13.kt\"\npublic final class Day13 {\n public static final Day13 INSTANCE;\n\n private static final int NORMAL_MULTIPLIER;\n\n private static final int TRANSPOSED_MULTIPLIER;\n\n private Day13();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method parseGrids:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_2\n 13: checkcast #28 // class java/lang/Iterable\n 16: astore_3\n 17: iconst_0\n 18: istore 4\n 20: aload_3\n 21: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 26: astore 5\n 28: aload 5\n 30: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 35: ifeq 103\n 38: aload 5\n 40: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 45: astore 6\n 47: iload 4\n 49: aload 6\n 51: checkcast #44 // class java/util/List\n 54: astore 7\n 56: istore 10\n 58: iconst_0\n 59: istore 8\n 61: getstatic #47 // Field INSTANCE:LDay13;\n 64: aload 7\n 66: invokevirtual #50 // Method transpose:(Ljava/util/List;)Ljava/util/List;\n 69: astore 9\n 71: getstatic #47 // Field INSTANCE:LDay13;\n 74: aload 7\n 76: bipush 100\n 78: invokespecial #54 // Method scoreExact:(Ljava/util/List;I)I\n 81: getstatic #47 // Field INSTANCE:LDay13;\n 84: aload 9\n 86: iconst_1\n 87: invokespecial #54 // Method scoreExact:(Ljava/util/List;I)I\n 90: iadd\n 91: istore 11\n 93: iload 10\n 95: iload 11\n 97: iadd\n 98: istore 4\n 100: goto 28\n 103: iload 4\n 105: invokestatic #60 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 108: areturn\n\n private final int scoreExact(java.util.List<java.lang.String>, int);\n Code:\n 0: aload_0\n 1: aload_1\n 2: invokespecial #70 // Method findLinesOfExactness:(Ljava/util/List;)Ljava/util/List;\n 5: checkcast #28 // class java/lang/Iterable\n 8: astore 4\n 10: aload 4\n 12: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 17: astore 5\n 19: aload 5\n 21: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 26: ifeq 65\n 29: aload 5\n 31: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 36: astore 6\n 38: aload 6\n 40: checkcast #72 // class kotlin/Pair\n 43: astore 7\n 45: iconst_0\n 46: istore 8\n 48: getstatic #47 // Field INSTANCE:LDay13;\n 51: aload 7\n 53: aload_1\n 54: invokespecial #76 // Method isMirror:(Lkotlin/Pair;Ljava/util/List;)Z\n 57: ifeq 19\n 60: aload 6\n 62: goto 66\n 65: aconst_null\n 66: checkcast #72 // class kotlin/Pair\n 69: astore_3\n 70: aload_3\n 71: ifnull 100\n 74: aload_3\n 75: astore 5\n 77: iconst_0\n 78: istore 6\n 80: aload 5\n 82: invokevirtual #79 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 85: checkcast #81 // class java/lang/Number\n 88: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 91: iconst_1\n 92: iadd\n 93: istore 7\n 95: iload 7\n 97: iload_2\n 98: imul\n 99: ireturn\n 100: iconst_0\n 101: ireturn\n\n private final boolean isMirror(kotlin.Pair<java.lang.Integer, java.lang.Integer>, java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 4: checkcast #81 // class java/lang/Number\n 7: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 10: istore_3\n 11: aload_1\n 12: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 15: checkcast #81 // class java/lang/Number\n 18: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 21: istore 4\n 23: iload_3\n 24: iflt 38\n 27: iload 4\n 29: aload_2\n 30: invokeinterface #101, 1 // InterfaceMethod java/util/List.size:()I\n 35: if_icmplt 40\n 38: iconst_1\n 39: ireturn\n 40: aload_2\n 41: iload_3\n 42: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 47: aload_2\n 48: iload 4\n 50: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 55: invokestatic #109 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 58: ifeq 89\n 61: aload_0\n 62: iload_3\n 63: iconst_1\n 64: isub\n 65: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 68: iload 4\n 70: iconst_1\n 71: iadd\n 72: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 75: invokestatic #120 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 78: aload_2\n 79: invokespecial #76 // Method isMirror:(Lkotlin/Pair;Ljava/util/List;)Z\n 82: ifeq 89\n 85: iconst_1\n 86: goto 90\n 89: iconst_0\n 90: ireturn\n\n private final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> findLinesOfExactness(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #28 // class java/lang/Iterable\n 4: invokestatic #129 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 7: invokestatic #133 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 10: checkcast #28 // class java/lang/Iterable\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: astore 4\n 19: new #135 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #136 // Method java/util/ArrayList.\"<init>\":()V\n 26: checkcast #138 // class java/util/Collection\n 29: astore 5\n 31: iconst_0\n 32: istore 6\n 34: aload 4\n 36: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 7\n 43: aload 7\n 45: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 121\n 53: aload 7\n 55: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 8\n 62: aload 8\n 64: checkcast #72 // class kotlin/Pair\n 67: astore 9\n 69: iconst_0\n 70: istore 10\n 72: aload 9\n 74: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 77: checkcast #140 // class kotlin/collections/IndexedValue\n 80: astore 11\n 82: aload 9\n 84: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 87: checkcast #140 // class kotlin/collections/IndexedValue\n 90: astore 12\n 92: aload 11\n 94: invokevirtual #143 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 97: aload 12\n 99: invokevirtual #143 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 102: invokestatic #109 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 105: ifeq 43\n 108: aload 5\n 110: aload 8\n 112: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 117: pop\n 118: goto 43\n 121: aload 5\n 123: checkcast #44 // class java/util/List\n 126: nop\n 127: checkcast #28 // class java/lang/Iterable\n 130: astore_2\n 131: nop\n 132: iconst_0\n 133: istore_3\n 134: aload_2\n 135: astore 4\n 137: new #135 // class java/util/ArrayList\n 140: dup\n 141: aload_2\n 142: bipush 10\n 144: invokestatic #151 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 147: invokespecial #154 // Method java/util/ArrayList.\"<init>\":(I)V\n 150: checkcast #138 // class java/util/Collection\n 153: astore 5\n 155: iconst_0\n 156: istore 6\n 158: aload 4\n 160: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 165: astore 7\n 167: aload 7\n 169: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 174: ifeq 251\n 177: aload 7\n 179: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 184: astore 8\n 186: aload 5\n 188: aload 8\n 190: checkcast #72 // class kotlin/Pair\n 193: astore 9\n 195: astore 13\n 197: iconst_0\n 198: istore 10\n 200: aload 9\n 202: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 205: checkcast #140 // class kotlin/collections/IndexedValue\n 208: astore 11\n 210: aload 9\n 212: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 215: checkcast #140 // class kotlin/collections/IndexedValue\n 218: astore 12\n 220: aload 11\n 222: invokevirtual #157 // Method kotlin/collections/IndexedValue.getIndex:()I\n 225: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 228: aload 12\n 230: invokevirtual #157 // Method kotlin/collections/IndexedValue.getIndex:()I\n 233: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 236: invokestatic #120 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 239: aload 13\n 241: swap\n 242: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 247: pop\n 248: goto 167\n 251: aload 5\n 253: checkcast #44 // class java/util/List\n 256: nop\n 257: areturn\n\n public final java.util.List<java.lang.String> transpose(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #176 // String grid\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: iconst_0\n 8: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #56 // class java/lang/String\n 16: invokevirtual #179 // Method java/lang/String.length:()I\n 19: istore_3\n 20: new #135 // class java/util/ArrayList\n 23: dup\n 24: iload_3\n 25: invokespecial #154 // Method java/util/ArrayList.\"<init>\":(I)V\n 28: astore 4\n 30: iconst_0\n 31: istore 5\n 33: iload 5\n 35: iload_3\n 36: if_icmpge 75\n 39: iload 5\n 41: istore 6\n 43: aload 4\n 45: iload 6\n 47: istore 7\n 49: astore 12\n 51: iconst_0\n 52: istore 8\n 54: aload_1\n 55: invokeinterface #101, 1 // InterfaceMethod java/util/List.size:()I\n 60: newarray char\n 62: aload 12\n 64: swap\n 65: invokevirtual #180 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 68: pop\n 69: iinc 5, 1\n 72: goto 33\n 75: aload 4\n 77: checkcast #44 // class java/util/List\n 80: astore_2\n 81: iconst_0\n 82: istore_3\n 83: aload_1\n 84: checkcast #138 // class java/util/Collection\n 87: invokeinterface #181, 1 // InterfaceMethod java/util/Collection.size:()I\n 92: istore 4\n 94: iload_3\n 95: iload 4\n 97: if_icmpge 167\n 100: iconst_0\n 101: istore 5\n 103: aload_1\n 104: iconst_0\n 105: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 110: checkcast #183 // class java/lang/CharSequence\n 113: invokeinterface #184, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 118: istore 6\n 120: iload 5\n 122: iload 6\n 124: if_icmpge 161\n 127: aload_2\n 128: iload 5\n 130: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 135: checkcast #186 // class \"[C\"\n 138: iload_3\n 139: aload_1\n 140: iload_3\n 141: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 146: checkcast #56 // class java/lang/String\n 149: iload 5\n 151: invokevirtual #190 // Method java/lang/String.charAt:(I)C\n 154: castore\n 155: iinc 5, 1\n 158: goto 120\n 161: iinc 3, 1\n 164: goto 94\n 167: aload_2\n 168: checkcast #28 // class java/lang/Iterable\n 171: astore_3\n 172: iconst_0\n 173: istore 4\n 175: aload_3\n 176: astore 5\n 178: new #135 // class java/util/ArrayList\n 181: dup\n 182: aload_3\n 183: bipush 10\n 185: invokestatic #151 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 188: invokespecial #154 // Method java/util/ArrayList.\"<init>\":(I)V\n 191: checkcast #138 // class java/util/Collection\n 194: astore 6\n 196: iconst_0\n 197: istore 7\n 199: aload 5\n 201: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 206: astore 8\n 208: aload 8\n 210: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 215: ifeq 271\n 218: aload 8\n 220: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 225: astore 9\n 227: aload 6\n 229: aload 9\n 231: checkcast #186 // class \"[C\"\n 234: astore 10\n 236: astore 12\n 238: iconst_0\n 239: istore 11\n 241: aload 10\n 243: ldc #192 // String\n 245: checkcast #183 // class java/lang/CharSequence\n 248: aconst_null\n 249: aconst_null\n 250: iconst_0\n 251: aconst_null\n 252: aconst_null\n 253: bipush 62\n 255: aconst_null\n 256: invokestatic #198 // 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;\n 259: aload 12\n 261: swap\n 262: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 267: pop\n 268: goto 208\n 271: aload 6\n 273: checkcast #44 // class java/util/List\n 276: nop\n 277: areturn\n\n private final java.util.List<java.util.List<java.lang.String>> parseGrids(java.util.List<java.lang.String>);\n Code:\n 0: iconst_m1\n 1: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 4: invokestatic #207 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 7: checkcast #138 // class java/util/Collection\n 10: aload_1\n 11: checkcast #28 // class java/lang/Iterable\n 14: invokestatic #129 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 17: astore_3\n 18: astore 14\n 20: iconst_0\n 21: istore 4\n 23: aload_3\n 24: astore 5\n 26: new #135 // class java/util/ArrayList\n 29: dup\n 30: invokespecial #136 // Method java/util/ArrayList.\"<init>\":()V\n 33: checkcast #138 // class java/util/Collection\n 36: astore 6\n 38: iconst_0\n 39: istore 7\n 41: aload 5\n 43: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 8\n 50: aload 8\n 52: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 113\n 60: aload 8\n 62: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 9\n 69: aload 9\n 71: checkcast #140 // class kotlin/collections/IndexedValue\n 74: astore 10\n 76: iconst_0\n 77: istore 11\n 79: aload 10\n 81: invokevirtual #208 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 84: checkcast #56 // class java/lang/String\n 87: astore 12\n 89: aload 12\n 91: checkcast #183 // class java/lang/CharSequence\n 94: invokestatic #214 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z\n 97: ifeq 50\n 100: aload 6\n 102: aload 9\n 104: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 109: pop\n 110: goto 50\n 113: aload 6\n 115: checkcast #44 // class java/util/List\n 118: nop\n 119: aload 14\n 121: swap\n 122: checkcast #28 // class java/lang/Iterable\n 125: astore_3\n 126: astore 14\n 128: iconst_0\n 129: istore 4\n 131: aload_3\n 132: astore 5\n 134: new #135 // class java/util/ArrayList\n 137: dup\n 138: aload_3\n 139: bipush 10\n 141: invokestatic #151 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 144: invokespecial #154 // Method java/util/ArrayList.\"<init>\":(I)V\n 147: checkcast #138 // class java/util/Collection\n 150: astore 6\n 152: iconst_0\n 153: istore 7\n 155: aload 5\n 157: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 162: astore 8\n 164: aload 8\n 166: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 171: ifeq 221\n 174: aload 8\n 176: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 181: astore 9\n 183: aload 6\n 185: aload 9\n 187: checkcast #140 // class kotlin/collections/IndexedValue\n 190: astore 10\n 192: astore 15\n 194: iconst_0\n 195: istore 11\n 197: aload 10\n 199: invokevirtual #216 // Method kotlin/collections/IndexedValue.component1:()I\n 202: istore 12\n 204: iload 12\n 206: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 209: aload 15\n 211: swap\n 212: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 217: pop\n 218: goto 164\n 221: aload 6\n 223: checkcast #44 // class java/util/List\n 226: nop\n 227: aload 14\n 229: swap\n 230: checkcast #28 // class java/lang/Iterable\n 233: invokestatic #220 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 236: checkcast #138 // class java/util/Collection\n 239: aload_1\n 240: invokeinterface #101, 1 // InterfaceMethod java/util/List.size:()I\n 245: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 248: invokestatic #207 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 251: checkcast #28 // class java/lang/Iterable\n 254: invokestatic #220 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 257: astore_2\n 258: aload_2\n 259: checkcast #28 // class java/lang/Iterable\n 262: invokestatic #133 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 265: checkcast #28 // class java/lang/Iterable\n 268: astore_3\n 269: iconst_0\n 270: istore 4\n 272: aload_3\n 273: astore 5\n 275: new #135 // class java/util/ArrayList\n 278: dup\n 279: aload_3\n 280: bipush 10\n 282: invokestatic #151 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 285: invokespecial #154 // Method java/util/ArrayList.\"<init>\":(I)V\n 288: checkcast #138 // class java/util/Collection\n 291: astore 6\n 293: iconst_0\n 294: istore 7\n 296: aload 5\n 298: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 303: astore 8\n 305: aload 8\n 307: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 312: ifeq 388\n 315: aload 8\n 317: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 322: astore 9\n 324: aload 6\n 326: aload 9\n 328: checkcast #72 // class kotlin/Pair\n 331: astore 10\n 333: astore 14\n 335: iconst_0\n 336: istore 11\n 338: aload 10\n 340: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 343: checkcast #81 // class java/lang/Number\n 346: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 349: istore 12\n 351: aload 10\n 353: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 356: checkcast #81 // class java/lang/Number\n 359: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 362: istore 13\n 364: aload_1\n 365: iload 12\n 367: iconst_1\n 368: iadd\n 369: iload 13\n 371: invokeinterface #224, 3 // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;\n 376: aload 14\n 378: swap\n 379: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 384: pop\n 385: goto 305\n 388: aload 6\n 390: checkcast #44 // class java/util/List\n 393: nop\n 394: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method parseGrids:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_2\n 13: checkcast #28 // class java/lang/Iterable\n 16: astore_3\n 17: iconst_0\n 18: istore 4\n 20: aload_3\n 21: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 26: astore 5\n 28: aload 5\n 30: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 35: ifeq 103\n 38: aload 5\n 40: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 45: astore 6\n 47: iload 4\n 49: aload 6\n 51: checkcast #44 // class java/util/List\n 54: astore 7\n 56: istore 10\n 58: iconst_0\n 59: istore 8\n 61: getstatic #47 // Field INSTANCE:LDay13;\n 64: aload 7\n 66: invokevirtual #50 // Method transpose:(Ljava/util/List;)Ljava/util/List;\n 69: astore 9\n 71: getstatic #47 // Field INSTANCE:LDay13;\n 74: aload 7\n 76: bipush 100\n 78: invokespecial #233 // Method scoreSmudged:(Ljava/util/List;I)I\n 81: getstatic #47 // Field INSTANCE:LDay13;\n 84: aload 9\n 86: iconst_1\n 87: invokespecial #233 // Method scoreSmudged:(Ljava/util/List;I)I\n 90: iadd\n 91: istore 11\n 93: iload 10\n 95: iload 11\n 97: iadd\n 98: istore 4\n 100: goto 28\n 103: iload 4\n 105: invokestatic #60 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 108: areturn\n\n private final int scoreSmudged(java.util.List<java.lang.String>, int);\n Code:\n 0: aload_0\n 1: aload_1\n 2: invokespecial #70 // Method findLinesOfExactness:(Ljava/util/List;)Ljava/util/List;\n 5: checkcast #138 // class java/util/Collection\n 8: aload_0\n 9: aload_1\n 10: invokespecial #237 // Method findLinesOffByOne:(Ljava/util/List;)Ljava/util/List;\n 13: checkcast #28 // class java/lang/Iterable\n 16: invokestatic #220 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 19: astore_3\n 20: aload_3\n 21: checkcast #28 // class java/lang/Iterable\n 24: astore 4\n 26: aload 4\n 28: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 33: astore 5\n 35: aload 5\n 37: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 42: ifeq 82\n 45: aload 5\n 47: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 52: astore 6\n 54: aload 6\n 56: checkcast #72 // class kotlin/Pair\n 59: astore 7\n 61: iconst_0\n 62: istore 8\n 64: getstatic #47 // Field INSTANCE:LDay13;\n 67: aload 7\n 69: aload_1\n 70: iconst_0\n 71: invokespecial #241 // Method isAlmostMirror:(Lkotlin/Pair;Ljava/util/List;I)Z\n 74: ifeq 35\n 77: aload 6\n 79: goto 83\n 82: aconst_null\n 83: checkcast #72 // class kotlin/Pair\n 86: dup\n 87: ifnull 118\n 90: astore 5\n 92: iconst_0\n 93: istore 6\n 95: aload 5\n 97: invokevirtual #79 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 100: checkcast #81 // class java/lang/Number\n 103: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 106: iconst_1\n 107: iadd\n 108: istore 7\n 110: iload 7\n 112: iload_2\n 113: imul\n 114: nop\n 115: goto 120\n 118: pop\n 119: iconst_0\n 120: ireturn\n\n private final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> findLinesOffByOne(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #28 // class java/lang/Iterable\n 4: invokestatic #129 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;\n 7: invokestatic #133 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 10: checkcast #28 // class java/lang/Iterable\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: astore 4\n 19: new #135 // class java/util/ArrayList\n 22: dup\n 23: invokespecial #136 // Method java/util/ArrayList.\"<init>\":()V\n 26: checkcast #138 // class java/util/Collection\n 29: astore 5\n 31: iconst_0\n 32: istore 6\n 34: aload 4\n 36: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 7\n 43: aload 7\n 45: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 130\n 53: aload 7\n 55: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 8\n 62: aload 8\n 64: checkcast #72 // class kotlin/Pair\n 67: astore 9\n 69: iconst_0\n 70: istore 10\n 72: aload 9\n 74: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 77: checkcast #140 // class kotlin/collections/IndexedValue\n 80: astore 11\n 82: aload 9\n 84: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 87: checkcast #140 // class kotlin/collections/IndexedValue\n 90: astore 12\n 92: getstatic #47 // Field INSTANCE:LDay13;\n 95: aload 11\n 97: invokevirtual #143 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 100: checkcast #56 // class java/lang/String\n 103: aload 12\n 105: invokevirtual #143 // Method kotlin/collections/IndexedValue.getValue:()Ljava/lang/Object;\n 108: checkcast #56 // class java/lang/String\n 111: invokespecial #248 // Method isOffByOne:(Ljava/lang/String;Ljava/lang/String;)Z\n 114: ifeq 43\n 117: aload 5\n 119: aload 8\n 121: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 126: pop\n 127: goto 43\n 130: aload 5\n 132: checkcast #44 // class java/util/List\n 135: nop\n 136: checkcast #28 // class java/lang/Iterable\n 139: astore_2\n 140: nop\n 141: iconst_0\n 142: istore_3\n 143: aload_2\n 144: astore 4\n 146: new #135 // class java/util/ArrayList\n 149: dup\n 150: aload_2\n 151: bipush 10\n 153: invokestatic #151 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 156: invokespecial #154 // Method java/util/ArrayList.\"<init>\":(I)V\n 159: checkcast #138 // class java/util/Collection\n 162: astore 5\n 164: iconst_0\n 165: istore 6\n 167: aload 4\n 169: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 174: astore 7\n 176: aload 7\n 178: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 183: ifeq 260\n 186: aload 7\n 188: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 193: astore 8\n 195: aload 5\n 197: aload 8\n 199: checkcast #72 // class kotlin/Pair\n 202: astore 9\n 204: astore 13\n 206: iconst_0\n 207: istore 10\n 209: aload 9\n 211: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 214: checkcast #140 // class kotlin/collections/IndexedValue\n 217: astore 11\n 219: aload 9\n 221: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 224: checkcast #140 // class kotlin/collections/IndexedValue\n 227: astore 12\n 229: aload 11\n 231: invokevirtual #157 // Method kotlin/collections/IndexedValue.getIndex:()I\n 234: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 237: aload 12\n 239: invokevirtual #157 // Method kotlin/collections/IndexedValue.getIndex:()I\n 242: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 245: invokestatic #120 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 248: aload 13\n 250: swap\n 251: invokeinterface #147, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 256: pop\n 257: goto 176\n 260: aload 5\n 262: checkcast #44 // class java/util/List\n 265: nop\n 266: areturn\n\n private final boolean isAlmostMirror(kotlin.Pair<java.lang.Integer, java.lang.Integer>, java.util.List<java.lang.String>, int);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: if_icmple 7\n 5: iconst_0\n 6: ireturn\n 7: aload_1\n 8: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 11: checkcast #81 // class java/lang/Number\n 14: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 17: istore 4\n 19: aload_1\n 20: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 23: checkcast #81 // class java/lang/Number\n 26: invokevirtual #85 // Method java/lang/Number.intValue:()I\n 29: istore 5\n 31: iload 4\n 33: iflt 47\n 36: iload 5\n 38: aload_2\n 39: invokeinterface #101, 1 // InterfaceMethod java/util/List.size:()I\n 44: if_icmplt 58\n 47: iload_3\n 48: iconst_1\n 49: if_icmpne 56\n 52: iconst_1\n 53: goto 57\n 56: iconst_0\n 57: ireturn\n 58: aload_0\n 59: aload_2\n 60: iload 4\n 62: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 67: checkcast #56 // class java/lang/String\n 70: aload_2\n 71: iload 5\n 73: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 78: checkcast #56 // class java/lang/String\n 81: invokespecial #248 // Method isOffByOne:(Ljava/lang/String;Ljava/lang/String;)Z\n 84: istore 6\n 86: iload 6\n 88: ifne 117\n 91: aload_2\n 92: iload 4\n 94: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 99: aload_2\n 100: iload 5\n 102: invokeinterface #105, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 107: invokestatic #109 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 110: ifne 117\n 113: iconst_1\n 114: goto 118\n 117: iconst_0\n 118: istore 7\n 120: iload 7\n 122: ifeq 127\n 125: iconst_0\n 126: ireturn\n 127: iload 6\n 129: ifeq 138\n 132: iload_3\n 133: iconst_1\n 134: iadd\n 135: goto 139\n 138: iload_3\n 139: istore 8\n 141: aload_0\n 142: iload 4\n 144: iconst_1\n 145: isub\n 146: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 149: iload 5\n 151: iconst_1\n 152: iadd\n 153: invokestatic #114 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 156: invokestatic #120 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 159: aload_2\n 160: iload 8\n 162: invokespecial #241 // Method isAlmostMirror:(Lkotlin/Pair;Ljava/util/List;I)Z\n 165: ireturn\n\n private final boolean isOffByOne(java.lang.String, java.lang.String);\n Code:\n 0: aload_1\n 1: invokevirtual #260 // Method java/lang/String.toCharArray:()[C\n 4: dup\n 5: ldc_w #262 // String toCharArray(...)\n 8: invokestatic #265 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 11: aload_2\n 12: invokevirtual #260 // Method java/lang/String.toCharArray:()[C\n 15: dup\n 16: ldc_w #262 // String toCharArray(...)\n 19: invokestatic #265 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 22: invokestatic #269 // Method kotlin/collections/ArraysKt.zip:([C[C)Ljava/util/List;\n 25: checkcast #28 // class java/lang/Iterable\n 28: astore_3\n 29: nop\n 30: iconst_0\n 31: istore 4\n 33: aload_3\n 34: instanceof #138 // class java/util/Collection\n 37: ifeq 56\n 40: aload_3\n 41: checkcast #138 // class java/util/Collection\n 44: invokeinterface #272, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 49: ifeq 56\n 52: iconst_0\n 53: goto 153\n 56: iconst_0\n 57: istore 5\n 59: aload_3\n 60: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 65: astore 6\n 67: aload 6\n 69: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 74: ifeq 151\n 77: aload 6\n 79: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 84: astore 7\n 86: aload 7\n 88: checkcast #72 // class kotlin/Pair\n 91: astore 8\n 93: iconst_0\n 94: istore 9\n 96: aload 8\n 98: invokevirtual #95 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 101: checkcast #274 // class java/lang/Character\n 104: invokevirtual #278 // Method java/lang/Character.charValue:()C\n 107: istore 10\n 109: aload 8\n 111: invokevirtual #98 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 114: checkcast #274 // class java/lang/Character\n 117: invokevirtual #278 // Method java/lang/Character.charValue:()C\n 120: istore 11\n 122: iload 10\n 124: iload 11\n 126: if_icmpeq 133\n 129: iconst_1\n 130: goto 134\n 133: iconst_0\n 134: ifeq 67\n 137: iinc 5, 1\n 140: iload 5\n 142: ifge 67\n 145: invokestatic #281 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 148: goto 67\n 151: iload 5\n 153: iconst_1\n 154: if_icmpne 161\n 157: iconst_1\n 158: goto 162\n 161: iconst_0\n 162: ireturn\n\n static {};\n Code:\n 0: new #2 // class Day13\n 3: dup\n 4: invokespecial #289 // Method \"<init>\":()V\n 7: putstatic #47 // Field INSTANCE:LDay13;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day23.kt
import kotlin.String import kotlin.collections.List import Day17.Coordinate import java.util.* import kotlin.math.max object Day23 { /** * A more compact representation of a path than a list of coordinates. */ data class Segment(val steps: Int, val start: Coordinate, val end: Coordinate) fun part1(input: List<String>): String { val startIndex = input[0].indexOf(".") val endIndex = input.last().indexOf(".") val startCoordinate = Coordinate(startIndex, 0) val endCoordinate = Coordinate(endIndex, input.size - 1) return maxSteps(startCoordinate, startCoordinate, endCoordinate, input, 0).toString() } data class StepInformation( val node: Segment, val visited: Set<Segment>, val steps: Int ) private fun maxStepsExpanded( start: Segment, end: Segment, nodes: Set<Segment>, input: List<String> ): Int { val queue = PriorityQueue<StepInformation> { a, b -> -a.steps.compareTo(b.steps) } queue.add(StepInformation(start, setOf(start), start.steps)) val startMap = nodes.associate { it.start to it } val endMap = nodes.associate { it.end to it } val nodeBeforeExit = getNeighbors(end.start, input).map { it.first }.filter { it in endMap } .map { endMap[it] }.filterNotNull().distinct().first() var max = 0 var count = 0 val startMemo = mutableMapOf<Segment, List<Segment>>() val endMemo = mutableMapOf<Segment, List<Segment>>() while (queue.isNotEmpty()) { count++ if (count % 1000000 == 0) { println("Count: $count, queue size: ${queue.size}, current max: $max") } val stepInformation = queue.poll() val node = stepInformation.node val steps = stepInformation.steps val visited = stepInformation.visited if (node == end) { max = max(steps, max) continue } if (nodeBeforeExit in visited) { continue } val startNeighbors = startMemo.getOrPut(node) { getNeighbors(node.start, input).map { it.first }.filter { it in endMap } .map { endMap[it]!! } }.filter { it !in visited } val endNeighbors = endMemo.getOrPut(node) { getNeighbors(node.end, input).map { it.first }.filter { it in startMap } .map { startMap[it]!! } }.filter { it !in visited } queue.addAll( (startNeighbors + endNeighbors).distinct() .map { StepInformation(it, visited + node, steps + it.steps) }) } return max } private tailrec fun maxSteps( previousCoordinate: Coordinate, currentCoordinate: Coordinate, endCoordinate: Coordinate, input: List<String>, currentSteps: Int ): Int { if (currentCoordinate == endCoordinate) { return currentSteps } val nextCoordinates = getNeighborsDirectionally(previousCoordinate, currentCoordinate, input) val nextOpenSpace = nextCoordinates.find { it.second == '.' } if (nextOpenSpace != null) { return maxSteps( currentCoordinate, nextOpenSpace.first, endCoordinate, input, currentSteps + 1 ) } return nextCoordinates.maxOf { maxSteps(currentCoordinate, it.first, endCoordinate, input, currentSteps + 1) } } fun part2(input: List<String>): String { val startIndex = input[0].indexOf(".") val endIndex = input.last().indexOf(".") val startCoordinate = Coordinate(startIndex, 0) val endCoordinate = Coordinate(endIndex, input.size - 1) val nodes = buildSegments(startCoordinate, endCoordinate, input, 0) val start = nodes.find { it.start == startCoordinate } return maxStepsExpanded(start!!, nodes.find { it.end == endCoordinate }!!, nodes, input).toString() } data class SegmentBuildingInformation( val coordinate: Coordinate, val previousCoordinate: Coordinate, val steps: Int, val runningSegment: Segment ) private fun buildSegments( startCoordinate: Coordinate, endCoordinate: Coordinate, input: List<String>, length: Int ): Set<Segment> { val queue = ArrayDeque<SegmentBuildingInformation>() queue.add( SegmentBuildingInformation( startCoordinate, startCoordinate, length, Segment(length, startCoordinate, startCoordinate) ) ) val segments = mutableSetOf<Segment>() while (queue.isNotEmpty()) { val stepInformation = queue.poll() val currentCoordinate = stepInformation.coordinate val previousCoordinate = stepInformation.previousCoordinate val length = stepInformation.steps val runningNode = stepInformation.runningSegment if (currentCoordinate == endCoordinate) { val updatedNode = runningNode.copy(end = endCoordinate, steps = length) if (updatedNode !in segments) { segments.add(updatedNode) } } val nextCoordinates = getNeighborsDirectionally(previousCoordinate, currentCoordinate, input) val nextOpenSpace = nextCoordinates.find { it.second == '.' } if (nextOpenSpace != null) { val currentCharacter = input[currentCoordinate.y][currentCoordinate.x] // We have to treat >, < etc as their own segment because otherwise we can lead to duplicate counting if (currentCharacter != '.') { val updatedNode = runningNode.copy(end = currentCoordinate, steps = length) if (updatedNode !in segments) { segments.add(updatedNode) } queue.addFirst( SegmentBuildingInformation( nextOpenSpace.first, currentCoordinate, 1, Segment(1, nextOpenSpace.first, nextOpenSpace.first) ) ) } else { queue.addFirst(SegmentBuildingInformation(nextOpenSpace.first, currentCoordinate, length + 1, runningNode)) } } else { val updatedNode = runningNode.copy(end = currentCoordinate, steps = length) if (updatedNode !in segments) { segments.add(updatedNode) } val neighbors = nextCoordinates.map { SegmentBuildingInformation( it.first, currentCoordinate, 1, Segment(1, it.first, it.first) ) } for (nextNeighbor in neighbors) { queue.addFirst(nextNeighbor) } } } return segments } fun getNeighborsDirectionally( previousCoordinate: Coordinate, currentCoordinate: Coordinate, input: List<String> ): List<Pair<Coordinate, Char>> { val left = currentCoordinate.copy(x = currentCoordinate.x - 1) val right = currentCoordinate.copy(x = currentCoordinate.x + 1) val up = currentCoordinate.copy(y = currentCoordinate.y - 1) val down = currentCoordinate.copy(y = currentCoordinate.y + 1) val nextCoordinates = getNeighbors(currentCoordinate, input) .filter { it.first != previousCoordinate } .filter { if (it.first == left) { it.second != '>' } else if (it.first == right) { it.second != '<' } else if (it.first == up) { it.second != 'v' } else if (it.first == down) { it.second != '^' } else { throw Exception("Unknown direction") } } return nextCoordinates } fun getNeighbors(currentCoordinate: Coordinate, input: List<String>): List<Pair<Coordinate, Char>> { val left = currentCoordinate.copy(x = currentCoordinate.x - 1) val right = currentCoordinate.copy(x = currentCoordinate.x + 1) val up = currentCoordinate.copy(y = currentCoordinate.y - 1) val down = currentCoordinate.copy(y = currentCoordinate.y + 1) val nextCoordinates = listOf( left, right, up, down ).filter { it.x >= 0 && it.x < input[0].length && it.y >= 0 && it.y < input.size } .map { it to input[it.y][it.x] } .filter { it.second != '#' } return nextCoordinates } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day23$StepInformation.class", "javap": "Compiled from \"Day23.kt\"\npublic final class Day23$StepInformation {\n private final Day23$Segment node;\n\n private final java.util.Set<Day23$Segment> visited;\n\n private final int steps;\n\n public Day23$StepInformation(Day23$Segment, java.util.Set<Day23$Segment>, int);\n Code:\n 0: aload_1\n 1: ldc #10 // String node\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String visited\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #24 // Field node:LDay23$Segment;\n 21: aload_0\n 22: aload_2\n 23: putfield #27 // Field visited:Ljava/util/Set;\n 26: aload_0\n 27: iload_3\n 28: putfield #31 // Field steps:I\n 31: return\n\n public final Day23$Segment getNode();\n Code:\n 0: aload_0\n 1: getfield #24 // Field node:LDay23$Segment;\n 4: areturn\n\n public final java.util.Set<Day23$Segment> getVisited();\n Code:\n 0: aload_0\n 1: getfield #27 // Field visited:Ljava/util/Set;\n 4: areturn\n\n public final int getSteps();\n Code:\n 0: aload_0\n 1: getfield #31 // Field steps:I\n 4: ireturn\n\n public final Day23$Segment component1();\n Code:\n 0: aload_0\n 1: getfield #24 // Field node:LDay23$Segment;\n 4: areturn\n\n public final java.util.Set<Day23$Segment> component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field visited:Ljava/util/Set;\n 4: areturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #31 // Field steps:I\n 4: ireturn\n\n public final Day23$StepInformation copy(Day23$Segment, java.util.Set<Day23$Segment>, int);\n Code:\n 0: aload_1\n 1: ldc #10 // String node\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String visited\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day23$StepInformation\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: iload_3\n 19: invokespecial #48 // Method \"<init>\":(LDay23$Segment;Ljava/util/Set;I)V\n 22: areturn\n\n public static Day23$StepInformation copy$default(Day23$StepInformation, Day23$Segment, java.util.Set, int, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #24 // Field node:LDay23$Segment;\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field visited:Ljava/util/Set;\n 23: astore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #31 // Field steps:I\n 35: istore_3\n 36: aload_0\n 37: aload_1\n 38: aload_2\n 39: iload_3\n 40: invokevirtual #52 // Method copy:(LDay23$Segment;Ljava/util/Set;I)LDay23$StepInformation;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #56 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #57 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #59 // String StepInformation(node=\n 9: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #24 // Field node:LDay23$Segment;\n 16: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #68 // String , visited=\n 21: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field visited:Ljava/util/Set;\n 28: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #70 // String , steps=\n 33: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #31 // Field steps:I\n 40: invokevirtual #73 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #76 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #78 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #24 // Field node:LDay23$Segment;\n 4: invokevirtual #83 // Method Day23$Segment.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field visited:Ljava/util/Set;\n 16: invokevirtual #84 // Method java/lang/Object.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #31 // Field steps:I\n 29: invokestatic #89 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day23$StepInformation\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day23$StepInformation\n 20: astore_2\n 21: aload_0\n 22: getfield #24 // Field node:LDay23$Segment;\n 25: aload_2\n 26: getfield #24 // Field node:LDay23$Segment;\n 29: invokestatic #97 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field visited:Ljava/util/Set;\n 41: aload_2\n 42: getfield #27 // Field visited:Ljava/util/Set;\n 45: invokestatic #97 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #31 // Field steps:I\n 57: aload_2\n 58: getfield #31 // Field steps:I\n 61: if_icmpeq 66\n 64: iconst_0\n 65: ireturn\n 66: iconst_1\n 67: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day23$Segment.class", "javap": "Compiled from \"Day23.kt\"\npublic final class Day23$Segment {\n private final int steps;\n\n private final Day17$Coordinate start;\n\n private final Day17$Coordinate end;\n\n public Day23$Segment(int, Day17$Coordinate, Day17$Coordinate);\n Code:\n 0: aload_2\n 1: ldc #9 // String start\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: ldc #17 // String end\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: iload_1\n 18: putfield #24 // Field steps:I\n 21: aload_0\n 22: aload_2\n 23: putfield #27 // Field start:LDay17$Coordinate;\n 26: aload_0\n 27: aload_3\n 28: putfield #29 // Field end:LDay17$Coordinate;\n 31: return\n\n public final int getSteps();\n Code:\n 0: aload_0\n 1: getfield #24 // Field steps:I\n 4: ireturn\n\n public final Day17$Coordinate getStart();\n Code:\n 0: aload_0\n 1: getfield #27 // Field start:LDay17$Coordinate;\n 4: areturn\n\n public final Day17$Coordinate getEnd();\n Code:\n 0: aload_0\n 1: getfield #29 // Field end:LDay17$Coordinate;\n 4: areturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #24 // Field steps:I\n 4: ireturn\n\n public final Day17$Coordinate component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field start:LDay17$Coordinate;\n 4: areturn\n\n public final Day17$Coordinate component3();\n Code:\n 0: aload_0\n 1: getfield #29 // Field end:LDay17$Coordinate;\n 4: areturn\n\n public final Day23$Segment copy(int, Day17$Coordinate, Day17$Coordinate);\n Code:\n 0: aload_2\n 1: ldc #9 // String start\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: ldc #17 // String end\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day23$Segment\n 15: dup\n 16: iload_1\n 17: aload_2\n 18: aload_3\n 19: invokespecial #43 // Method \"<init>\":(ILDay17$Coordinate;LDay17$Coordinate;)V\n 22: areturn\n\n public static Day23$Segment copy$default(Day23$Segment, int, Day17$Coordinate, Day17$Coordinate, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #24 // Field steps:I\n 11: istore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field start:LDay17$Coordinate;\n 23: astore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #29 // Field end:LDay17$Coordinate;\n 35: astore_3\n 36: aload_0\n 37: iload_1\n 38: aload_2\n 39: aload_3\n 40: invokevirtual #47 // Method copy:(ILDay17$Coordinate;LDay17$Coordinate;)LDay23$Segment;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #51 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #52 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #54 // String Segment(steps=\n 9: invokevirtual #58 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #24 // Field steps:I\n 16: invokevirtual #61 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #63 // String , start=\n 21: invokevirtual #58 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field start:LDay17$Coordinate;\n 28: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #68 // String , end=\n 33: invokevirtual #58 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #29 // Field end:LDay17$Coordinate;\n 40: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #71 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #73 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #24 // Field steps:I\n 4: invokestatic #79 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field start:LDay17$Coordinate;\n 16: invokevirtual #83 // Method Day17$Coordinate.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #29 // Field end:LDay17$Coordinate;\n 29: invokevirtual #83 // Method Day17$Coordinate.hashCode:()I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day23$Segment\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day23$Segment\n 20: astore_2\n 21: aload_0\n 22: getfield #24 // Field steps:I\n 25: aload_2\n 26: getfield #24 // Field steps:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #27 // Field start:LDay17$Coordinate;\n 38: aload_2\n 39: getfield #27 // Field start:LDay17$Coordinate;\n 42: invokestatic #91 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: aload_0\n 51: getfield #29 // Field end:LDay17$Coordinate;\n 54: aload_2\n 55: getfield #29 // Field end:LDay17$Coordinate;\n 58: invokestatic #91 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 61: ifne 66\n 64: iconst_0\n 65: ireturn\n 66: iconst_1\n 67: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day23.class", "javap": "Compiled from \"Day23.kt\"\npublic final class Day23 {\n public static final Day23 INSTANCE;\n\n private Day23();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: iconst_0\n 8: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #30 // class java/lang/CharSequence\n 16: ldc #32 // String .\n 18: iconst_0\n 19: iconst_0\n 20: bipush 6\n 22: aconst_null\n 23: invokestatic #38 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 26: istore_2\n 27: aload_1\n 28: invokestatic #44 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 31: checkcast #30 // class java/lang/CharSequence\n 34: ldc #32 // String .\n 36: iconst_0\n 37: iconst_0\n 38: bipush 6\n 40: aconst_null\n 41: invokestatic #38 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 44: istore_3\n 45: new #46 // class Day17$Coordinate\n 48: dup\n 49: iload_2\n 50: iconst_0\n 51: invokespecial #49 // Method Day17$Coordinate.\"<init>\":(II)V\n 54: astore 4\n 56: new #46 // class Day17$Coordinate\n 59: dup\n 60: iload_3\n 61: aload_1\n 62: invokeinterface #53, 1 // InterfaceMethod java/util/List.size:()I\n 67: iconst_1\n 68: isub\n 69: invokespecial #49 // Method Day17$Coordinate.\"<init>\":(II)V\n 72: astore 5\n 74: aload_0\n 75: aload 4\n 77: aload 4\n 79: aload 5\n 81: aload_1\n 82: iconst_0\n 83: invokespecial #57 // Method maxSteps:(LDay17$Coordinate;LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;I)I\n 86: invokestatic #63 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 89: areturn\n\n private final int maxStepsExpanded(Day23$Segment, Day23$Segment, java.util.Set<Day23$Segment>, java.util.List<java.lang.String>);\n Code:\n 0: new #75 // class java/util/PriorityQueue\n 3: dup\n 4: invokedynamic #95, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;\n 9: invokedynamic #106, 0 // InvokeDynamic #1:compare:(Lkotlin/jvm/functions/Function2;)Ljava/util/Comparator;\n 14: invokespecial #109 // Method java/util/PriorityQueue.\"<init>\":(Ljava/util/Comparator;)V\n 17: astore 5\n 19: aload 5\n 21: new #111 // class Day23$StepInformation\n 24: dup\n 25: aload_1\n 26: aload_1\n 27: invokestatic #117 // Method kotlin/collections/SetsKt.setOf:(Ljava/lang/Object;)Ljava/util/Set;\n 30: aload_1\n 31: invokevirtual #122 // Method Day23$Segment.getSteps:()I\n 34: invokespecial #125 // Method Day23$StepInformation.\"<init>\":(LDay23$Segment;Ljava/util/Set;I)V\n 37: invokevirtual #129 // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z\n 40: pop\n 41: aload_3\n 42: checkcast #131 // class java/lang/Iterable\n 45: astore 7\n 47: iconst_0\n 48: istore 8\n 50: aload 7\n 52: bipush 10\n 54: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 57: invokestatic #141 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 60: bipush 16\n 62: invokestatic #147 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 65: istore 9\n 67: aload 7\n 69: astore 10\n 71: new #149 // class java/util/LinkedHashMap\n 74: dup\n 75: iload 9\n 77: invokespecial #152 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 80: checkcast #154 // class java/util/Map\n 83: astore 11\n 85: iconst_0\n 86: istore 12\n 88: aload 10\n 90: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 95: astore 13\n 97: aload 13\n 99: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 104: ifeq 163\n 107: aload 13\n 109: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 114: astore 14\n 116: aload 11\n 118: astore 15\n 120: aload 14\n 122: checkcast #119 // class Day23$Segment\n 125: astore 16\n 127: iconst_0\n 128: istore 17\n 130: aload 16\n 132: invokevirtual #172 // Method Day23$Segment.getStart:()LDay17$Coordinate;\n 135: aload 16\n 137: invokestatic #178 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 140: astore 16\n 142: aload 15\n 144: aload 16\n 146: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 149: aload 16\n 151: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 154: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 159: pop\n 160: goto 97\n 163: aload 11\n 165: nop\n 166: astore 6\n 168: aload_3\n 169: checkcast #131 // class java/lang/Iterable\n 172: astore 8\n 174: iconst_0\n 175: istore 9\n 177: aload 8\n 179: bipush 10\n 181: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 184: invokestatic #141 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 187: bipush 16\n 189: invokestatic #147 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 192: istore 10\n 194: aload 8\n 196: astore 11\n 198: new #149 // class java/util/LinkedHashMap\n 201: dup\n 202: iload 10\n 204: invokespecial #152 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 207: checkcast #154 // class java/util/Map\n 210: astore 12\n 212: iconst_0\n 213: istore 13\n 215: aload 11\n 217: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 222: astore 14\n 224: aload 14\n 226: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 231: ifeq 290\n 234: aload 14\n 236: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 241: astore 15\n 243: aload 12\n 245: astore 16\n 247: aload 15\n 249: checkcast #119 // class Day23$Segment\n 252: astore 17\n 254: iconst_0\n 255: istore 18\n 257: aload 17\n 259: invokevirtual #192 // Method Day23$Segment.getEnd:()LDay17$Coordinate;\n 262: aload 17\n 264: invokestatic #178 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 267: astore 17\n 269: aload 16\n 271: aload 17\n 273: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 276: aload 17\n 278: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 281: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 286: pop\n 287: goto 224\n 290: aload 12\n 292: nop\n 293: astore 7\n 295: aload_0\n 296: aload_2\n 297: invokevirtual #172 // Method Day23$Segment.getStart:()LDay17$Coordinate;\n 300: aload 4\n 302: invokevirtual #196 // Method getNeighbors:(LDay17$Coordinate;Ljava/util/List;)Ljava/util/List;\n 305: checkcast #131 // class java/lang/Iterable\n 308: astore 9\n 310: iconst_0\n 311: istore 10\n 313: aload 9\n 315: astore 11\n 317: new #198 // class java/util/ArrayList\n 320: dup\n 321: aload 9\n 323: bipush 10\n 325: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 328: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 331: checkcast #201 // class java/util/Collection\n 334: astore 12\n 336: iconst_0\n 337: istore 13\n 339: aload 11\n 341: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 346: astore 14\n 348: aload 14\n 350: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 355: ifeq 401\n 358: aload 14\n 360: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 365: astore 15\n 367: aload 12\n 369: aload 15\n 371: checkcast #180 // class kotlin/Pair\n 374: astore 16\n 376: astore 34\n 378: iconst_0\n 379: istore 17\n 381: aload 16\n 383: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 386: checkcast #46 // class Day17$Coordinate\n 389: aload 34\n 391: swap\n 392: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 397: pop\n 398: goto 348\n 401: aload 12\n 403: checkcast #24 // class java/util/List\n 406: nop\n 407: checkcast #131 // class java/lang/Iterable\n 410: astore 9\n 412: nop\n 413: iconst_0\n 414: istore 10\n 416: aload 9\n 418: astore 11\n 420: new #198 // class java/util/ArrayList\n 423: dup\n 424: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 427: checkcast #201 // class java/util/Collection\n 430: astore 12\n 432: iconst_0\n 433: istore 13\n 435: aload 11\n 437: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 442: astore 14\n 444: aload 14\n 446: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 451: ifeq 499\n 454: aload 14\n 456: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 461: astore 15\n 463: aload 15\n 465: checkcast #46 // class Day17$Coordinate\n 468: astore 16\n 470: iconst_0\n 471: istore 17\n 473: aload 7\n 475: aload 16\n 477: invokeinterface #206, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 482: nop\n 483: ifeq 444\n 486: aload 12\n 488: aload 15\n 490: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 495: pop\n 496: goto 444\n 499: aload 12\n 501: checkcast #24 // class java/util/List\n 504: nop\n 505: checkcast #131 // class java/lang/Iterable\n 508: astore 9\n 510: nop\n 511: iconst_0\n 512: istore 10\n 514: aload 9\n 516: astore 11\n 518: new #198 // class java/util/ArrayList\n 521: dup\n 522: aload 9\n 524: bipush 10\n 526: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 529: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 532: checkcast #201 // class java/util/Collection\n 535: astore 12\n 537: iconst_0\n 538: istore 13\n 540: aload 11\n 542: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 547: astore 14\n 549: aload 14\n 551: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 556: ifeq 606\n 559: aload 14\n 561: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 566: astore 15\n 568: aload 12\n 570: aload 15\n 572: checkcast #46 // class Day17$Coordinate\n 575: astore 16\n 577: astore 34\n 579: iconst_0\n 580: istore 17\n 582: aload 7\n 584: aload 16\n 586: invokeinterface #209, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 591: checkcast #119 // class Day23$Segment\n 594: aload 34\n 596: swap\n 597: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 602: pop\n 603: goto 549\n 606: aload 12\n 608: checkcast #24 // class java/util/List\n 611: nop\n 612: checkcast #131 // class java/lang/Iterable\n 615: invokestatic #213 // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;\n 618: checkcast #131 // class java/lang/Iterable\n 621: invokestatic #216 // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;\n 624: invokestatic #219 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 627: checkcast #119 // class Day23$Segment\n 630: astore 8\n 632: iconst_0\n 633: istore 9\n 635: iconst_0\n 636: istore 10\n 638: new #149 // class java/util/LinkedHashMap\n 641: dup\n 642: invokespecial #220 // Method java/util/LinkedHashMap.\"<init>\":()V\n 645: checkcast #154 // class java/util/Map\n 648: astore 11\n 650: new #149 // class java/util/LinkedHashMap\n 653: dup\n 654: invokespecial #220 // Method java/util/LinkedHashMap.\"<init>\":()V\n 657: checkcast #154 // class java/util/Map\n 660: astore 12\n 662: aload 5\n 664: checkcast #201 // class java/util/Collection\n 667: invokeinterface #223, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 672: ifne 679\n 675: iconst_1\n 676: goto 680\n 679: iconst_0\n 680: ifeq 1925\n 683: iinc 10, 1\n 686: iload 10\n 688: ldc #224 // int 1000000\n 690: irem\n 691: ifne 744\n 694: new #226 // class java/lang/StringBuilder\n 697: dup\n 698: invokespecial #227 // Method java/lang/StringBuilder.\"<init>\":()V\n 701: ldc #229 // String Count:\n 703: invokevirtual #233 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 706: iload 10\n 708: invokevirtual #236 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 711: ldc #238 // String , queue size:\n 713: invokevirtual #233 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 716: aload 5\n 718: invokevirtual #239 // Method java/util/PriorityQueue.size:()I\n 721: invokevirtual #236 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 724: ldc #241 // String , current max:\n 726: invokevirtual #233 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 729: iload 9\n 731: invokevirtual #236 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 734: invokevirtual #245 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 737: getstatic #251 // Field java/lang/System.out:Ljava/io/PrintStream;\n 740: swap\n 741: invokevirtual #257 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 744: aload 5\n 746: invokevirtual #260 // Method java/util/PriorityQueue.poll:()Ljava/lang/Object;\n 749: checkcast #111 // class Day23$StepInformation\n 752: astore 13\n 754: aload 13\n 756: invokevirtual #264 // Method Day23$StepInformation.getNode:()LDay23$Segment;\n 759: astore 14\n 761: aload 13\n 763: invokevirtual #265 // Method Day23$StepInformation.getSteps:()I\n 766: istore 15\n 768: aload 13\n 770: invokevirtual #269 // Method Day23$StepInformation.getVisited:()Ljava/util/Set;\n 773: astore 16\n 775: aload 14\n 777: aload_2\n 778: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 781: ifeq 796\n 784: iload 15\n 786: iload 9\n 788: invokestatic #278 // Method java/lang/Math.max:(II)I\n 791: istore 9\n 793: goto 662\n 796: aload 16\n 798: aload 8\n 800: invokeinterface #283, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 805: ifeq 811\n 808: goto 662\n 811: aload 11\n 813: astore 18\n 815: iconst_0\n 816: istore 19\n 818: aload 18\n 820: aload 14\n 822: invokeinterface #209, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 827: astore 20\n 829: aload 20\n 831: ifnonnull 1181\n 834: iconst_0\n 835: istore 21\n 837: getstatic #286 // Field INSTANCE:LDay23;\n 840: aload 14\n 842: invokevirtual #172 // Method Day23$Segment.getStart:()LDay17$Coordinate;\n 845: aload 4\n 847: invokevirtual #196 // Method getNeighbors:(LDay17$Coordinate;Ljava/util/List;)Ljava/util/List;\n 850: checkcast #131 // class java/lang/Iterable\n 853: astore 22\n 855: iconst_0\n 856: istore 23\n 858: aload 22\n 860: astore 24\n 862: new #198 // class java/util/ArrayList\n 865: dup\n 866: aload 22\n 868: bipush 10\n 870: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 873: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 876: checkcast #201 // class java/util/Collection\n 879: astore 25\n 881: iconst_0\n 882: istore 26\n 884: aload 24\n 886: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 891: astore 27\n 893: aload 27\n 895: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 900: ifeq 946\n 903: aload 27\n 905: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 910: astore 28\n 912: aload 25\n 914: aload 28\n 916: checkcast #180 // class kotlin/Pair\n 919: astore 29\n 921: astore 30\n 923: iconst_0\n 924: istore 31\n 926: aload 29\n 928: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 931: checkcast #46 // class Day17$Coordinate\n 934: aload 30\n 936: swap\n 937: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 942: pop\n 943: goto 893\n 946: aload 25\n 948: checkcast #24 // class java/util/List\n 951: nop\n 952: checkcast #131 // class java/lang/Iterable\n 955: astore 22\n 957: nop\n 958: iconst_0\n 959: istore 23\n 961: aload 22\n 963: astore 24\n 965: new #198 // class java/util/ArrayList\n 968: dup\n 969: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 972: checkcast #201 // class java/util/Collection\n 975: astore 25\n 977: iconst_0\n 978: istore 26\n 980: aload 24\n 982: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 987: astore 27\n 989: aload 27\n 991: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 996: ifeq 1044\n 999: aload 27\n 1001: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1006: astore 28\n 1008: aload 28\n 1010: checkcast #46 // class Day17$Coordinate\n 1013: astore 29\n 1015: iconst_0\n 1016: istore 31\n 1018: aload 7\n 1020: aload 29\n 1022: invokeinterface #206, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 1027: nop\n 1028: ifeq 989\n 1031: aload 25\n 1033: aload 28\n 1035: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1040: pop\n 1041: goto 989\n 1044: aload 25\n 1046: checkcast #24 // class java/util/List\n 1049: nop\n 1050: checkcast #131 // class java/lang/Iterable\n 1053: astore 22\n 1055: nop\n 1056: iconst_0\n 1057: istore 23\n 1059: aload 22\n 1061: astore 24\n 1063: new #198 // class java/util/ArrayList\n 1066: dup\n 1067: aload 22\n 1069: bipush 10\n 1071: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1074: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 1077: checkcast #201 // class java/util/Collection\n 1080: astore 25\n 1082: iconst_0\n 1083: istore 26\n 1085: aload 24\n 1087: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1092: astore 27\n 1094: aload 27\n 1096: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1101: ifeq 1155\n 1104: aload 27\n 1106: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1111: astore 28\n 1113: aload 25\n 1115: aload 28\n 1117: checkcast #46 // class Day17$Coordinate\n 1120: astore 29\n 1122: astore 30\n 1124: iconst_0\n 1125: istore 31\n 1127: aload 7\n 1129: aload 29\n 1131: invokeinterface #209, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 1136: dup\n 1137: invokestatic #289 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 1140: checkcast #119 // class Day23$Segment\n 1143: aload 30\n 1145: swap\n 1146: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1151: pop\n 1152: goto 1094\n 1155: aload 25\n 1157: checkcast #24 // class java/util/List\n 1160: nop\n 1161: nop\n 1162: astore 32\n 1164: aload 18\n 1166: aload 14\n 1168: aload 32\n 1170: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1175: pop\n 1176: aload 32\n 1178: goto 1183\n 1181: aload 20\n 1183: nop\n 1184: checkcast #131 // class java/lang/Iterable\n 1187: astore 18\n 1189: nop\n 1190: iconst_0\n 1191: istore 19\n 1193: aload 18\n 1195: astore 20\n 1197: new #198 // class java/util/ArrayList\n 1200: dup\n 1201: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 1204: checkcast #201 // class java/util/Collection\n 1207: astore 21\n 1209: iconst_0\n 1210: istore 22\n 1212: aload 20\n 1214: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1219: astore 23\n 1221: aload 23\n 1223: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1228: ifeq 1283\n 1231: aload 23\n 1233: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1238: astore 24\n 1240: aload 24\n 1242: checkcast #119 // class Day23$Segment\n 1245: astore 25\n 1247: iconst_0\n 1248: istore 26\n 1250: aload 16\n 1252: aload 25\n 1254: invokeinterface #283, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1259: ifne 1266\n 1262: iconst_1\n 1263: goto 1267\n 1266: iconst_0\n 1267: ifeq 1221\n 1270: aload 21\n 1272: aload 24\n 1274: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1279: pop\n 1280: goto 1221\n 1283: aload 21\n 1285: checkcast #24 // class java/util/List\n 1288: nop\n 1289: astore 17\n 1291: aload 12\n 1293: astore 19\n 1295: iconst_0\n 1296: istore 20\n 1298: aload 19\n 1300: aload 14\n 1302: invokeinterface #209, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 1307: astore 21\n 1309: aload 21\n 1311: ifnonnull 1661\n 1314: iconst_0\n 1315: istore 22\n 1317: getstatic #286 // Field INSTANCE:LDay23;\n 1320: aload 14\n 1322: invokevirtual #192 // Method Day23$Segment.getEnd:()LDay17$Coordinate;\n 1325: aload 4\n 1327: invokevirtual #196 // Method getNeighbors:(LDay17$Coordinate;Ljava/util/List;)Ljava/util/List;\n 1330: checkcast #131 // class java/lang/Iterable\n 1333: astore 23\n 1335: iconst_0\n 1336: istore 24\n 1338: aload 23\n 1340: astore 25\n 1342: new #198 // class java/util/ArrayList\n 1345: dup\n 1346: aload 23\n 1348: bipush 10\n 1350: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1353: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 1356: checkcast #201 // class java/util/Collection\n 1359: astore 26\n 1361: iconst_0\n 1362: istore 27\n 1364: aload 25\n 1366: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1371: astore 28\n 1373: aload 28\n 1375: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1380: ifeq 1426\n 1383: aload 28\n 1385: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1390: astore 29\n 1392: aload 26\n 1394: aload 29\n 1396: checkcast #180 // class kotlin/Pair\n 1399: astore 30\n 1401: astore 31\n 1403: iconst_0\n 1404: istore 32\n 1406: aload 30\n 1408: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 1411: checkcast #46 // class Day17$Coordinate\n 1414: aload 31\n 1416: swap\n 1417: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1422: pop\n 1423: goto 1373\n 1426: aload 26\n 1428: checkcast #24 // class java/util/List\n 1431: nop\n 1432: checkcast #131 // class java/lang/Iterable\n 1435: astore 23\n 1437: nop\n 1438: iconst_0\n 1439: istore 24\n 1441: aload 23\n 1443: astore 25\n 1445: new #198 // class java/util/ArrayList\n 1448: dup\n 1449: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 1452: checkcast #201 // class java/util/Collection\n 1455: astore 26\n 1457: iconst_0\n 1458: istore 27\n 1460: aload 25\n 1462: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1467: astore 28\n 1469: aload 28\n 1471: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1476: ifeq 1524\n 1479: aload 28\n 1481: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1486: astore 29\n 1488: aload 29\n 1490: checkcast #46 // class Day17$Coordinate\n 1493: astore 30\n 1495: iconst_0\n 1496: istore 32\n 1498: aload 6\n 1500: aload 30\n 1502: invokeinterface #206, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 1507: nop\n 1508: ifeq 1469\n 1511: aload 26\n 1513: aload 29\n 1515: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1520: pop\n 1521: goto 1469\n 1524: aload 26\n 1526: checkcast #24 // class java/util/List\n 1529: nop\n 1530: checkcast #131 // class java/lang/Iterable\n 1533: astore 23\n 1535: nop\n 1536: iconst_0\n 1537: istore 24\n 1539: aload 23\n 1541: astore 25\n 1543: new #198 // class java/util/ArrayList\n 1546: dup\n 1547: aload 23\n 1549: bipush 10\n 1551: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1554: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 1557: checkcast #201 // class java/util/Collection\n 1560: astore 26\n 1562: iconst_0\n 1563: istore 27\n 1565: aload 25\n 1567: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1572: astore 28\n 1574: aload 28\n 1576: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1581: ifeq 1635\n 1584: aload 28\n 1586: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1591: astore 29\n 1593: aload 26\n 1595: aload 29\n 1597: checkcast #46 // class Day17$Coordinate\n 1600: astore 30\n 1602: astore 31\n 1604: iconst_0\n 1605: istore 32\n 1607: aload 6\n 1609: aload 30\n 1611: invokeinterface #209, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 1616: dup\n 1617: invokestatic #289 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 1620: checkcast #119 // class Day23$Segment\n 1623: aload 31\n 1625: swap\n 1626: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1631: pop\n 1632: goto 1574\n 1635: aload 26\n 1637: checkcast #24 // class java/util/List\n 1640: nop\n 1641: nop\n 1642: astore 33\n 1644: aload 19\n 1646: aload 14\n 1648: aload 33\n 1650: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1655: pop\n 1656: aload 33\n 1658: goto 1663\n 1661: aload 21\n 1663: nop\n 1664: checkcast #131 // class java/lang/Iterable\n 1667: astore 19\n 1669: nop\n 1670: iconst_0\n 1671: istore 20\n 1673: aload 19\n 1675: astore 21\n 1677: new #198 // class java/util/ArrayList\n 1680: dup\n 1681: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 1684: checkcast #201 // class java/util/Collection\n 1687: astore 22\n 1689: iconst_0\n 1690: istore 23\n 1692: aload 21\n 1694: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1699: astore 24\n 1701: aload 24\n 1703: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1708: ifeq 1763\n 1711: aload 24\n 1713: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1718: astore 25\n 1720: aload 25\n 1722: checkcast #119 // class Day23$Segment\n 1725: astore 26\n 1727: iconst_0\n 1728: istore 27\n 1730: aload 16\n 1732: aload 26\n 1734: invokeinterface #283, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 1739: ifne 1746\n 1742: iconst_1\n 1743: goto 1747\n 1746: iconst_0\n 1747: ifeq 1701\n 1750: aload 22\n 1752: aload 25\n 1754: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1759: pop\n 1760: goto 1701\n 1763: aload 22\n 1765: checkcast #24 // class java/util/List\n 1768: nop\n 1769: astore 18\n 1771: aload 5\n 1773: aload 17\n 1775: checkcast #201 // class java/util/Collection\n 1778: aload 18\n 1780: checkcast #131 // class java/lang/Iterable\n 1783: invokestatic #293 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 1786: checkcast #131 // class java/lang/Iterable\n 1789: invokestatic #216 // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;\n 1792: checkcast #131 // class java/lang/Iterable\n 1795: astore 19\n 1797: astore 34\n 1799: iconst_0\n 1800: istore 20\n 1802: aload 19\n 1804: astore 21\n 1806: new #198 // class java/util/ArrayList\n 1809: dup\n 1810: aload 19\n 1812: bipush 10\n 1814: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1817: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 1820: checkcast #201 // class java/util/Collection\n 1823: astore 22\n 1825: iconst_0\n 1826: istore 23\n 1828: aload 21\n 1830: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1835: astore 24\n 1837: aload 24\n 1839: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1844: ifeq 1906\n 1847: aload 24\n 1849: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1854: astore 25\n 1856: aload 22\n 1858: aload 25\n 1860: checkcast #119 // class Day23$Segment\n 1863: astore 26\n 1865: astore 35\n 1867: iconst_0\n 1868: istore 27\n 1870: new #111 // class Day23$StepInformation\n 1873: dup\n 1874: aload 26\n 1876: aload 16\n 1878: aload 14\n 1880: invokestatic #296 // Method kotlin/collections/SetsKt.plus:(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;\n 1883: iload 15\n 1885: aload 26\n 1887: invokevirtual #122 // Method Day23$Segment.getSteps:()I\n 1890: iadd\n 1891: invokespecial #125 // Method Day23$StepInformation.\"<init>\":(LDay23$Segment;Ljava/util/Set;I)V\n 1894: aload 35\n 1896: swap\n 1897: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1902: pop\n 1903: goto 1837\n 1906: aload 22\n 1908: checkcast #24 // class java/util/List\n 1911: nop\n 1912: aload 34\n 1914: swap\n 1915: checkcast #201 // class java/util/Collection\n 1918: invokevirtual #300 // Method java/util/PriorityQueue.addAll:(Ljava/util/Collection;)Z\n 1921: pop\n 1922: goto 662\n 1925: iload 9\n 1927: ireturn\n\n private final int maxSteps(Day17$Coordinate, Day17$Coordinate, Day17$Coordinate, java.util.List<java.lang.String>, int);\n Code:\n 0: aload_0\n 1: astore 6\n 3: aload_2\n 4: aload_3\n 5: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 8: ifeq 14\n 11: iload 5\n 13: ireturn\n 14: aload 6\n 16: aload_1\n 17: aload_2\n 18: aload 4\n 20: invokevirtual #367 // Method getNeighborsDirectionally:(LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;)Ljava/util/List;\n 23: astore 7\n 25: aload 7\n 27: checkcast #131 // class java/lang/Iterable\n 30: astore 10\n 32: aload 10\n 34: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 39: astore 11\n 41: aload 11\n 43: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 48: ifeq 99\n 51: aload 11\n 53: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 58: astore 12\n 60: aload 12\n 62: checkcast #180 // class kotlin/Pair\n 65: astore 13\n 67: iconst_0\n 68: istore 14\n 70: aload 13\n 72: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 75: checkcast #369 // class java/lang/Character\n 78: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 81: bipush 46\n 83: if_icmpne 90\n 86: iconst_1\n 87: goto 91\n 90: iconst_0\n 91: ifeq 41\n 94: aload 12\n 96: goto 100\n 99: aconst_null\n 100: checkcast #180 // class kotlin/Pair\n 103: astore 8\n 105: aload 8\n 107: ifnull 164\n 110: aload 6\n 112: astore 9\n 114: aload_2\n 115: astore 10\n 117: aload 8\n 119: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 122: checkcast #46 // class Day17$Coordinate\n 125: astore 11\n 127: aload_3\n 128: astore 12\n 130: aload 4\n 132: astore 13\n 134: iload 5\n 136: iconst_1\n 137: iadd\n 138: istore 14\n 140: aload 9\n 142: astore 6\n 144: aload 10\n 146: astore_1\n 147: aload 11\n 149: astore_2\n 150: aload 12\n 152: astore_3\n 153: aload 13\n 155: astore 4\n 157: iload 14\n 159: istore 5\n 161: goto 3\n 164: aload 7\n 166: checkcast #131 // class java/lang/Iterable\n 169: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 174: astore 10\n 176: aload 10\n 178: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 183: ifne 194\n 186: new #375 // class java/util/NoSuchElementException\n 189: dup\n 190: invokespecial #376 // Method java/util/NoSuchElementException.\"<init>\":()V\n 193: athrow\n 194: aload 10\n 196: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 201: checkcast #180 // class kotlin/Pair\n 204: astore 11\n 206: iconst_0\n 207: istore 12\n 209: getstatic #286 // Field INSTANCE:LDay23;\n 212: aload_2\n 213: aload 11\n 215: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 218: checkcast #46 // class Day17$Coordinate\n 221: aload_3\n 222: aload 4\n 224: iload 5\n 226: iconst_1\n 227: iadd\n 228: invokespecial #57 // Method maxSteps:(LDay17$Coordinate;LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;I)I\n 231: istore 11\n 233: aload 10\n 235: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 240: ifeq 296\n 243: aload 10\n 245: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 250: checkcast #180 // class kotlin/Pair\n 253: astore 12\n 255: iconst_0\n 256: istore 13\n 258: getstatic #286 // Field INSTANCE:LDay23;\n 261: aload_2\n 262: aload 12\n 264: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 267: checkcast #46 // class Day17$Coordinate\n 270: aload_3\n 271: aload 4\n 273: iload 5\n 275: iconst_1\n 276: iadd\n 277: invokespecial #57 // Method maxSteps:(LDay17$Coordinate;LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;I)I\n 280: istore 12\n 282: iload 11\n 284: iload 12\n 286: if_icmpge 233\n 289: iload 12\n 291: istore 11\n 293: goto 233\n 296: iload 11\n 298: ireturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: iconst_0\n 8: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #30 // class java/lang/CharSequence\n 16: ldc #32 // String .\n 18: iconst_0\n 19: iconst_0\n 20: bipush 6\n 22: aconst_null\n 23: invokestatic #38 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 26: istore_2\n 27: aload_1\n 28: invokestatic #44 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 31: checkcast #30 // class java/lang/CharSequence\n 34: ldc #32 // String .\n 36: iconst_0\n 37: iconst_0\n 38: bipush 6\n 40: aconst_null\n 41: invokestatic #38 // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I\n 44: istore_3\n 45: new #46 // class Day17$Coordinate\n 48: dup\n 49: iload_2\n 50: iconst_0\n 51: invokespecial #49 // Method Day17$Coordinate.\"<init>\":(II)V\n 54: astore 4\n 56: new #46 // class Day17$Coordinate\n 59: dup\n 60: iload_3\n 61: aload_1\n 62: invokeinterface #53, 1 // InterfaceMethod java/util/List.size:()I\n 67: iconst_1\n 68: isub\n 69: invokespecial #49 // Method Day17$Coordinate.\"<init>\":(II)V\n 72: astore 5\n 74: aload_0\n 75: aload 4\n 77: aload 5\n 79: aload_1\n 80: iconst_0\n 81: invokespecial #388 // Method buildSegments:(LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;I)Ljava/util/Set;\n 84: astore 6\n 86: aload 6\n 88: checkcast #131 // class java/lang/Iterable\n 91: astore 9\n 93: aload 9\n 95: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 100: astore 10\n 102: aload 10\n 104: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 109: ifeq 149\n 112: aload 10\n 114: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 119: astore 11\n 121: aload 11\n 123: checkcast #119 // class Day23$Segment\n 126: astore 12\n 128: iconst_0\n 129: istore 13\n 131: aload 12\n 133: invokevirtual #172 // Method Day23$Segment.getStart:()LDay17$Coordinate;\n 136: aload 4\n 138: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 141: ifeq 102\n 144: aload 11\n 146: goto 150\n 149: aconst_null\n 150: checkcast #119 // class Day23$Segment\n 153: astore 7\n 155: aload_0\n 156: aload 7\n 158: dup\n 159: invokestatic #289 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 162: aload 6\n 164: checkcast #131 // class java/lang/Iterable\n 167: astore 8\n 169: astore 15\n 171: astore 14\n 173: aload 8\n 175: astore 9\n 177: aload 9\n 179: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 184: astore 10\n 186: aload 10\n 188: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 193: ifeq 233\n 196: aload 10\n 198: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 203: astore 11\n 205: aload 11\n 207: checkcast #119 // class Day23$Segment\n 210: astore 12\n 212: iconst_0\n 213: istore 13\n 215: aload 12\n 217: invokevirtual #192 // Method Day23$Segment.getEnd:()LDay17$Coordinate;\n 220: aload 5\n 222: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 225: ifeq 186\n 228: aload 11\n 230: goto 234\n 233: aconst_null\n 234: astore 16\n 236: aload 14\n 238: aload 15\n 240: aload 16\n 242: dup\n 243: invokestatic #289 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 246: checkcast #119 // class Day23$Segment\n 249: aload 6\n 251: aload_1\n 252: invokespecial #390 // Method maxStepsExpanded:(LDay23$Segment;LDay23$Segment;Ljava/util/Set;Ljava/util/List;)I\n 255: invokestatic #63 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 258: areturn\n\n private final java.util.Set<Day23$Segment> buildSegments(Day17$Coordinate, Day17$Coordinate, java.util.List<java.lang.String>, int);\n Code:\n 0: new #395 // class java/util/ArrayDeque\n 3: dup\n 4: invokespecial #396 // Method java/util/ArrayDeque.\"<init>\":()V\n 7: astore 5\n 9: aload 5\n 11: new #398 // class Day23$SegmentBuildingInformation\n 14: dup\n 15: aload_1\n 16: aload_1\n 17: iload 4\n 19: new #119 // class Day23$Segment\n 22: dup\n 23: iload 4\n 25: aload_1\n 26: aload_1\n 27: invokespecial #401 // Method Day23$Segment.\"<init>\":(ILDay17$Coordinate;LDay17$Coordinate;)V\n 30: invokespecial #404 // Method Day23$SegmentBuildingInformation.\"<init>\":(LDay17$Coordinate;LDay17$Coordinate;ILDay23$Segment;)V\n 33: invokevirtual #405 // Method java/util/ArrayDeque.add:(Ljava/lang/Object;)Z\n 36: pop\n 37: new #407 // class java/util/LinkedHashSet\n 40: dup\n 41: invokespecial #408 // Method java/util/LinkedHashSet.\"<init>\":()V\n 44: checkcast #280 // class java/util/Set\n 47: astore 6\n 49: aload 5\n 51: checkcast #201 // class java/util/Collection\n 54: invokeinterface #223, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 59: ifne 66\n 62: iconst_1\n 63: goto 67\n 66: iconst_0\n 67: ifeq 614\n 70: aload 5\n 72: invokevirtual #409 // Method java/util/ArrayDeque.poll:()Ljava/lang/Object;\n 75: checkcast #398 // class Day23$SegmentBuildingInformation\n 78: astore 7\n 80: aload 7\n 82: invokevirtual #412 // Method Day23$SegmentBuildingInformation.getCoordinate:()LDay17$Coordinate;\n 85: astore 8\n 87: aload 7\n 89: invokevirtual #415 // Method Day23$SegmentBuildingInformation.getPreviousCoordinate:()LDay17$Coordinate;\n 92: astore 9\n 94: aload 7\n 96: invokevirtual #416 // Method Day23$SegmentBuildingInformation.getSteps:()I\n 99: istore 10\n 101: aload 7\n 103: invokevirtual #419 // Method Day23$SegmentBuildingInformation.getRunningSegment:()LDay23$Segment;\n 106: astore 11\n 108: aload 8\n 110: aload_2\n 111: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 114: ifeq 152\n 117: aload 11\n 119: iload 10\n 121: aconst_null\n 122: aload_2\n 123: iconst_2\n 124: aconst_null\n 125: invokestatic #423 // Method Day23$Segment.copy$default:(LDay23$Segment;ILDay17$Coordinate;LDay17$Coordinate;ILjava/lang/Object;)LDay23$Segment;\n 128: astore 12\n 130: aload 6\n 132: aload 12\n 134: invokeinterface #283, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 139: ifne 152\n 142: aload 6\n 144: aload 12\n 146: invokeinterface #424, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 151: pop\n 152: aload_0\n 153: aload 9\n 155: aload 8\n 157: aload_3\n 158: invokevirtual #367 // Method getNeighborsDirectionally:(LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;)Ljava/util/List;\n 161: astore 12\n 163: aload 12\n 165: checkcast #131 // class java/lang/Iterable\n 168: astore 15\n 170: aload 15\n 172: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 177: astore 16\n 179: aload 16\n 181: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 186: ifeq 237\n 189: aload 16\n 191: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 196: astore 17\n 198: aload 17\n 200: checkcast #180 // class kotlin/Pair\n 203: astore 18\n 205: iconst_0\n 206: istore 19\n 208: aload 18\n 210: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 213: checkcast #369 // class java/lang/Character\n 216: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 219: bipush 46\n 221: if_icmpne 228\n 224: iconst_1\n 225: goto 229\n 228: iconst_0\n 229: ifeq 179\n 232: aload 17\n 234: goto 238\n 237: aconst_null\n 238: checkcast #180 // class kotlin/Pair\n 241: astore 13\n 243: aload 13\n 245: ifnull 396\n 248: aload_3\n 249: aload 8\n 251: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 254: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 259: checkcast #59 // class java/lang/String\n 262: aload 8\n 264: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 267: invokevirtual #434 // Method java/lang/String.charAt:(I)C\n 270: istore 14\n 272: iload 14\n 274: bipush 46\n 276: if_icmpeq 365\n 279: aload 11\n 281: iload 10\n 283: aconst_null\n 284: aload 8\n 286: iconst_2\n 287: aconst_null\n 288: invokestatic #423 // Method Day23$Segment.copy$default:(LDay23$Segment;ILDay17$Coordinate;LDay17$Coordinate;ILjava/lang/Object;)LDay23$Segment;\n 291: astore 15\n 293: aload 6\n 295: aload 15\n 297: invokeinterface #283, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 302: ifne 315\n 305: aload 6\n 307: aload 15\n 309: invokeinterface #424, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 314: pop\n 315: aload 5\n 317: new #398 // class Day23$SegmentBuildingInformation\n 320: dup\n 321: aload 13\n 323: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 326: checkcast #46 // class Day17$Coordinate\n 329: aload 8\n 331: iconst_1\n 332: new #119 // class Day23$Segment\n 335: dup\n 336: iconst_1\n 337: aload 13\n 339: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 342: checkcast #46 // class Day17$Coordinate\n 345: aload 13\n 347: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 350: checkcast #46 // class Day17$Coordinate\n 353: invokespecial #401 // Method Day23$Segment.\"<init>\":(ILDay17$Coordinate;LDay17$Coordinate;)V\n 356: invokespecial #404 // Method Day23$SegmentBuildingInformation.\"<init>\":(LDay17$Coordinate;LDay17$Coordinate;ILDay23$Segment;)V\n 359: invokevirtual #437 // Method java/util/ArrayDeque.addFirst:(Ljava/lang/Object;)V\n 362: goto 49\n 365: aload 5\n 367: new #398 // class Day23$SegmentBuildingInformation\n 370: dup\n 371: aload 13\n 373: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 376: checkcast #46 // class Day17$Coordinate\n 379: aload 8\n 381: iload 10\n 383: iconst_1\n 384: iadd\n 385: aload 11\n 387: invokespecial #404 // Method Day23$SegmentBuildingInformation.\"<init>\":(LDay17$Coordinate;LDay17$Coordinate;ILDay23$Segment;)V\n 390: invokevirtual #437 // Method java/util/ArrayDeque.addFirst:(Ljava/lang/Object;)V\n 393: goto 49\n 396: aload 11\n 398: iload 10\n 400: aconst_null\n 401: aload 8\n 403: iconst_2\n 404: aconst_null\n 405: invokestatic #423 // Method Day23$Segment.copy$default:(LDay23$Segment;ILDay17$Coordinate;LDay17$Coordinate;ILjava/lang/Object;)LDay23$Segment;\n 408: astore 14\n 410: aload 6\n 412: aload 14\n 414: invokeinterface #283, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 419: ifne 432\n 422: aload 6\n 424: aload 14\n 426: invokeinterface #424, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 431: pop\n 432: aload 12\n 434: checkcast #131 // class java/lang/Iterable\n 437: astore 16\n 439: iconst_0\n 440: istore 17\n 442: aload 16\n 444: astore 18\n 446: new #198 // class java/util/ArrayList\n 449: dup\n 450: aload 16\n 452: bipush 10\n 454: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 457: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 460: checkcast #201 // class java/util/Collection\n 463: astore 19\n 465: iconst_0\n 466: istore 20\n 468: aload 18\n 470: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 475: astore 21\n 477: aload 21\n 479: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 484: ifeq 565\n 487: aload 21\n 489: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 494: astore 22\n 496: aload 19\n 498: aload 22\n 500: checkcast #180 // class kotlin/Pair\n 503: astore 23\n 505: astore 25\n 507: iconst_0\n 508: istore 24\n 510: new #398 // class Day23$SegmentBuildingInformation\n 513: dup\n 514: aload 23\n 516: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 519: checkcast #46 // class Day17$Coordinate\n 522: aload 8\n 524: iconst_1\n 525: new #119 // class Day23$Segment\n 528: dup\n 529: iconst_1\n 530: aload 23\n 532: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 535: checkcast #46 // class Day17$Coordinate\n 538: aload 23\n 540: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 543: checkcast #46 // class Day17$Coordinate\n 546: invokespecial #401 // Method Day23$Segment.\"<init>\":(ILDay17$Coordinate;LDay17$Coordinate;)V\n 549: invokespecial #404 // Method Day23$SegmentBuildingInformation.\"<init>\":(LDay17$Coordinate;LDay17$Coordinate;ILDay23$Segment;)V\n 552: nop\n 553: aload 25\n 555: swap\n 556: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 561: pop\n 562: goto 477\n 565: aload 19\n 567: checkcast #24 // class java/util/List\n 570: nop\n 571: astore 15\n 573: aload 15\n 575: invokeinterface #438, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 580: astore 16\n 582: aload 16\n 584: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 589: ifeq 49\n 592: aload 16\n 594: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 599: checkcast #398 // class Day23$SegmentBuildingInformation\n 602: astore 17\n 604: aload 5\n 606: aload 17\n 608: invokevirtual #437 // Method java/util/ArrayDeque.addFirst:(Ljava/lang/Object;)V\n 611: goto 582\n 614: aload 6\n 616: areturn\n\n public final java.util.List<kotlin.Pair<Day17$Coordinate, java.lang.Character>> getNeighborsDirectionally(Day17$Coordinate, Day17$Coordinate, java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc_w #452 // String previousCoordinate\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc_w #453 // String currentCoordinate\n 11: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 14: aload_3\n 15: ldc #16 // String input\n 17: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 20: aload_2\n 21: aload_2\n 22: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 25: iconst_1\n 26: isub\n 27: iconst_0\n 28: iconst_2\n 29: aconst_null\n 30: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 33: astore 4\n 35: aload_2\n 36: aload_2\n 37: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 40: iconst_1\n 41: iadd\n 42: iconst_0\n 43: iconst_2\n 44: aconst_null\n 45: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 48: astore 5\n 50: aload_2\n 51: iconst_0\n 52: aload_2\n 53: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 56: iconst_1\n 57: isub\n 58: iconst_1\n 59: aconst_null\n 60: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 63: astore 6\n 65: aload_2\n 66: iconst_0\n 67: aload_2\n 68: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 71: iconst_1\n 72: iadd\n 73: iconst_1\n 74: aconst_null\n 75: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 78: astore 7\n 80: aload_0\n 81: aload_2\n 82: aload_3\n 83: invokevirtual #196 // Method getNeighbors:(LDay17$Coordinate;Ljava/util/List;)Ljava/util/List;\n 86: checkcast #131 // class java/lang/Iterable\n 89: astore 9\n 91: nop\n 92: iconst_0\n 93: istore 10\n 95: aload 9\n 97: astore 11\n 99: new #198 // class java/util/ArrayList\n 102: dup\n 103: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 106: checkcast #201 // class java/util/Collection\n 109: astore 12\n 111: iconst_0\n 112: istore 13\n 114: aload 11\n 116: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 14\n 123: aload 14\n 125: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifeq 185\n 133: aload 14\n 135: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 140: astore 15\n 142: aload 15\n 144: checkcast #180 // class kotlin/Pair\n 147: astore 16\n 149: iconst_0\n 150: istore 17\n 152: aload 16\n 154: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 157: aload_1\n 158: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 161: ifne 168\n 164: iconst_1\n 165: goto 169\n 168: iconst_0\n 169: ifeq 123\n 172: aload 12\n 174: aload 15\n 176: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 181: pop\n 182: goto 123\n 185: aload 12\n 187: checkcast #24 // class java/util/List\n 190: nop\n 191: checkcast #131 // class java/lang/Iterable\n 194: astore 9\n 196: nop\n 197: iconst_0\n 198: istore 10\n 200: aload 9\n 202: astore 11\n 204: new #198 // class java/util/ArrayList\n 207: dup\n 208: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 211: checkcast #201 // class java/util/Collection\n 214: astore 12\n 216: iconst_0\n 217: istore 13\n 219: aload 11\n 221: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 226: astore 14\n 228: aload 14\n 230: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 235: ifeq 433\n 238: aload 14\n 240: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 245: astore 15\n 247: aload 15\n 249: checkcast #180 // class kotlin/Pair\n 252: astore 16\n 254: iconst_0\n 255: istore 17\n 257: aload 16\n 259: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 262: aload 4\n 264: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 267: ifeq 294\n 270: aload 16\n 272: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 275: checkcast #369 // class java/lang/Character\n 278: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 281: bipush 62\n 283: if_icmpeq 290\n 286: iconst_1\n 287: goto 416\n 290: iconst_0\n 291: goto 416\n 294: aload 16\n 296: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 299: aload 5\n 301: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 304: ifeq 331\n 307: aload 16\n 309: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 312: checkcast #369 // class java/lang/Character\n 315: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 318: bipush 60\n 320: if_icmpeq 327\n 323: iconst_1\n 324: goto 416\n 327: iconst_0\n 328: goto 416\n 331: aload 16\n 333: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 336: aload 6\n 338: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 341: ifeq 368\n 344: aload 16\n 346: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 349: checkcast #369 // class java/lang/Character\n 352: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 355: bipush 118\n 357: if_icmpeq 364\n 360: iconst_1\n 361: goto 416\n 364: iconst_0\n 365: goto 416\n 368: aload 16\n 370: invokevirtual #183 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;\n 373: aload 7\n 375: invokestatic #273 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 378: ifeq 405\n 381: aload 16\n 383: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 386: checkcast #369 // class java/lang/Character\n 389: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 392: bipush 94\n 394: if_icmpeq 401\n 397: iconst_1\n 398: goto 416\n 401: iconst_0\n 402: goto 416\n 405: new #458 // class java/lang/Exception\n 408: dup\n 409: ldc_w #460 // String Unknown direction\n 412: invokespecial #463 // Method java/lang/Exception.\"<init>\":(Ljava/lang/String;)V\n 415: athrow\n 416: nop\n 417: ifeq 228\n 420: aload 12\n 422: aload 15\n 424: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 429: pop\n 430: goto 228\n 433: aload 12\n 435: checkcast #24 // class java/util/List\n 438: nop\n 439: astore 8\n 441: aload 8\n 443: areturn\n\n public final java.util.List<kotlin.Pair<Day17$Coordinate, java.lang.Character>> getNeighbors(Day17$Coordinate, java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc_w #453 // String currentCoordinate\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_2\n 8: ldc #16 // String input\n 10: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 13: aload_1\n 14: aload_1\n 15: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 18: iconst_1\n 19: isub\n 20: iconst_0\n 21: iconst_2\n 22: aconst_null\n 23: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 26: astore_3\n 27: aload_1\n 28: aload_1\n 29: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 32: iconst_1\n 33: iadd\n 34: iconst_0\n 35: iconst_2\n 36: aconst_null\n 37: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 40: astore 4\n 42: aload_1\n 43: iconst_0\n 44: aload_1\n 45: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 48: iconst_1\n 49: isub\n 50: iconst_1\n 51: aconst_null\n 52: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 55: astore 5\n 57: aload_1\n 58: iconst_0\n 59: aload_1\n 60: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 63: iconst_1\n 64: iadd\n 65: iconst_1\n 66: aconst_null\n 67: invokestatic #456 // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;\n 70: astore 6\n 72: iconst_4\n 73: anewarray #46 // class Day17$Coordinate\n 76: astore 8\n 78: aload 8\n 80: iconst_0\n 81: aload_3\n 82: aastore\n 83: aload 8\n 85: iconst_1\n 86: aload 4\n 88: aastore\n 89: aload 8\n 91: iconst_2\n 92: aload 5\n 94: aastore\n 95: aload 8\n 97: iconst_3\n 98: aload 6\n 100: aastore\n 101: aload 8\n 103: invokestatic #474 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 106: checkcast #131 // class java/lang/Iterable\n 109: astore 8\n 111: nop\n 112: iconst_0\n 113: istore 9\n 115: aload 8\n 117: astore 10\n 119: new #198 // class java/util/ArrayList\n 122: dup\n 123: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 126: checkcast #201 // class java/util/Collection\n 129: astore 11\n 131: iconst_0\n 132: istore 12\n 134: aload 10\n 136: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 141: astore 13\n 143: aload 13\n 145: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 150: ifeq 244\n 153: aload 13\n 155: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 160: astore 14\n 162: aload 14\n 164: checkcast #46 // class Day17$Coordinate\n 167: astore 15\n 169: iconst_0\n 170: istore 16\n 172: aload 15\n 174: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 177: iflt 227\n 180: aload 15\n 182: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 185: aload_2\n 186: iconst_0\n 187: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 192: checkcast #59 // class java/lang/String\n 195: invokevirtual #476 // Method java/lang/String.length:()I\n 198: if_icmpge 227\n 201: aload 15\n 203: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 206: iflt 227\n 209: aload 15\n 211: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 214: aload_2\n 215: invokeinterface #53, 1 // InterfaceMethod java/util/List.size:()I\n 220: if_icmpge 227\n 223: iconst_1\n 224: goto 228\n 227: iconst_0\n 228: ifeq 143\n 231: aload 11\n 233: aload 14\n 235: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 240: pop\n 241: goto 143\n 244: aload 11\n 246: checkcast #24 // class java/util/List\n 249: nop\n 250: checkcast #131 // class java/lang/Iterable\n 253: astore 8\n 255: nop\n 256: iconst_0\n 257: istore 9\n 259: aload 8\n 261: astore 10\n 263: new #198 // class java/util/ArrayList\n 266: dup\n 267: aload 8\n 269: bipush 10\n 271: invokestatic #135 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 274: invokespecial #199 // Method java/util/ArrayList.\"<init>\":(I)V\n 277: checkcast #201 // class java/util/Collection\n 280: astore 11\n 282: iconst_0\n 283: istore 12\n 285: aload 10\n 287: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 292: astore 13\n 294: aload 13\n 296: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 301: ifeq 369\n 304: aload 13\n 306: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 311: astore 14\n 313: aload 11\n 315: aload 14\n 317: checkcast #46 // class Day17$Coordinate\n 320: astore 15\n 322: astore 17\n 324: iconst_0\n 325: istore 16\n 327: aload 15\n 329: aload_2\n 330: aload 15\n 332: invokevirtual #427 // Method Day17$Coordinate.getY:()I\n 335: invokeinterface #28, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 340: checkcast #59 // class java/lang/String\n 343: aload 15\n 345: invokevirtual #430 // Method Day17$Coordinate.getX:()I\n 348: invokevirtual #434 // Method java/lang/String.charAt:(I)C\n 351: invokestatic #479 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 354: invokestatic #178 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 357: aload 17\n 359: swap\n 360: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 365: pop\n 366: goto 294\n 369: aload 11\n 371: checkcast #24 // class java/util/List\n 374: nop\n 375: checkcast #131 // class java/lang/Iterable\n 378: astore 8\n 380: nop\n 381: iconst_0\n 382: istore 9\n 384: aload 8\n 386: astore 10\n 388: new #198 // class java/util/ArrayList\n 391: dup\n 392: invokespecial #203 // Method java/util/ArrayList.\"<init>\":()V\n 395: checkcast #201 // class java/util/Collection\n 398: astore 11\n 400: iconst_0\n 401: istore 12\n 403: aload 10\n 405: invokeinterface #158, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 410: astore 13\n 412: aload 13\n 414: invokeinterface #164, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 419: ifeq 478\n 422: aload 13\n 424: invokeinterface #168, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 429: astore 14\n 431: aload 14\n 433: checkcast #180 // class kotlin/Pair\n 436: astore 15\n 438: iconst_0\n 439: istore 16\n 441: aload 15\n 443: invokevirtual #186 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 446: checkcast #369 // class java/lang/Character\n 449: invokevirtual #373 // Method java/lang/Character.charValue:()C\n 452: bipush 35\n 454: if_icmpeq 461\n 457: iconst_1\n 458: goto 462\n 461: iconst_0\n 462: ifeq 412\n 465: aload 11\n 467: aload 14\n 469: invokeinterface #202, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 474: pop\n 475: goto 412\n 478: aload 11\n 480: checkcast #24 // class java/util/List\n 483: nop\n 484: astore 7\n 486: aload 7\n 488: areturn\n\n private static final int maxStepsExpanded$lambda$0(Day23$StepInformation, Day23$StepInformation);\n Code:\n 0: aload_0\n 1: invokevirtual #265 // Method Day23$StepInformation.getSteps:()I\n 4: aload_1\n 5: invokevirtual #265 // Method Day23$StepInformation.getSteps:()I\n 8: invokestatic #484 // Method kotlin/jvm/internal/Intrinsics.compare:(II)I\n 11: ineg\n 12: ireturn\n\n private static final int maxStepsExpanded$lambda$1(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #490, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: checkcast #492 // class java/lang/Number\n 11: invokevirtual #495 // Method java/lang/Number.intValue:()I\n 14: ireturn\n\n static {};\n Code:\n 0: new #2 // class Day23\n 3: dup\n 4: invokespecial #501 // Method \"<init>\":()V\n 7: putstatic #286 // Field INSTANCE:LDay23;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day23$SegmentBuildingInformation.class", "javap": "Compiled from \"Day23.kt\"\npublic final class Day23$SegmentBuildingInformation {\n private final Day17$Coordinate coordinate;\n\n private final Day17$Coordinate previousCoordinate;\n\n private final int steps;\n\n private final Day23$Segment runningSegment;\n\n public Day23$SegmentBuildingInformation(Day17$Coordinate, Day17$Coordinate, int, Day23$Segment);\n Code:\n 0: aload_1\n 1: ldc #9 // String coordinate\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String previousCoordinate\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload 4\n 14: ldc #19 // String runningSegment\n 16: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: aload_0\n 20: invokespecial #22 // Method java/lang/Object.\"<init>\":()V\n 23: aload_0\n 24: aload_1\n 25: putfield #25 // Field coordinate:LDay17$Coordinate;\n 28: aload_0\n 29: aload_2\n 30: putfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 33: aload_0\n 34: iload_3\n 35: putfield #31 // Field steps:I\n 38: aload_0\n 39: aload 4\n 41: putfield #34 // Field runningSegment:LDay23$Segment;\n 44: return\n\n public final Day17$Coordinate getCoordinate();\n Code:\n 0: aload_0\n 1: getfield #25 // Field coordinate:LDay17$Coordinate;\n 4: areturn\n\n public final Day17$Coordinate getPreviousCoordinate();\n Code:\n 0: aload_0\n 1: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 4: areturn\n\n public final int getSteps();\n Code:\n 0: aload_0\n 1: getfield #31 // Field steps:I\n 4: ireturn\n\n public final Day23$Segment getRunningSegment();\n Code:\n 0: aload_0\n 1: getfield #34 // Field runningSegment:LDay23$Segment;\n 4: areturn\n\n public final Day17$Coordinate component1();\n Code:\n 0: aload_0\n 1: getfield #25 // Field coordinate:LDay17$Coordinate;\n 4: areturn\n\n public final Day17$Coordinate component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 4: areturn\n\n public final int component3();\n Code:\n 0: aload_0\n 1: getfield #31 // Field steps:I\n 4: ireturn\n\n public final Day23$Segment component4();\n Code:\n 0: aload_0\n 1: getfield #34 // Field runningSegment:LDay23$Segment;\n 4: areturn\n\n public final Day23$SegmentBuildingInformation copy(Day17$Coordinate, Day17$Coordinate, int, Day23$Segment);\n Code:\n 0: aload_1\n 1: ldc #9 // String coordinate\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #17 // String previousCoordinate\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload 4\n 14: ldc #19 // String runningSegment\n 16: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 19: new #2 // class Day23$SegmentBuildingInformation\n 22: dup\n 23: aload_1\n 24: aload_2\n 25: iload_3\n 26: aload 4\n 28: invokespecial #51 // Method \"<init>\":(LDay17$Coordinate;LDay17$Coordinate;ILDay23$Segment;)V\n 31: areturn\n\n public static Day23$SegmentBuildingInformation copy$default(Day23$SegmentBuildingInformation, Day17$Coordinate, Day17$Coordinate, int, Day23$Segment, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #25 // Field coordinate:LDay17$Coordinate;\n 11: astore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 23: astore_2\n 24: iload 5\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #31 // Field steps:I\n 35: istore_3\n 36: iload 5\n 38: bipush 8\n 40: iand\n 41: ifeq 50\n 44: aload_0\n 45: getfield #34 // Field runningSegment:LDay23$Segment;\n 48: astore 4\n 50: aload_0\n 51: aload_1\n 52: aload_2\n 53: iload_3\n 54: aload 4\n 56: invokevirtual #55 // Method copy:(LDay17$Coordinate;LDay17$Coordinate;ILDay23$Segment;)LDay23$SegmentBuildingInformation;\n 59: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #59 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #60 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #62 // String SegmentBuildingInformation(coordinate=\n 9: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #25 // Field coordinate:LDay17$Coordinate;\n 16: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #71 // String , previousCoordinate=\n 21: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 28: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #73 // String , steps=\n 33: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #31 // Field steps:I\n 40: invokevirtual #76 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 43: ldc #78 // String , runningSegment=\n 45: invokevirtual #66 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 48: aload_0\n 49: getfield #34 // Field runningSegment:LDay23$Segment;\n 52: invokevirtual #69 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 55: bipush 41\n 57: invokevirtual #81 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 60: invokevirtual #83 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 63: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #25 // Field coordinate:LDay17$Coordinate;\n 4: invokevirtual #88 // Method Day17$Coordinate.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 16: invokevirtual #88 // Method Day17$Coordinate.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #31 // Field steps:I\n 29: invokestatic #93 // Method java/lang/Integer.hashCode:(I)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: bipush 31\n 37: imul\n 38: aload_0\n 39: getfield #34 // Field runningSegment:LDay23$Segment;\n 42: invokevirtual #96 // Method Day23$Segment.hashCode:()I\n 45: iadd\n 46: istore_1\n 47: iload_1\n 48: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day23$SegmentBuildingInformation\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day23$SegmentBuildingInformation\n 20: astore_2\n 21: aload_0\n 22: getfield #25 // Field coordinate:LDay17$Coordinate;\n 25: aload_2\n 26: getfield #25 // Field coordinate:LDay17$Coordinate;\n 29: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 41: aload_2\n 42: getfield #27 // Field previousCoordinate:LDay17$Coordinate;\n 45: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #31 // Field steps:I\n 57: aload_2\n 58: getfield #31 // Field steps:I\n 61: if_icmpeq 66\n 64: iconst_0\n 65: ireturn\n 66: aload_0\n 67: getfield #34 // Field runningSegment:LDay23$Segment;\n 70: aload_2\n 71: getfield #34 // Field runningSegment:LDay23$Segment;\n 74: invokestatic #104 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 77: ifne 82\n 80: iconst_0\n 81: ireturn\n 82: iconst_1\n 83: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day8.kt
import kotlin.String import kotlin.collections.List object Day8 { data class Node(var left: Node?, var right: Node?, val key: String) data class DesertMap(val directions: CharArray, val root: Node?) { companion object { fun parse(input: List<String>): DesertMap { val directions = input.first().toCharArray() val nodes = parseNodes(input.drop(2)) val root = nodes.find { it.key == "AAA" } return DesertMap(directions, root) } fun parsePart2(input: List<String>): List<DesertMap> { val directions = input.first().toCharArray() val nodes = parseNodes(input.drop(2)) val roots = nodes.filter { it.key.endsWith("A") } return roots.map { DesertMap(directions, it) } } private fun parseNodes(input: List<String>): List<Node> { val index = mutableMapOf<String, Node>() val nodePattern = "(\\w+) = \\((\\w+), (\\w+)\\)".toRegex() for (line in input) { val (key, left, right) = nodePattern.matchEntire(line)!!.destructured val leftNode = index.getOrPut(left) { Node(null, null, left) } val rightNode = index.getOrPut(right) { Node(null, null, right) } val keyNode = index.getOrPut(key) { Node(null, null, key) } keyNode.left = leftNode keyNode.right = rightNode } return index.values.toList() } } } fun part1(input: List<String>): String { val desertMap = DesertMap.parse(input) return followUntilExit(desertMap.directions, desertMap.root, 0).toString() } private tailrec fun followUntilExit( directions: CharArray, currentNode: Node?, currentSteps: Long, exitCondition: (Node) -> Boolean = { it.key == "ZZZ" } ): Long { if (currentNode == null || exitCondition(currentNode)) { return currentSteps } val nextNode = if (directions.first() == 'L') { currentNode.left } else { currentNode.right } return followUntilExit(directions.rotate(1), nextNode, currentSteps + 1, exitCondition) } fun part2(input: List<String>): String { val desertMaps = DesertMap.parsePart2(input) return followUntilAllExit(desertMaps).toString() } private fun followUntilAllExit(desertMaps: List<DesertMap>): Long { val requiredStepsUntilExit = desertMaps.map { followUntilExit(it.directions, it.root, 0) { it.key.endsWith("Z") } } return leastCommonMultiple(requiredStepsUntilExit) } private fun leastCommonMultiple(requiredStepsUntilExit: List<Long>): Long { return requiredStepsUntilExit.reduce { a, b -> lcm(a, b) } } private fun lcm(a: Long, b: Long): Long { return a * b / gcd(a, b) } private fun gcd(a: Long, b: Long): Long { return if (b == 0L) a else gcd(b, a % b) } private fun CharArray.rotate(n: Int) = let { sliceArray(n..<size) + sliceArray(0..<n) } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day8$DesertMap$Companion.class", "javap": "Compiled from \"Day8.kt\"\npublic final class Day8$DesertMap$Companion {\n private Day8$DesertMap$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day8$DesertMap parse(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: invokestatic #28 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #30 // class java/lang/String\n 13: invokevirtual #34 // Method java/lang/String.toCharArray:()[C\n 16: dup\n 17: ldc #36 // String toCharArray(...)\n 19: invokestatic #39 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 22: astore_2\n 23: aload_0\n 24: aload_1\n 25: checkcast #41 // class java/lang/Iterable\n 28: iconst_2\n 29: invokestatic #45 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 32: invokespecial #49 // Method parseNodes:(Ljava/util/List;)Ljava/util/List;\n 35: astore_3\n 36: aload_3\n 37: checkcast #41 // class java/lang/Iterable\n 40: astore 5\n 42: aload 5\n 44: invokeinterface #53, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 49: astore 6\n 51: aload 6\n 53: invokeinterface #59, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 58: ifeq 98\n 61: aload 6\n 63: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 68: astore 7\n 70: aload 7\n 72: checkcast #65 // class Day8$Node\n 75: astore 8\n 77: iconst_0\n 78: istore 9\n 80: aload 8\n 82: invokevirtual #69 // Method Day8$Node.getKey:()Ljava/lang/String;\n 85: ldc #71 // String AAA\n 87: invokestatic #75 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 90: ifeq 51\n 93: aload 7\n 95: goto 99\n 98: aconst_null\n 99: checkcast #65 // class Day8$Node\n 102: astore 4\n 104: new #77 // class Day8$DesertMap\n 107: dup\n 108: aload_2\n 109: aload 4\n 111: invokespecial #80 // Method Day8$DesertMap.\"<init>\":([CLDay8$Node;)V\n 114: areturn\n\n public final java.util.List<Day8$DesertMap> parsePart2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: invokestatic #28 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #30 // class java/lang/String\n 13: invokevirtual #34 // Method java/lang/String.toCharArray:()[C\n 16: dup\n 17: ldc #36 // String toCharArray(...)\n 19: invokestatic #39 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 22: astore_2\n 23: aload_0\n 24: aload_1\n 25: checkcast #41 // class java/lang/Iterable\n 28: iconst_2\n 29: invokestatic #45 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 32: invokespecial #49 // Method parseNodes:(Ljava/util/List;)Ljava/util/List;\n 35: astore_3\n 36: aload_3\n 37: checkcast #41 // class java/lang/Iterable\n 40: astore 5\n 42: iconst_0\n 43: istore 6\n 45: aload 5\n 47: astore 7\n 49: new #96 // class java/util/ArrayList\n 52: dup\n 53: invokespecial #97 // Method java/util/ArrayList.\"<init>\":()V\n 56: checkcast #99 // class java/util/Collection\n 59: astore 8\n 61: iconst_0\n 62: istore 9\n 64: aload 7\n 66: invokeinterface #53, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 71: astore 10\n 73: aload 10\n 75: invokeinterface #59, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 80: ifeq 131\n 83: aload 10\n 85: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 90: astore 11\n 92: aload 11\n 94: checkcast #65 // class Day8$Node\n 97: astore 12\n 99: iconst_0\n 100: istore 13\n 102: aload 12\n 104: invokevirtual #69 // Method Day8$Node.getKey:()Ljava/lang/String;\n 107: ldc #101 // String A\n 109: iconst_0\n 110: iconst_2\n 111: aconst_null\n 112: invokestatic #107 // Method kotlin/text/StringsKt.endsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z\n 115: ifeq 73\n 118: aload 8\n 120: aload 11\n 122: invokeinterface #111, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 127: pop\n 128: goto 73\n 131: aload 8\n 133: checkcast #91 // class java/util/List\n 136: nop\n 137: astore 4\n 139: aload 4\n 141: checkcast #41 // class java/lang/Iterable\n 144: astore 5\n 146: iconst_0\n 147: istore 6\n 149: aload 5\n 151: astore 7\n 153: new #96 // class java/util/ArrayList\n 156: dup\n 157: aload 5\n 159: bipush 10\n 161: invokestatic #115 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 164: invokespecial #118 // Method java/util/ArrayList.\"<init>\":(I)V\n 167: checkcast #99 // class java/util/Collection\n 170: astore 8\n 172: iconst_0\n 173: istore 9\n 175: aload 7\n 177: invokeinterface #53, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 182: astore 10\n 184: aload 10\n 186: invokeinterface #59, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 191: ifeq 239\n 194: aload 10\n 196: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 201: astore 11\n 203: aload 8\n 205: aload 11\n 207: checkcast #65 // class Day8$Node\n 210: astore 12\n 212: astore 14\n 214: iconst_0\n 215: istore 13\n 217: new #77 // class Day8$DesertMap\n 220: dup\n 221: aload_2\n 222: aload 12\n 224: invokespecial #80 // Method Day8$DesertMap.\"<init>\":([CLDay8$Node;)V\n 227: aload 14\n 229: swap\n 230: invokeinterface #111, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 235: pop\n 236: goto 184\n 239: aload 8\n 241: checkcast #91 // class java/util/List\n 244: nop\n 245: areturn\n\n private final java.util.List<Day8$Node> parseNodes(java.util.List<java.lang.String>);\n Code:\n 0: new #138 // class java/util/LinkedHashMap\n 3: dup\n 4: invokespecial #139 // Method java/util/LinkedHashMap.\"<init>\":()V\n 7: checkcast #141 // class java/util/Map\n 10: astore_2\n 11: new #143 // class kotlin/text/Regex\n 14: dup\n 15: ldc #145 // String (\\\\w+) = \\\\((\\\\w+), (\\\\w+)\\\\)\n 17: invokespecial #148 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 20: astore_3\n 21: aload_1\n 22: invokeinterface #149, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;\n 27: astore 4\n 29: aload 4\n 31: invokeinterface #59, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 36: ifeq 340\n 39: aload 4\n 41: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 46: checkcast #30 // class java/lang/String\n 49: astore 5\n 51: aload_3\n 52: aload 5\n 54: checkcast #151 // class java/lang/CharSequence\n 57: invokevirtual #155 // Method kotlin/text/Regex.matchEntire:(Ljava/lang/CharSequence;)Lkotlin/text/MatchResult;\n 60: dup\n 61: invokestatic #159 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 64: invokeinterface #165, 1 // InterfaceMethod kotlin/text/MatchResult.getDestructured:()Lkotlin/text/MatchResult$Destructured;\n 69: astore 6\n 71: aload 6\n 73: invokevirtual #171 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 76: invokeinterface #175, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 81: iconst_1\n 82: invokeinterface #179, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 87: checkcast #30 // class java/lang/String\n 90: astore 7\n 92: aload 6\n 94: invokevirtual #171 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 97: invokeinterface #175, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 102: iconst_2\n 103: invokeinterface #179, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 108: checkcast #30 // class java/lang/String\n 111: astore 8\n 113: aload 6\n 115: invokevirtual #171 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 118: invokeinterface #175, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 123: iconst_3\n 124: invokeinterface #179, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 129: checkcast #30 // class java/lang/String\n 132: astore 9\n 134: aload_2\n 135: astore 11\n 137: iconst_0\n 138: istore 12\n 140: aload 11\n 142: aload 8\n 144: invokeinterface #182, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 149: astore 13\n 151: aload 13\n 153: ifnonnull 189\n 156: iconst_0\n 157: istore 14\n 159: new #65 // class Day8$Node\n 162: dup\n 163: aconst_null\n 164: aconst_null\n 165: aload 8\n 167: invokespecial #185 // Method Day8$Node.\"<init>\":(LDay8$Node;LDay8$Node;Ljava/lang/String;)V\n 170: astore 14\n 172: aload 11\n 174: aload 8\n 176: aload 14\n 178: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 183: pop\n 184: aload 14\n 186: goto 191\n 189: aload 13\n 191: nop\n 192: checkcast #65 // class Day8$Node\n 195: astore 10\n 197: aload_2\n 198: astore 12\n 200: iconst_0\n 201: istore 13\n 203: aload 12\n 205: aload 9\n 207: invokeinterface #182, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 212: astore 14\n 214: aload 14\n 216: ifnonnull 252\n 219: iconst_0\n 220: istore 15\n 222: new #65 // class Day8$Node\n 225: dup\n 226: aconst_null\n 227: aconst_null\n 228: aload 9\n 230: invokespecial #185 // Method Day8$Node.\"<init>\":(LDay8$Node;LDay8$Node;Ljava/lang/String;)V\n 233: astore 15\n 235: aload 12\n 237: aload 9\n 239: aload 15\n 241: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 246: pop\n 247: aload 15\n 249: goto 254\n 252: aload 14\n 254: nop\n 255: checkcast #65 // class Day8$Node\n 258: astore 11\n 260: aload_2\n 261: astore 13\n 263: iconst_0\n 264: istore 14\n 266: aload 13\n 268: aload 7\n 270: invokeinterface #182, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 275: astore 15\n 277: aload 15\n 279: ifnonnull 315\n 282: iconst_0\n 283: istore 16\n 285: new #65 // class Day8$Node\n 288: dup\n 289: aconst_null\n 290: aconst_null\n 291: aload 7\n 293: invokespecial #185 // Method Day8$Node.\"<init>\":(LDay8$Node;LDay8$Node;Ljava/lang/String;)V\n 296: astore 16\n 298: aload 13\n 300: aload 7\n 302: aload 16\n 304: invokeinterface #189, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 309: pop\n 310: aload 16\n 312: goto 317\n 315: aload 15\n 317: nop\n 318: checkcast #65 // class Day8$Node\n 321: astore 12\n 323: aload 12\n 325: aload 10\n 327: invokevirtual #193 // Method Day8$Node.setLeft:(LDay8$Node;)V\n 330: aload 12\n 332: aload 11\n 334: invokevirtual #196 // Method Day8$Node.setRight:(LDay8$Node;)V\n 337: goto 29\n 340: aload_2\n 341: invokeinterface #200, 1 // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;\n 346: checkcast #41 // class java/lang/Iterable\n 349: invokestatic #204 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 352: areturn\n\n public Day8$DesertMap$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #225 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day8$DesertMap.class", "javap": "Compiled from \"Day8.kt\"\npublic final class Day8$DesertMap {\n public static final Day8$DesertMap$Companion Companion;\n\n private final char[] directions;\n\n private final Day8$Node root;\n\n public Day8$DesertMap(char[], Day8$Node);\n Code:\n 0: aload_1\n 1: ldc #10 // String directions\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #22 // Field directions:[C\n 15: aload_0\n 16: aload_2\n 17: putfield #26 // Field root:LDay8$Node;\n 20: return\n\n public final char[] getDirections();\n Code:\n 0: aload_0\n 1: getfield #22 // Field directions:[C\n 4: areturn\n\n public final Day8$Node getRoot();\n Code:\n 0: aload_0\n 1: getfield #26 // Field root:LDay8$Node;\n 4: areturn\n\n public final char[] component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field directions:[C\n 4: areturn\n\n public final Day8$Node component2();\n Code:\n 0: aload_0\n 1: getfield #26 // Field root:LDay8$Node;\n 4: areturn\n\n public final Day8$DesertMap copy(char[], Day8$Node);\n Code:\n 0: aload_1\n 1: ldc #10 // String directions\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day8$DesertMap\n 9: dup\n 10: aload_1\n 11: aload_2\n 12: invokespecial #38 // Method \"<init>\":([CLDay8$Node;)V\n 15: areturn\n\n public static Day8$DesertMap copy$default(Day8$DesertMap, char[], Day8$Node, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field directions:[C\n 10: astore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #26 // Field root:LDay8$Node;\n 21: astore_2\n 22: aload_0\n 23: aload_1\n 24: aload_2\n 25: invokevirtual #42 // Method copy:([CLDay8$Node;)LDay8$DesertMap;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #46 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #47 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #49 // String DesertMap(directions=\n 9: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field directions:[C\n 16: invokestatic #58 // Method java/util/Arrays.toString:([C)Ljava/lang/String;\n 19: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: ldc #60 // String , root=\n 24: invokevirtual #53 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 27: aload_0\n 28: getfield #26 // Field root:LDay8$Node;\n 31: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 34: bipush 41\n 36: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 39: invokevirtual #68 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 42: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #22 // Field directions:[C\n 4: invokestatic #73 // Method java/util/Arrays.hashCode:([C)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #26 // Field root:LDay8$Node;\n 16: ifnonnull 23\n 19: iconst_0\n 20: goto 30\n 23: aload_0\n 24: getfield #26 // Field root:LDay8$Node;\n 27: invokevirtual #77 // Method Day8$Node.hashCode:()I\n 30: iadd\n 31: istore_1\n 32: iload_1\n 33: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day8$DesertMap\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day8$DesertMap\n 20: astore_2\n 21: aload_0\n 22: getfield #22 // Field directions:[C\n 25: aload_2\n 26: getfield #22 // Field directions:[C\n 29: invokestatic #85 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #26 // Field root:LDay8$Node;\n 41: aload_2\n 42: getfield #26 // Field root:LDay8$Node;\n 45: invokestatic #85 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: iconst_1\n 54: ireturn\n\n static {};\n Code:\n 0: new #90 // class Day8$DesertMap$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #93 // Method Day8$DesertMap$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #97 // Field Companion:LDay8$DesertMap$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day8.class", "javap": "Compiled from \"Day8.kt\"\npublic final class Day8 {\n public static final Day8 INSTANCE;\n\n private Day8();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: getstatic #28 // Field Day8$DesertMap.Companion:LDay8$DesertMap$Companion;\n 9: aload_1\n 10: invokevirtual #34 // Method Day8$DesertMap$Companion.parse:(Ljava/util/List;)LDay8$DesertMap;\n 13: astore_2\n 14: aload_0\n 15: aload_2\n 16: invokevirtual #38 // Method Day8$DesertMap.getDirections:()[C\n 19: aload_2\n 20: invokevirtual #42 // Method Day8$DesertMap.getRoot:()LDay8$Node;\n 23: lconst_0\n 24: aconst_null\n 25: bipush 8\n 27: aconst_null\n 28: invokestatic #46 // Method followUntilExit$default:(LDay8;[CLDay8$Node;JLkotlin/jvm/functions/Function1;ILjava/lang/Object;)J\n 31: invokestatic #52 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 34: areturn\n\n private final long followUntilExit(char[], Day8$Node, long, kotlin.jvm.functions.Function1<? super Day8$Node, java.lang.Boolean>);\n Code:\n 0: aload_0\n 1: astore 6\n 3: aload_2\n 4: ifnull 24\n 7: aload 5\n 9: aload_2\n 10: invokeinterface #64, 2 // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;\n 15: checkcast #66 // class java/lang/Boolean\n 18: invokevirtual #70 // Method java/lang/Boolean.booleanValue:()Z\n 21: ifeq 26\n 24: lload_3\n 25: lreturn\n 26: aload_1\n 27: invokestatic #76 // Method kotlin/collections/ArraysKt.first:([C)C\n 30: bipush 76\n 32: if_icmpne 42\n 35: aload_2\n 36: invokevirtual #81 // Method Day8$Node.getLeft:()LDay8$Node;\n 39: goto 46\n 42: aload_2\n 43: invokevirtual #84 // Method Day8$Node.getRight:()LDay8$Node;\n 46: astore 7\n 48: aload 6\n 50: astore 8\n 52: aload 6\n 54: aload_1\n 55: iconst_1\n 56: invokespecial #88 // Method rotate:([CI)[C\n 59: astore 9\n 61: lload_3\n 62: lconst_1\n 63: ladd\n 64: lstore 10\n 66: aload 5\n 68: astore 12\n 70: aload 8\n 72: astore 6\n 74: aload 9\n 76: astore_1\n 77: aload 7\n 79: astore_2\n 80: lload 10\n 82: lstore_3\n 83: aload 12\n 85: astore 5\n 87: goto 3\n\n static long followUntilExit$default(Day8, char[], Day8$Node, long, kotlin.jvm.functions.Function1, int, java.lang.Object);\n Code:\n 0: iload 6\n 2: bipush 8\n 4: iand\n 5: ifeq 15\n 8: invokedynamic #115, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 13: astore 5\n 15: aload_0\n 16: aload_1\n 17: aload_2\n 18: lload_3\n 19: aload 5\n 21: invokespecial #117 // Method followUntilExit:([CLDay8$Node;JLkotlin/jvm/functions/Function1;)J\n 24: lreturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: getstatic #28 // Field Day8$DesertMap.Companion:LDay8$DesertMap$Companion;\n 9: aload_1\n 10: invokevirtual #122 // Method Day8$DesertMap$Companion.parsePart2:(Ljava/util/List;)Ljava/util/List;\n 13: astore_2\n 14: aload_0\n 15: aload_2\n 16: invokespecial #126 // Method followUntilAllExit:(Ljava/util/List;)J\n 19: invokestatic #52 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 22: areturn\n\n private final long followUntilAllExit(java.util.List<Day8$DesertMap>);\n Code:\n 0: aload_1\n 1: checkcast #130 // class java/lang/Iterable\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: astore 5\n 11: new #132 // class java/util/ArrayList\n 14: dup\n 15: aload_3\n 16: bipush 10\n 18: invokestatic #138 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 21: invokespecial #141 // Method java/util/ArrayList.\"<init>\":(I)V\n 24: checkcast #143 // class java/util/Collection\n 27: astore 6\n 29: iconst_0\n 30: istore 7\n 32: aload 5\n 34: invokeinterface #147, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 39: astore 8\n 41: aload 8\n 43: invokeinterface #152, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 48: ifeq 111\n 51: aload 8\n 53: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 58: astore 9\n 60: aload 6\n 62: aload 9\n 64: checkcast #24 // class Day8$DesertMap\n 67: astore 10\n 69: astore 12\n 71: iconst_0\n 72: istore 11\n 74: getstatic #159 // Field INSTANCE:LDay8;\n 77: aload 10\n 79: invokevirtual #38 // Method Day8$DesertMap.getDirections:()[C\n 82: aload 10\n 84: invokevirtual #42 // Method Day8$DesertMap.getRoot:()LDay8$Node;\n 87: lconst_0\n 88: invokedynamic #164, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 93: invokespecial #117 // Method followUntilExit:([CLDay8$Node;JLkotlin/jvm/functions/Function1;)J\n 96: invokestatic #169 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 99: aload 12\n 101: swap\n 102: invokeinterface #173, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 107: pop\n 108: goto 41\n 111: aload 6\n 113: checkcast #175 // class java/util/List\n 116: nop\n 117: astore_2\n 118: aload_0\n 119: aload_2\n 120: invokespecial #178 // Method leastCommonMultiple:(Ljava/util/List;)J\n 123: lreturn\n\n private final long leastCommonMultiple(java.util.List<java.lang.Long>);\n Code:\n 0: aload_1\n 1: checkcast #130 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: invokeinterface #147, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 13: astore 4\n 15: aload 4\n 17: invokeinterface #152, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 22: ifne 35\n 25: new #194 // class java/lang/UnsupportedOperationException\n 28: dup\n 29: ldc #196 // String Empty collection can\\'t be reduced.\n 31: invokespecial #199 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 34: athrow\n 35: aload 4\n 37: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 42: astore 5\n 44: aload 4\n 46: invokeinterface #152, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 51: ifeq 100\n 54: aload 5\n 56: aload 4\n 58: invokeinterface #156, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: checkcast #201 // class java/lang/Number\n 66: invokevirtual #205 // Method java/lang/Number.longValue:()J\n 69: lstore 6\n 71: checkcast #201 // class java/lang/Number\n 74: invokevirtual #205 // Method java/lang/Number.longValue:()J\n 77: lstore 8\n 79: iconst_0\n 80: istore 10\n 82: getstatic #159 // Field INSTANCE:LDay8;\n 85: lload 8\n 87: lload 6\n 89: invokespecial #209 // Method lcm:(JJ)J\n 92: invokestatic #169 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 95: astore 5\n 97: goto 44\n 100: aload 5\n 102: checkcast #201 // class java/lang/Number\n 105: invokevirtual #205 // Method java/lang/Number.longValue:()J\n 108: lreturn\n\n private final long lcm(long, long);\n Code:\n 0: lload_1\n 1: lload_3\n 2: lmul\n 3: aload_0\n 4: lload_1\n 5: lload_3\n 6: invokespecial #220 // Method gcd:(JJ)J\n 9: ldiv\n 10: lreturn\n\n private final long gcd(long, long);\n Code:\n 0: lload_3\n 1: lconst_0\n 2: lcmp\n 3: ifne 10\n 6: lload_1\n 7: goto 18\n 10: aload_0\n 11: lload_3\n 12: lload_1\n 13: lload_3\n 14: lrem\n 15: invokespecial #220 // Method gcd:(JJ)J\n 18: lreturn\n\n private final char[] rotate(char[], int);\n Code:\n 0: aload_1\n 1: astore_3\n 2: iconst_0\n 3: istore 4\n 5: aload_1\n 6: iload_2\n 7: aload_1\n 8: arraylength\n 9: invokestatic #226 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 12: invokestatic #230 // Method kotlin/collections/ArraysKt.sliceArray:([CLkotlin/ranges/IntRange;)[C\n 15: aload_1\n 16: iconst_0\n 17: iload_2\n 18: invokestatic #226 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 21: invokestatic #230 // Method kotlin/collections/ArraysKt.sliceArray:([CLkotlin/ranges/IntRange;)[C\n 24: invokestatic #234 // Method kotlin/collections/ArraysKt.plus:([C[C)[C\n 27: nop\n 28: areturn\n\n private static final boolean followUntilExit$lambda$0(Day8$Node);\n Code:\n 0: aload_0\n 1: ldc #238 // String it\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #242 // Method Day8$Node.getKey:()Ljava/lang/String;\n 10: ldc #244 // String ZZZ\n 12: invokestatic #248 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 15: ireturn\n\n private static final boolean followUntilAllExit$lambda$2$lambda$1(Day8$Node);\n Code:\n 0: aload_0\n 1: ldc #238 // String it\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokevirtual #242 // Method Day8$Node.getKey:()Ljava/lang/String;\n 10: ldc #250 // String Z\n 12: iconst_0\n 13: iconst_2\n 14: aconst_null\n 15: invokestatic #256 // Method kotlin/text/StringsKt.endsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z\n 18: ireturn\n\n static {};\n Code:\n 0: new #2 // class Day8\n 3: dup\n 4: invokespecial #258 // Method \"<init>\":()V\n 7: putstatic #159 // Field INSTANCE:LDay8;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day8$Node.class", "javap": "Compiled from \"Day8.kt\"\npublic final class Day8$Node {\n private Day8$Node left;\n\n private Day8$Node right;\n\n private final java.lang.String key;\n\n public Day8$Node(Day8$Node, Day8$Node, java.lang.String);\n Code:\n 0: aload_3\n 1: ldc #10 // String key\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #23 // Field left:LDay8$Node;\n 15: aload_0\n 16: aload_2\n 17: putfield #26 // Field right:LDay8$Node;\n 20: aload_0\n 21: aload_3\n 22: putfield #29 // Field key:Ljava/lang/String;\n 25: return\n\n public final Day8$Node getLeft();\n Code:\n 0: aload_0\n 1: getfield #23 // Field left:LDay8$Node;\n 4: areturn\n\n public final void setLeft(Day8$Node);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #23 // Field left:LDay8$Node;\n 5: return\n\n public final Day8$Node getRight();\n Code:\n 0: aload_0\n 1: getfield #26 // Field right:LDay8$Node;\n 4: areturn\n\n public final void setRight(Day8$Node);\n Code:\n 0: aload_0\n 1: aload_1\n 2: putfield #26 // Field right:LDay8$Node;\n 5: return\n\n public final java.lang.String getKey();\n Code:\n 0: aload_0\n 1: getfield #29 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final Day8$Node component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field left:LDay8$Node;\n 4: areturn\n\n public final Day8$Node component2();\n Code:\n 0: aload_0\n 1: getfield #26 // Field right:LDay8$Node;\n 4: areturn\n\n public final java.lang.String component3();\n Code:\n 0: aload_0\n 1: getfield #29 // Field key:Ljava/lang/String;\n 4: areturn\n\n public final Day8$Node copy(Day8$Node, Day8$Node, java.lang.String);\n Code:\n 0: aload_3\n 1: ldc #10 // String key\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day8$Node\n 9: dup\n 10: aload_1\n 11: aload_2\n 12: aload_3\n 13: invokespecial #46 // Method \"<init>\":(LDay8$Node;LDay8$Node;Ljava/lang/String;)V\n 16: areturn\n\n public static Day8$Node copy$default(Day8$Node, Day8$Node, Day8$Node, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #23 // Field left:LDay8$Node;\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #26 // Field right:LDay8$Node;\n 23: astore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #29 // Field key:Ljava/lang/String;\n 35: astore_3\n 36: aload_0\n 37: aload_1\n 38: aload_2\n 39: aload_3\n 40: invokevirtual #50 // Method copy:(LDay8$Node;LDay8$Node;Ljava/lang/String;)LDay8$Node;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #53 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #54 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #56 // String Node(left=\n 9: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field left:LDay8$Node;\n 16: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #65 // String , right=\n 21: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #26 // Field right:LDay8$Node;\n 28: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: ldc #67 // String , key=\n 33: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #29 // Field key:Ljava/lang/String;\n 40: invokevirtual #60 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #70 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #72 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field left:LDay8$Node;\n 4: ifnonnull 11\n 7: iconst_0\n 8: goto 18\n 11: aload_0\n 12: getfield #23 // Field left:LDay8$Node;\n 15: invokevirtual #76 // Method hashCode:()I\n 18: istore_1\n 19: iload_1\n 20: bipush 31\n 22: imul\n 23: aload_0\n 24: getfield #26 // Field right:LDay8$Node;\n 27: ifnonnull 34\n 30: iconst_0\n 31: goto 41\n 34: aload_0\n 35: getfield #26 // Field right:LDay8$Node;\n 38: invokevirtual #76 // Method hashCode:()I\n 41: iadd\n 42: istore_1\n 43: iload_1\n 44: bipush 31\n 46: imul\n 47: aload_0\n 48: getfield #29 // Field key:Ljava/lang/String;\n 51: invokevirtual #79 // Method java/lang/String.hashCode:()I\n 54: iadd\n 55: istore_1\n 56: iload_1\n 57: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day8$Node\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day8$Node\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field left:LDay8$Node;\n 25: aload_2\n 26: getfield #23 // Field left:LDay8$Node;\n 29: invokestatic #87 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #26 // Field right:LDay8$Node;\n 41: aload_2\n 42: getfield #26 // Field right:LDay8$Node;\n 45: invokestatic #87 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: aload_0\n 54: getfield #29 // Field key:Ljava/lang/String;\n 57: aload_2\n 58: getfield #29 // Field key:Ljava/lang/String;\n 61: invokestatic #87 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 64: ifne 69\n 67: iconst_0\n 68: ireturn\n 69: iconst_1\n 70: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day2.kt
import kotlin.String import kotlin.collections.List object Day2 { data class Cube( val color: String, val count: Int ) data class Game( val id: Int, val cubePulls: List<List<Cube>> ) { companion object { fun parseGame(s: String): Game { val (id, pulls) = s.split(":") return Game( id.trimStart(*"Game ".toCharArray()).toInt(), pulls.split(";").map { cubeList -> cubeList.split(",").map { cube -> val (count, color) = cube.trimStart(' ').split(" ") Cube(color, count.toInt()) } } ) } } } fun part1(input: List<String>): String { return sumOfGamesWithTarget( input.map(Game::parseGame), listOf( Cube("red", 12), Cube("green", 13), Cube("blue", 14) ) ).toString() } private fun sumOfGamesWithTarget(input: List<Game>, targets: List<Cube>): Int { val index = targets.associateBy { it.color } return input.filter { it.cubePulls.all { it.all { it.count <= index.getOrDefault( it.color, it ).count } } }.sumOf { it.id } } fun part2(input: List<String>): String { return sumOfPowersWithMinimums(input.map(Game::parseGame)).toString() } private fun sumOfPowersWithMinimums(games: List<Game>): Int { return games.map { val minimumCubesNeeded = it.cubePulls.flatten() .groupBy { it.color } .mapValues { it.value.maxBy { it.count } } minimumCubesNeeded.map { it.value.count }.reduce { a, b -> a * b } }.sum() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day2$Game.class", "javap": "Compiled from \"Day2.kt\"\npublic final class Day2$Game {\n public static final Day2$Game$Companion Companion;\n\n private final int id;\n\n private final java.util.List<java.util.List<Day2$Cube>> cubePulls;\n\n public Day2$Game(int, java.util.List<? extends java.util.List<Day2$Cube>>);\n Code:\n 0: aload_2\n 1: ldc #10 // String cubePulls\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: iload_1\n 12: putfield #23 // Field id:I\n 15: aload_0\n 16: aload_2\n 17: putfield #26 // Field cubePulls:Ljava/util/List;\n 20: return\n\n public final int getId();\n Code:\n 0: aload_0\n 1: getfield #23 // Field id:I\n 4: ireturn\n\n public final java.util.List<java.util.List<Day2$Cube>> getCubePulls();\n Code:\n 0: aload_0\n 1: getfield #26 // Field cubePulls:Ljava/util/List;\n 4: areturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field id:I\n 4: ireturn\n\n public final java.util.List<java.util.List<Day2$Cube>> component2();\n Code:\n 0: aload_0\n 1: getfield #26 // Field cubePulls:Ljava/util/List;\n 4: areturn\n\n public final Day2$Game copy(int, java.util.List<? extends java.util.List<Day2$Cube>>);\n Code:\n 0: aload_2\n 1: ldc #10 // String cubePulls\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day2$Game\n 9: dup\n 10: iload_1\n 11: aload_2\n 12: invokespecial #40 // Method \"<init>\":(ILjava/util/List;)V\n 15: areturn\n\n public static Day2$Game copy$default(Day2$Game, int, java.util.List, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #23 // Field id:I\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #26 // Field cubePulls:Ljava/util/List;\n 21: astore_2\n 22: aload_0\n 23: iload_1\n 24: aload_2\n 25: invokevirtual #44 // Method copy:(ILjava/util/List;)LDay2$Game;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #48 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #49 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #51 // String Game(id=\n 9: invokevirtual #55 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field id:I\n 16: invokevirtual #58 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #60 // String , cubePulls=\n 21: invokevirtual #55 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #26 // Field cubePulls:Ljava/util/List;\n 28: invokevirtual #63 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #68 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field id:I\n 4: invokestatic #74 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #26 // Field cubePulls:Ljava/util/List;\n 16: invokevirtual #76 // Method java/lang/Object.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day2$Game\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day2$Game\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field id:I\n 25: aload_2\n 26: getfield #23 // Field id:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #26 // Field cubePulls:Ljava/util/List;\n 38: aload_2\n 39: getfield #26 // Field cubePulls:Ljava/util/List;\n 42: invokestatic #84 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 45: ifne 50\n 48: iconst_0\n 49: ireturn\n 50: iconst_1\n 51: ireturn\n\n static {};\n Code:\n 0: new #89 // class Day2$Game$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #92 // Method Day2$Game$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #96 // Field Companion:LDay2$Game$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day2.class", "javap": "Compiled from \"Day2.kt\"\npublic final class Day2 {\n public static final Day2 INSTANCE;\n\n private Day2();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: checkcast #24 // class java/lang/Iterable\n 11: astore_2\n 12: getstatic #30 // Field Day2$Game.Companion:LDay2$Game$Companion;\n 15: astore_3\n 16: astore 12\n 18: iconst_0\n 19: istore 4\n 21: aload_2\n 22: astore 5\n 24: new #32 // class java/util/ArrayList\n 27: dup\n 28: aload_2\n 29: bipush 10\n 31: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 34: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 37: checkcast #43 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 105\n 64: aload 8\n 66: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 6\n 75: aload 9\n 77: checkcast #59 // class java/lang/String\n 80: astore 10\n 82: astore 13\n 84: iconst_0\n 85: istore 11\n 87: aload_3\n 88: aload 10\n 90: invokevirtual #65 // Method Day2$Game$Companion.parseGame:(Ljava/lang/String;)LDay2$Game;\n 93: aload 13\n 95: swap\n 96: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 101: pop\n 102: goto 54\n 105: aload 6\n 107: checkcast #71 // class java/util/List\n 110: nop\n 111: aload 12\n 113: swap\n 114: iconst_3\n 115: anewarray #73 // class Day2$Cube\n 118: astore_2\n 119: aload_2\n 120: iconst_0\n 121: new #73 // class Day2$Cube\n 124: dup\n 125: ldc #75 // String red\n 127: bipush 12\n 129: invokespecial #78 // Method Day2$Cube.\"<init>\":(Ljava/lang/String;I)V\n 132: aastore\n 133: aload_2\n 134: iconst_1\n 135: new #73 // class Day2$Cube\n 138: dup\n 139: ldc #80 // String green\n 141: bipush 13\n 143: invokespecial #78 // Method Day2$Cube.\"<init>\":(Ljava/lang/String;I)V\n 146: aastore\n 147: aload_2\n 148: iconst_2\n 149: new #73 // class Day2$Cube\n 152: dup\n 153: ldc #82 // String blue\n 155: bipush 14\n 157: invokespecial #78 // Method Day2$Cube.\"<init>\":(Ljava/lang/String;I)V\n 160: aastore\n 161: aload_2\n 162: invokestatic #86 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 165: invokespecial #90 // Method sumOfGamesWithTarget:(Ljava/util/List;Ljava/util/List;)I\n 168: invokestatic #94 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 171: areturn\n\n private final int sumOfGamesWithTarget(java.util.List<Day2$Game>, java.util.List<Day2$Cube>);\n Code:\n 0: aload_2\n 1: checkcast #24 // class java/lang/Iterable\n 4: astore 4\n 6: iconst_0\n 7: istore 5\n 9: aload 4\n 11: bipush 10\n 13: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 16: invokestatic #115 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 19: bipush 16\n 21: invokestatic #121 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I\n 24: istore 6\n 26: aload 4\n 28: astore 7\n 30: new #123 // class java/util/LinkedHashMap\n 33: dup\n 34: iload 6\n 36: invokespecial #124 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 39: checkcast #126 // class java/util/Map\n 42: astore 8\n 44: iconst_0\n 45: istore 9\n 47: aload 7\n 49: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 54: astore 10\n 56: aload 10\n 58: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 63: ifeq 108\n 66: aload 10\n 68: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 73: astore 11\n 75: aload 8\n 77: aload 11\n 79: checkcast #73 // class Day2$Cube\n 82: astore 12\n 84: astore 25\n 86: iconst_0\n 87: istore 13\n 89: aload 12\n 91: invokevirtual #130 // Method Day2$Cube.getColor:()Ljava/lang/String;\n 94: aload 25\n 96: swap\n 97: aload 11\n 99: invokeinterface #134, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 104: pop\n 105: goto 56\n 108: aload 8\n 110: nop\n 111: astore_3\n 112: aload_1\n 113: checkcast #24 // class java/lang/Iterable\n 116: astore 4\n 118: iconst_0\n 119: istore 5\n 121: aload 4\n 123: astore 6\n 125: new #32 // class java/util/ArrayList\n 128: dup\n 129: invokespecial #135 // Method java/util/ArrayList.\"<init>\":()V\n 132: checkcast #43 // class java/util/Collection\n 135: astore 7\n 137: iconst_0\n 138: istore 8\n 140: aload 6\n 142: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 147: astore 9\n 149: aload 9\n 151: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 156: ifeq 394\n 159: aload 9\n 161: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 166: astore 10\n 168: aload 10\n 170: checkcast #26 // class Day2$Game\n 173: astore 11\n 175: iconst_0\n 176: istore 12\n 178: aload 11\n 180: invokevirtual #139 // Method Day2$Game.getCubePulls:()Ljava/util/List;\n 183: checkcast #24 // class java/lang/Iterable\n 186: astore 13\n 188: iconst_0\n 189: istore 14\n 191: aload 13\n 193: instanceof #43 // class java/util/Collection\n 196: ifeq 216\n 199: aload 13\n 201: checkcast #43 // class java/util/Collection\n 204: invokeinterface #142, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 209: ifeq 216\n 212: iconst_1\n 213: goto 377\n 216: aload 13\n 218: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 223: astore 15\n 225: aload 15\n 227: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 232: ifeq 376\n 235: aload 15\n 237: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 242: astore 16\n 244: aload 16\n 246: checkcast #71 // class java/util/List\n 249: astore 17\n 251: iconst_0\n 252: istore 18\n 254: aload 17\n 256: checkcast #24 // class java/lang/Iterable\n 259: astore 19\n 261: iconst_0\n 262: istore 20\n 264: aload 19\n 266: instanceof #43 // class java/util/Collection\n 269: ifeq 289\n 272: aload 19\n 274: checkcast #43 // class java/util/Collection\n 277: invokeinterface #142, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 282: ifeq 289\n 285: iconst_1\n 286: goto 368\n 289: aload 19\n 291: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 296: astore 21\n 298: aload 21\n 300: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 305: ifeq 367\n 308: aload 21\n 310: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 315: astore 22\n 317: aload 22\n 319: checkcast #73 // class Day2$Cube\n 322: astore 23\n 324: iconst_0\n 325: istore 24\n 327: aload 23\n 329: invokevirtual #146 // Method Day2$Cube.getCount:()I\n 332: aload_3\n 333: aload 23\n 335: invokevirtual #130 // Method Day2$Cube.getColor:()Ljava/lang/String;\n 338: aload 23\n 340: invokeinterface #149, 3 // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 345: checkcast #73 // class Day2$Cube\n 348: invokevirtual #146 // Method Day2$Cube.getCount:()I\n 351: if_icmpgt 358\n 354: iconst_1\n 355: goto 359\n 358: iconst_0\n 359: nop\n 360: ifne 298\n 363: iconst_0\n 364: goto 368\n 367: iconst_1\n 368: nop\n 369: ifne 225\n 372: iconst_0\n 373: goto 377\n 376: iconst_1\n 377: nop\n 378: ifeq 149\n 381: aload 7\n 383: aload 10\n 385: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 390: pop\n 391: goto 149\n 394: aload 7\n 396: checkcast #71 // class java/util/List\n 399: nop\n 400: checkcast #24 // class java/lang/Iterable\n 403: astore 4\n 405: iconst_0\n 406: istore 5\n 408: aload 4\n 410: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 415: astore 6\n 417: aload 6\n 419: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 424: ifeq 467\n 427: aload 6\n 429: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 434: astore 7\n 436: iload 5\n 438: aload 7\n 440: checkcast #26 // class Day2$Game\n 443: astore 8\n 445: istore 25\n 447: iconst_0\n 448: istore 9\n 450: aload 8\n 452: invokevirtual #152 // Method Day2$Game.getId:()I\n 455: istore 26\n 457: iload 25\n 459: iload 26\n 461: iadd\n 462: istore 5\n 464: goto 417\n 467: iload 5\n 469: ireturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: checkcast #24 // class java/lang/Iterable\n 11: astore_2\n 12: getstatic #30 // Field Day2$Game.Companion:LDay2$Game$Companion;\n 15: astore_3\n 16: astore 12\n 18: iconst_0\n 19: istore 4\n 21: aload_2\n 22: astore 5\n 24: new #32 // class java/util/ArrayList\n 27: dup\n 28: aload_2\n 29: bipush 10\n 31: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 34: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 37: checkcast #43 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 105\n 64: aload 8\n 66: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 6\n 75: aload 9\n 77: checkcast #59 // class java/lang/String\n 80: astore 10\n 82: astore 13\n 84: iconst_0\n 85: istore 11\n 87: aload_3\n 88: aload 10\n 90: invokevirtual #65 // Method Day2$Game$Companion.parseGame:(Ljava/lang/String;)LDay2$Game;\n 93: aload 13\n 95: swap\n 96: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 101: pop\n 102: goto 54\n 105: aload 6\n 107: checkcast #71 // class java/util/List\n 110: nop\n 111: aload 12\n 113: swap\n 114: invokespecial #181 // Method sumOfPowersWithMinimums:(Ljava/util/List;)I\n 117: invokestatic #94 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 120: areturn\n\n private final int sumOfPowersWithMinimums(java.util.List<Day2$Game>);\n Code:\n 0: aload_1\n 1: checkcast #24 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: astore 4\n 10: new #32 // class java/util/ArrayList\n 13: dup\n 14: aload_2\n 15: bipush 10\n 17: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 20: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 23: checkcast #43 // class java/util/Collection\n 26: astore 5\n 28: iconst_0\n 29: istore 6\n 31: aload 4\n 33: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 38: astore 7\n 40: aload 7\n 42: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 47: ifeq 751\n 50: aload 7\n 52: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 57: astore 8\n 59: aload 5\n 61: aload 8\n 63: checkcast #26 // class Day2$Game\n 66: astore 9\n 68: astore 37\n 70: iconst_0\n 71: istore 10\n 73: aload 9\n 75: invokevirtual #139 // Method Day2$Game.getCubePulls:()Ljava/util/List;\n 78: checkcast #24 // class java/lang/Iterable\n 81: invokestatic #187 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;\n 84: checkcast #24 // class java/lang/Iterable\n 87: astore 11\n 89: nop\n 90: iconst_0\n 91: istore 12\n 93: aload 11\n 95: astore 13\n 97: new #123 // class java/util/LinkedHashMap\n 100: dup\n 101: invokespecial #188 // Method java/util/LinkedHashMap.\"<init>\":()V\n 104: checkcast #126 // class java/util/Map\n 107: astore 14\n 109: iconst_0\n 110: istore 15\n 112: aload 13\n 114: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 119: astore 16\n 121: aload 16\n 123: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 128: ifeq 233\n 131: aload 16\n 133: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 138: astore 17\n 140: aload 17\n 142: checkcast #73 // class Day2$Cube\n 145: astore 18\n 147: iconst_0\n 148: istore 19\n 150: aload 18\n 152: invokevirtual #130 // Method Day2$Cube.getColor:()Ljava/lang/String;\n 155: astore 20\n 157: aload 14\n 159: astore 21\n 161: iconst_0\n 162: istore 22\n 164: aload 21\n 166: aload 20\n 168: invokeinterface #192, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 173: astore 23\n 175: aload 23\n 177: ifnonnull 212\n 180: iconst_0\n 181: istore 24\n 183: new #32 // class java/util/ArrayList\n 186: dup\n 187: invokespecial #135 // Method java/util/ArrayList.\"<init>\":()V\n 190: checkcast #71 // class java/util/List\n 193: astore 24\n 195: aload 21\n 197: aload 20\n 199: aload 24\n 201: invokeinterface #134, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 206: pop\n 207: aload 24\n 209: goto 214\n 212: aload 23\n 214: nop\n 215: checkcast #71 // class java/util/List\n 218: astore 18\n 220: aload 18\n 222: aload 17\n 224: invokeinterface #193, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 229: pop\n 230: goto 121\n 233: aload 14\n 235: nop\n 236: astore 11\n 238: nop\n 239: iconst_0\n 240: istore 12\n 242: aload 11\n 244: astore 13\n 246: new #123 // class java/util/LinkedHashMap\n 249: dup\n 250: aload 11\n 252: invokeinterface #196, 1 // InterfaceMethod java/util/Map.size:()I\n 257: invokestatic #115 // Method kotlin/collections/MapsKt.mapCapacity:(I)I\n 260: invokespecial #124 // Method java/util/LinkedHashMap.\"<init>\":(I)V\n 263: checkcast #126 // class java/util/Map\n 266: astore 14\n 268: iconst_0\n 269: istore 15\n 271: aload 13\n 273: invokeinterface #200, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 278: checkcast #24 // class java/lang/Iterable\n 281: astore 16\n 283: iconst_0\n 284: istore 17\n 286: aload 16\n 288: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 293: astore 18\n 295: aload 18\n 297: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 302: ifeq 509\n 305: aload 18\n 307: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 312: astore 19\n 314: aload 14\n 316: aload 19\n 318: checkcast #202 // class java/util/Map$Entry\n 321: astore 20\n 323: astore 21\n 325: iconst_0\n 326: istore 22\n 328: aload 20\n 330: invokeinterface #205, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 335: aload 21\n 337: swap\n 338: aload 19\n 340: checkcast #202 // class java/util/Map$Entry\n 343: astore 23\n 345: astore 25\n 347: astore 26\n 349: iconst_0\n 350: istore 24\n 352: aload 23\n 354: invokeinterface #208, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 359: checkcast #24 // class java/lang/Iterable\n 362: astore 27\n 364: iconst_0\n 365: istore 28\n 367: aload 27\n 369: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 374: astore 29\n 376: aload 29\n 378: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 383: ifne 394\n 386: new #210 // class java/util/NoSuchElementException\n 389: dup\n 390: invokespecial #211 // Method java/util/NoSuchElementException.\"<init>\":()V\n 393: athrow\n 394: aload 29\n 396: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 401: astore 30\n 403: aload 29\n 405: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 410: ifne 418\n 413: aload 30\n 415: goto 488\n 418: aload 30\n 420: checkcast #73 // class Day2$Cube\n 423: astore 31\n 425: iconst_0\n 426: istore 32\n 428: aload 31\n 430: invokevirtual #146 // Method Day2$Cube.getCount:()I\n 433: istore 31\n 435: aload 29\n 437: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 442: astore 32\n 444: aload 32\n 446: checkcast #73 // class Day2$Cube\n 449: astore 33\n 451: iconst_0\n 452: istore 34\n 454: aload 33\n 456: invokevirtual #146 // Method Day2$Cube.getCount:()I\n 459: istore 33\n 461: iload 31\n 463: iload 33\n 465: if_icmpge 476\n 468: aload 32\n 470: astore 30\n 472: iload 33\n 474: istore 31\n 476: aload 29\n 478: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 483: ifne 435\n 486: aload 30\n 488: checkcast #73 // class Day2$Cube\n 491: nop\n 492: astore 35\n 494: aload 26\n 496: aload 25\n 498: aload 35\n 500: invokeinterface #134, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 505: pop\n 506: goto 295\n 509: aload 14\n 511: nop\n 512: nop\n 513: astore 36\n 515: aload 36\n 517: astore 11\n 519: iconst_0\n 520: istore 12\n 522: aload 11\n 524: astore 13\n 526: new #32 // class java/util/ArrayList\n 529: dup\n 530: aload 11\n 532: invokeinterface #196, 1 // InterfaceMethod java/util/Map.size:()I\n 537: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 540: checkcast #43 // class java/util/Collection\n 543: astore 14\n 545: iconst_0\n 546: istore 15\n 548: aload 13\n 550: invokeinterface #200, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 555: invokeinterface #214, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 560: astore 16\n 562: aload 16\n 564: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 569: ifeq 623\n 572: aload 16\n 574: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 579: checkcast #202 // class java/util/Map$Entry\n 582: astore 17\n 584: aload 14\n 586: aload 17\n 588: astore 18\n 590: astore 26\n 592: iconst_0\n 593: istore 19\n 595: aload 18\n 597: invokeinterface #208, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 602: checkcast #73 // class Day2$Cube\n 605: invokevirtual #146 // Method Day2$Cube.getCount:()I\n 608: invokestatic #219 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 611: aload 26\n 613: swap\n 614: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 619: pop\n 620: goto 562\n 623: aload 14\n 625: checkcast #71 // class java/util/List\n 628: nop\n 629: checkcast #24 // class java/lang/Iterable\n 632: astore 11\n 634: nop\n 635: iconst_0\n 636: istore 12\n 638: aload 11\n 640: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 645: astore 13\n 647: aload 13\n 649: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 654: ifne 667\n 657: new #221 // class java/lang/UnsupportedOperationException\n 660: dup\n 661: ldc #223 // String Empty collection can\\'t be reduced.\n 663: invokespecial #226 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 666: athrow\n 667: aload 13\n 669: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 674: astore 14\n 676: aload 13\n 678: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 683: ifeq 727\n 686: aload 14\n 688: aload 13\n 690: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 695: checkcast #228 // class java/lang/Number\n 698: invokevirtual #231 // Method java/lang/Number.intValue:()I\n 701: istore 15\n 703: checkcast #228 // class java/lang/Number\n 706: invokevirtual #231 // Method java/lang/Number.intValue:()I\n 709: istore 16\n 711: iconst_0\n 712: istore 17\n 714: iload 16\n 716: iload 15\n 718: imul\n 719: invokestatic #219 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 722: astore 14\n 724: goto 676\n 727: aload 14\n 729: checkcast #228 // class java/lang/Number\n 732: invokevirtual #231 // Method java/lang/Number.intValue:()I\n 735: nop\n 736: invokestatic #219 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 739: aload 37\n 741: swap\n 742: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 747: pop\n 748: goto 40\n 751: aload 5\n 753: checkcast #71 // class java/util/List\n 756: nop\n 757: checkcast #24 // class java/lang/Iterable\n 760: invokestatic #235 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 763: ireturn\n\n static {};\n Code:\n 0: new #2 // class Day2\n 3: dup\n 4: invokespecial #278 // Method \"<init>\":()V\n 7: putstatic #281 // Field INSTANCE:LDay2;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day2$Cube.class", "javap": "Compiled from \"Day2.kt\"\npublic final class Day2$Cube {\n private final java.lang.String color;\n\n private final int count;\n\n public Day2$Cube(java.lang.String, int);\n Code:\n 0: aload_1\n 1: ldc #9 // String color\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #18 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #21 // Field color:Ljava/lang/String;\n 15: aload_0\n 16: iload_2\n 17: putfield #25 // Field count:I\n 20: return\n\n public final java.lang.String getColor();\n Code:\n 0: aload_0\n 1: getfield #21 // Field color:Ljava/lang/String;\n 4: areturn\n\n public final int getCount();\n Code:\n 0: aload_0\n 1: getfield #25 // Field count:I\n 4: ireturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #21 // Field color:Ljava/lang/String;\n 4: areturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #25 // Field count:I\n 4: ireturn\n\n public final Day2$Cube copy(java.lang.String, int);\n Code:\n 0: aload_1\n 1: ldc #9 // String color\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day2$Cube\n 9: dup\n 10: aload_1\n 11: iload_2\n 12: invokespecial #37 // Method \"<init>\":(Ljava/lang/String;I)V\n 15: areturn\n\n public static Day2$Cube copy$default(Day2$Cube, java.lang.String, int, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #21 // Field color:Ljava/lang/String;\n 10: astore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #25 // Field count:I\n 21: istore_2\n 22: aload_0\n 23: aload_1\n 24: iload_2\n 25: invokevirtual #41 // Method copy:(Ljava/lang/String;I)LDay2$Cube;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #44 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #45 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #47 // String Cube(color=\n 9: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #21 // Field color:Ljava/lang/String;\n 16: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #53 // String , count=\n 21: invokevirtual #51 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #25 // Field count:I\n 28: invokevirtual #56 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #59 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #61 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #21 // Field color:Ljava/lang/String;\n 4: invokevirtual #66 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #25 // Field count:I\n 16: invokestatic #71 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day2$Cube\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day2$Cube\n 20: astore_2\n 21: aload_0\n 22: getfield #21 // Field color:Ljava/lang/String;\n 25: aload_2\n 26: getfield #21 // Field color:Ljava/lang/String;\n 29: invokestatic #79 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #25 // Field count:I\n 41: aload_2\n 42: getfield #25 // Field count:I\n 45: if_icmpeq 50\n 48: iconst_0\n 49: ireturn\n 50: iconst_1\n 51: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day2$Game$Companion.class", "javap": "Compiled from \"Day2.kt\"\npublic final class Day2$Game$Companion {\n private Day2$Game$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day2$Game parseGame(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String s\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #23 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #25 // class java/lang/String\n 14: astore_3\n 15: aload_3\n 16: iconst_0\n 17: ldc #27 // String :\n 19: aastore\n 20: aload_3\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: astore_2\n 30: aload_2\n 31: iconst_0\n 32: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 37: checkcast #25 // class java/lang/String\n 40: astore_3\n 41: aload_2\n 42: iconst_1\n 43: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 48: checkcast #25 // class java/lang/String\n 51: astore 4\n 53: aload_3\n 54: ldc #41 // String Game\n 56: invokevirtual #45 // Method java/lang/String.toCharArray:()[C\n 59: dup\n 60: ldc #47 // String toCharArray(...)\n 62: invokestatic #50 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 65: astore 5\n 67: aload 5\n 69: aload 5\n 71: arraylength\n 72: invokestatic #56 // Method java/util/Arrays.copyOf:([CI)[C\n 75: invokestatic #60 // Method kotlin/text/StringsKt.trimStart:(Ljava/lang/String;[C)Ljava/lang/String;\n 78: invokestatic #66 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 81: aload 4\n 83: checkcast #23 // class java/lang/CharSequence\n 86: iconst_1\n 87: anewarray #25 // class java/lang/String\n 90: astore 5\n 92: aload 5\n 94: iconst_0\n 95: ldc #68 // String ;\n 97: aastore\n 98: aload 5\n 100: iconst_0\n 101: iconst_0\n 102: bipush 6\n 104: aconst_null\n 105: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 108: checkcast #70 // class java/lang/Iterable\n 111: astore 5\n 113: istore 27\n 115: iconst_0\n 116: istore 6\n 118: aload 5\n 120: astore 7\n 122: new #72 // class java/util/ArrayList\n 125: dup\n 126: aload 5\n 128: bipush 10\n 130: invokestatic #78 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 133: invokespecial #81 // Method java/util/ArrayList.\"<init>\":(I)V\n 136: checkcast #83 // class java/util/Collection\n 139: astore 8\n 141: iconst_0\n 142: istore 9\n 144: aload 7\n 146: invokeinterface #87, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 151: astore 10\n 153: aload 10\n 155: invokeinterface #93, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 160: ifeq 405\n 163: aload 10\n 165: invokeinterface #97, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 170: astore 11\n 172: aload 8\n 174: aload 11\n 176: checkcast #25 // class java/lang/String\n 179: astore 12\n 181: astore 28\n 183: iconst_0\n 184: istore 13\n 186: aload 12\n 188: checkcast #23 // class java/lang/CharSequence\n 191: iconst_1\n 192: anewarray #25 // class java/lang/String\n 195: astore 14\n 197: aload 14\n 199: iconst_0\n 200: ldc #99 // String ,\n 202: aastore\n 203: aload 14\n 205: iconst_0\n 206: iconst_0\n 207: bipush 6\n 209: aconst_null\n 210: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 213: checkcast #70 // class java/lang/Iterable\n 216: astore 14\n 218: iconst_0\n 219: istore 15\n 221: aload 14\n 223: astore 16\n 225: new #72 // class java/util/ArrayList\n 228: dup\n 229: aload 14\n 231: bipush 10\n 233: invokestatic #78 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 236: invokespecial #81 // Method java/util/ArrayList.\"<init>\":(I)V\n 239: checkcast #83 // class java/util/Collection\n 242: astore 17\n 244: iconst_0\n 245: istore 18\n 247: aload 16\n 249: invokeinterface #87, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 254: astore 19\n 256: aload 19\n 258: invokeinterface #93, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 263: ifeq 386\n 266: aload 19\n 268: invokeinterface #97, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 273: astore 20\n 275: aload 17\n 277: aload 20\n 279: checkcast #25 // class java/lang/String\n 282: astore 21\n 284: astore 22\n 286: iconst_0\n 287: istore 23\n 289: aload 21\n 291: iconst_1\n 292: newarray char\n 294: astore 24\n 296: aload 24\n 298: iconst_0\n 299: bipush 32\n 301: castore\n 302: aload 24\n 304: invokestatic #60 // Method kotlin/text/StringsKt.trimStart:(Ljava/lang/String;[C)Ljava/lang/String;\n 307: checkcast #23 // class java/lang/CharSequence\n 310: iconst_1\n 311: anewarray #25 // class java/lang/String\n 314: astore 24\n 316: aload 24\n 318: iconst_0\n 319: ldc #101 // String\n 321: aastore\n 322: aload 24\n 324: iconst_0\n 325: iconst_0\n 326: bipush 6\n 328: aconst_null\n 329: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 332: astore 25\n 334: aload 25\n 336: iconst_0\n 337: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 342: checkcast #25 // class java/lang/String\n 345: astore 24\n 347: aload 25\n 349: iconst_1\n 350: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 355: checkcast #25 // class java/lang/String\n 358: astore 26\n 360: new #103 // class Day2$Cube\n 363: dup\n 364: aload 26\n 366: aload 24\n 368: invokestatic #66 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 371: invokespecial #106 // Method Day2$Cube.\"<init>\":(Ljava/lang/String;I)V\n 374: aload 22\n 376: swap\n 377: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 382: pop\n 383: goto 256\n 386: aload 17\n 388: checkcast #35 // class java/util/List\n 391: nop\n 392: nop\n 393: aload 28\n 395: swap\n 396: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 401: pop\n 402: goto 153\n 405: aload 8\n 407: checkcast #35 // class java/util/List\n 410: nop\n 411: astore 28\n 413: iload 27\n 415: aload 28\n 417: astore 29\n 419: istore 30\n 421: new #112 // class Day2$Game\n 424: dup\n 425: iload 30\n 427: aload 29\n 429: invokespecial #115 // Method Day2$Game.\"<init>\":(ILjava/util/List;)V\n 432: areturn\n\n public Day2$Game$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #136 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day5.kt
import java.lang.Long.min import kotlin.String import kotlin.collections.List object Day5 { data class Range(val start: Long, val end: Long) data class RangeMapping(val destinationRangeStart: Long, val sourceRangeStart: Long, val rangeLength: Long) { fun next(id: Long): Long { return if (sourceRangeStart <= id && id <= sourceRangeStart + rangeLength) { val offset = id - sourceRangeStart destinationRangeStart + offset } else { id } } fun next(range: Range): Range { val offset = range.start - sourceRangeStart return Range(destinationRangeStart + offset, destinationRangeStart + offset + range.end - range.start) } fun overlaps(id: Long): Boolean { return sourceRangeStart <= id && id < sourceRangeStart + rangeLength } fun overlaps(range: Range): Boolean { return sourceRangeStart <= range.start && range.end <= sourceRangeStart + rangeLength - 1 } } data class Mapping( val category: String, val rangeMappings: List<RangeMapping> ) { fun fork(range: Range): List<Range> { if (rangeMappings.any { it.overlaps(range) }) { return listOf(range) } var start = range.start val end = range.end val ranges = mutableListOf<Range>() while (start <= end) { val closestWithoutGoingOver = rangeMappings.filter { it.sourceRangeStart <= start && start < it.sourceRangeStart + it.rangeLength } .minByOrNull { it.sourceRangeStart - range.start } if (closestWithoutGoingOver != null) { val newEnd = min(end, closestWithoutGoingOver.sourceRangeStart + closestWithoutGoingOver.rangeLength - 1) ranges.add(Range(start, newEnd)) start = newEnd + 1 } else { val closestWithGoingOver = rangeMappings.filter { it.sourceRangeStart + it.rangeLength > start } .minByOrNull { it.sourceRangeStart - start } if (closestWithGoingOver == null) { ranges.add(Range(start, end)) start = end + 1 } else { val newEnd = min(end, closestWithGoingOver.sourceRangeStart - 1) ranges.add(Range(start, newEnd)) start = newEnd + 1 } } } return ranges } companion object { fun parseMappings(input: List<String>): List<Mapping> { var remainingInput = input val mappings = mutableListOf<Mapping>() while (remainingInput.isNotEmpty()) { val category = remainingInput.first().split(" ").first() val ranges = remainingInput.drop(1).takeWhile { it.isNotEmpty() }.map { val (destinationRangeStart, sourceRangeStart, rangeLength) = it.split(" ") RangeMapping( destinationRangeStart.toLong(), sourceRangeStart.toLong(), rangeLength.toLong() ) } mappings.add(Mapping(category, ranges)) remainingInput = remainingInput.drop(ranges.size + 2) } return mappings } } } fun part1(input: List<String>): String { val seeds = input.first().replace("seeds: ", "") .split(" ") .map { it.toLong() } val mappings = Mapping.parseMappings(input.drop(2)) val finalMappings = mappings.fold(seeds) { acc, mapping -> acc.map { id -> val range = mapping.rangeMappings.find { it.overlaps(id) } range?.next(id) ?: id } } return finalMappings.min().toString() } fun part2(input: List<String>): String { val ranges = input.first().replace("seeds: ", "") .split(" ") .map { it.toLong() } .chunked(2) .map { Range(it.first(), it.first() + it.last()) } val mappings = Mapping.parseMappings(input.drop(2)) val finalRanges = mappings.fold(ranges) { transformedRanges, mapping -> transformedRanges.flatMap { range -> val nextRanges = mapping.fork(range).map { forkedRange -> val overlaps = mapping.rangeMappings.filter { it.overlaps(forkedRange) } .minByOrNull { it.sourceRangeStart - forkedRange.start } overlaps?.next(forkedRange) ?: forkedRange } nextRanges } } return finalRanges.minBy { it.start }.start.toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day5.class", "javap": "Compiled from \"Day5.kt\"\npublic final class Day5 {\n public static final Day5 INSTANCE;\n\n private Day5();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: invokestatic #28 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #30 // class java/lang/String\n 13: ldc #32 // String seeds:\n 15: ldc #34 // String\n 17: iconst_0\n 18: iconst_4\n 19: aconst_null\n 20: invokestatic #40 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 23: checkcast #42 // class java/lang/CharSequence\n 26: iconst_1\n 27: anewarray #30 // class java/lang/String\n 30: astore_3\n 31: aload_3\n 32: iconst_0\n 33: ldc #44 // String\n 35: aastore\n 36: aload_3\n 37: iconst_0\n 38: iconst_0\n 39: bipush 6\n 41: aconst_null\n 42: invokestatic #48 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 45: checkcast #50 // class java/lang/Iterable\n 48: astore_3\n 49: nop\n 50: iconst_0\n 51: istore 4\n 53: aload_3\n 54: astore 5\n 56: new #52 // class java/util/ArrayList\n 59: dup\n 60: aload_3\n 61: bipush 10\n 63: invokestatic #56 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 66: invokespecial #59 // Method java/util/ArrayList.\"<init>\":(I)V\n 69: checkcast #61 // class java/util/Collection\n 72: astore 6\n 74: iconst_0\n 75: istore 7\n 77: aload 5\n 79: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 84: astore 8\n 86: aload 8\n 88: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 93: ifeq 140\n 96: aload 8\n 98: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 103: astore 9\n 105: aload 6\n 107: aload 9\n 109: checkcast #30 // class java/lang/String\n 112: astore 10\n 114: astore 30\n 116: iconst_0\n 117: istore 11\n 119: aload 10\n 121: invokestatic #81 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 124: nop\n 125: invokestatic #85 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 128: aload 30\n 130: swap\n 131: invokeinterface #89, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 136: pop\n 137: goto 86\n 140: aload 6\n 142: checkcast #91 // class java/util/List\n 145: nop\n 146: astore_2\n 147: getstatic #97 // Field Day5$Mapping.Companion:LDay5$Mapping$Companion;\n 150: aload_1\n 151: checkcast #50 // class java/lang/Iterable\n 154: iconst_2\n 155: invokestatic #101 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 158: invokevirtual #107 // Method Day5$Mapping$Companion.parseMappings:(Ljava/util/List;)Ljava/util/List;\n 161: astore_3\n 162: aload_3\n 163: checkcast #50 // class java/lang/Iterable\n 166: astore 5\n 168: iconst_0\n 169: istore 6\n 171: aload_2\n 172: astore 7\n 174: aload 5\n 176: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 181: astore 8\n 183: aload 8\n 185: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 190: ifeq 410\n 193: aload 8\n 195: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 200: astore 9\n 202: aload 7\n 204: aload 9\n 206: checkcast #93 // class Day5$Mapping\n 209: astore 10\n 211: astore 11\n 213: iconst_0\n 214: istore 12\n 216: aload 11\n 218: checkcast #50 // class java/lang/Iterable\n 221: astore 13\n 223: iconst_0\n 224: istore 14\n 226: aload 13\n 228: astore 15\n 230: new #52 // class java/util/ArrayList\n 233: dup\n 234: aload 13\n 236: bipush 10\n 238: invokestatic #56 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 241: invokespecial #59 // Method java/util/ArrayList.\"<init>\":(I)V\n 244: checkcast #61 // class java/util/Collection\n 247: astore 16\n 249: iconst_0\n 250: istore 17\n 252: aload 15\n 254: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 259: astore 18\n 261: aload 18\n 263: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 268: ifeq 398\n 271: aload 18\n 273: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 278: astore 19\n 280: aload 16\n 282: aload 19\n 284: checkcast #109 // class java/lang/Number\n 287: invokevirtual #113 // Method java/lang/Number.longValue:()J\n 290: lstore 20\n 292: astore 22\n 294: iconst_0\n 295: istore 23\n 297: aload 10\n 299: invokevirtual #117 // Method Day5$Mapping.getRangeMappings:()Ljava/util/List;\n 302: checkcast #50 // class java/lang/Iterable\n 305: astore 24\n 307: aload 24\n 309: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 314: astore 25\n 316: aload 25\n 318: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 323: ifeq 360\n 326: aload 25\n 328: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 333: astore 26\n 335: aload 26\n 337: checkcast #119 // class Day5$RangeMapping\n 340: astore 27\n 342: iconst_0\n 343: istore 28\n 345: aload 27\n 347: lload 20\n 349: invokevirtual #123 // Method Day5$RangeMapping.overlaps:(J)Z\n 352: ifeq 316\n 355: aload 26\n 357: goto 361\n 360: aconst_null\n 361: checkcast #119 // class Day5$RangeMapping\n 364: astore 29\n 366: aload 29\n 368: dup\n 369: ifnull 380\n 372: lload 20\n 374: invokevirtual #126 // Method Day5$RangeMapping.next:(J)J\n 377: goto 383\n 380: pop\n 381: lload 20\n 383: invokestatic #85 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 386: aload 22\n 388: swap\n 389: invokeinterface #89, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 394: pop\n 395: goto 261\n 398: aload 16\n 400: checkcast #91 // class java/util/List\n 403: nop\n 404: nop\n 405: astore 7\n 407: goto 183\n 410: aload 7\n 412: astore 4\n 414: aload 4\n 416: checkcast #50 // class java/lang/Iterable\n 419: invokestatic #130 // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 422: checkcast #109 // class java/lang/Number\n 425: invokevirtual #113 // Method java/lang/Number.longValue:()J\n 428: invokestatic #133 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 431: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: invokestatic #28 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #30 // class java/lang/String\n 13: ldc #32 // String seeds:\n 15: ldc #34 // String\n 17: iconst_0\n 18: iconst_4\n 19: aconst_null\n 20: invokestatic #40 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 23: checkcast #42 // class java/lang/CharSequence\n 26: iconst_1\n 27: anewarray #30 // class java/lang/String\n 30: astore_3\n 31: aload_3\n 32: iconst_0\n 33: ldc #44 // String\n 35: aastore\n 36: aload_3\n 37: iconst_0\n 38: iconst_0\n 39: bipush 6\n 41: aconst_null\n 42: invokestatic #48 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 45: checkcast #50 // class java/lang/Iterable\n 48: astore_3\n 49: nop\n 50: iconst_0\n 51: istore 4\n 53: aload_3\n 54: astore 5\n 56: new #52 // class java/util/ArrayList\n 59: dup\n 60: aload_3\n 61: bipush 10\n 63: invokestatic #56 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 66: invokespecial #59 // Method java/util/ArrayList.\"<init>\":(I)V\n 69: checkcast #61 // class java/util/Collection\n 72: astore 6\n 74: iconst_0\n 75: istore 7\n 77: aload 5\n 79: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 84: astore 8\n 86: aload 8\n 88: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 93: ifeq 140\n 96: aload 8\n 98: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 103: astore 9\n 105: aload 6\n 107: aload 9\n 109: checkcast #30 // class java/lang/String\n 112: astore 11\n 114: astore 47\n 116: iconst_0\n 117: istore 12\n 119: aload 11\n 121: invokestatic #81 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 124: nop\n 125: invokestatic #85 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 128: aload 47\n 130: swap\n 131: invokeinterface #89, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 136: pop\n 137: goto 86\n 140: aload 6\n 142: checkcast #91 // class java/util/List\n 145: nop\n 146: checkcast #50 // class java/lang/Iterable\n 149: iconst_2\n 150: invokestatic #168 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 153: checkcast #50 // class java/lang/Iterable\n 156: astore_3\n 157: nop\n 158: iconst_0\n 159: istore 4\n 161: aload_3\n 162: astore 5\n 164: new #52 // class java/util/ArrayList\n 167: dup\n 168: aload_3\n 169: bipush 10\n 171: invokestatic #56 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 174: invokespecial #59 // Method java/util/ArrayList.\"<init>\":(I)V\n 177: checkcast #61 // class java/util/Collection\n 180: astore 6\n 182: iconst_0\n 183: istore 7\n 185: aload 5\n 187: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 192: astore 8\n 194: aload 8\n 196: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 201: ifeq 280\n 204: aload 8\n 206: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 211: astore 9\n 213: aload 6\n 215: aload 9\n 217: checkcast #91 // class java/util/List\n 220: astore 11\n 222: astore 47\n 224: iconst_0\n 225: istore 12\n 227: new #170 // class Day5$Range\n 230: dup\n 231: aload 11\n 233: invokestatic #28 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 236: checkcast #109 // class java/lang/Number\n 239: invokevirtual #113 // Method java/lang/Number.longValue:()J\n 242: aload 11\n 244: invokestatic #28 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 247: checkcast #109 // class java/lang/Number\n 250: invokevirtual #113 // Method java/lang/Number.longValue:()J\n 253: aload 11\n 255: invokestatic #173 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 258: checkcast #109 // class java/lang/Number\n 261: invokevirtual #113 // Method java/lang/Number.longValue:()J\n 264: ladd\n 265: invokespecial #176 // Method Day5$Range.\"<init>\":(JJ)V\n 268: aload 47\n 270: swap\n 271: invokeinterface #89, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 276: pop\n 277: goto 194\n 280: aload 6\n 282: checkcast #91 // class java/util/List\n 285: nop\n 286: astore_2\n 287: getstatic #97 // Field Day5$Mapping.Companion:LDay5$Mapping$Companion;\n 290: aload_1\n 291: checkcast #50 // class java/lang/Iterable\n 294: iconst_2\n 295: invokestatic #101 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 298: invokevirtual #107 // Method Day5$Mapping$Companion.parseMappings:(Ljava/util/List;)Ljava/util/List;\n 301: astore_3\n 302: aload_3\n 303: checkcast #50 // class java/lang/Iterable\n 306: astore 5\n 308: iconst_0\n 309: istore 6\n 311: aload_2\n 312: astore 7\n 314: aload 5\n 316: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 321: astore 8\n 323: aload 8\n 325: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 330: ifeq 817\n 333: aload 8\n 335: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 340: astore 9\n 342: aload 7\n 344: aload 9\n 346: checkcast #93 // class Day5$Mapping\n 349: astore 11\n 351: astore 12\n 353: iconst_0\n 354: istore 14\n 356: aload 12\n 358: checkcast #50 // class java/lang/Iterable\n 361: astore 15\n 363: iconst_0\n 364: istore 16\n 366: aload 15\n 368: astore 17\n 370: new #52 // class java/util/ArrayList\n 373: dup\n 374: invokespecial #177 // Method java/util/ArrayList.\"<init>\":()V\n 377: checkcast #61 // class java/util/Collection\n 380: astore 18\n 382: iconst_0\n 383: istore 19\n 385: aload 17\n 387: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 392: astore 20\n 394: aload 20\n 396: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 401: ifeq 805\n 404: aload 20\n 406: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 411: astore 21\n 413: aload 21\n 415: checkcast #170 // class Day5$Range\n 418: astore 22\n 420: iconst_0\n 421: istore 23\n 423: aload 11\n 425: aload 22\n 427: invokevirtual #181 // Method Day5$Mapping.fork:(LDay5$Range;)Ljava/util/List;\n 430: checkcast #50 // class java/lang/Iterable\n 433: astore 24\n 435: iconst_0\n 436: istore 25\n 438: aload 24\n 440: astore 26\n 442: new #52 // class java/util/ArrayList\n 445: dup\n 446: aload 24\n 448: bipush 10\n 450: invokestatic #56 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 453: invokespecial #59 // Method java/util/ArrayList.\"<init>\":(I)V\n 456: checkcast #61 // class java/util/Collection\n 459: astore 27\n 461: iconst_0\n 462: istore 28\n 464: aload 26\n 466: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 471: astore 29\n 473: aload 29\n 475: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 480: ifeq 779\n 483: aload 29\n 485: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 490: astore 30\n 492: aload 27\n 494: aload 30\n 496: checkcast #170 // class Day5$Range\n 499: astore 31\n 501: astore 32\n 503: iconst_0\n 504: istore 33\n 506: aload 11\n 508: invokevirtual #117 // Method Day5$Mapping.getRangeMappings:()Ljava/util/List;\n 511: checkcast #50 // class java/lang/Iterable\n 514: astore 34\n 516: iconst_0\n 517: istore 35\n 519: aload 34\n 521: astore 36\n 523: new #52 // class java/util/ArrayList\n 526: dup\n 527: invokespecial #177 // Method java/util/ArrayList.\"<init>\":()V\n 530: checkcast #61 // class java/util/Collection\n 533: astore 37\n 535: iconst_0\n 536: istore 38\n 538: aload 36\n 540: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 545: astore 40\n 547: aload 40\n 549: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 554: ifeq 599\n 557: aload 40\n 559: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 564: astore 41\n 566: aload 41\n 568: checkcast #119 // class Day5$RangeMapping\n 571: astore 43\n 573: iconst_0\n 574: istore 44\n 576: aload 43\n 578: aload 31\n 580: invokevirtual #184 // Method Day5$RangeMapping.overlaps:(LDay5$Range;)Z\n 583: ifeq 547\n 586: aload 37\n 588: aload 41\n 590: invokeinterface #89, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 595: pop\n 596: goto 547\n 599: aload 37\n 601: checkcast #91 // class java/util/List\n 604: nop\n 605: checkcast #50 // class java/lang/Iterable\n 608: astore 34\n 610: nop\n 611: iconst_0\n 612: istore 35\n 614: aload 34\n 616: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 621: astore 36\n 623: aload 36\n 625: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 630: ifne 637\n 633: aconst_null\n 634: goto 744\n 637: aload 36\n 639: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 644: astore 37\n 646: aload 36\n 648: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 653: ifne 661\n 656: aload 37\n 658: goto 744\n 661: aload 37\n 663: checkcast #119 // class Day5$RangeMapping\n 666: astore 38\n 668: iconst_0\n 669: istore 40\n 671: aload 38\n 673: invokevirtual #187 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 676: aload 31\n 678: invokevirtual #190 // Method Day5$Range.getStart:()J\n 681: lsub\n 682: lstore 38\n 684: aload 36\n 686: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 691: astore 40\n 693: aload 40\n 695: checkcast #119 // class Day5$RangeMapping\n 698: astore 41\n 700: iconst_0\n 701: istore 43\n 703: aload 41\n 705: invokevirtual #187 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 708: aload 31\n 710: invokevirtual #190 // Method Day5$Range.getStart:()J\n 713: lsub\n 714: lstore 41\n 716: lload 38\n 718: lload 41\n 720: lcmp\n 721: ifle 732\n 724: aload 40\n 726: astore 37\n 728: lload 41\n 730: lstore 38\n 732: aload 36\n 734: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 739: ifne 684\n 742: aload 37\n 744: checkcast #119 // class Day5$RangeMapping\n 747: astore 45\n 749: aload 45\n 751: dup\n 752: ifnull 764\n 755: aload 31\n 757: invokevirtual #193 // Method Day5$RangeMapping.next:(LDay5$Range;)LDay5$Range;\n 760: dup\n 761: ifnonnull 767\n 764: pop\n 765: aload 31\n 767: aload 32\n 769: swap\n 770: invokeinterface #89, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 775: pop\n 776: goto 473\n 779: aload 27\n 781: checkcast #91 // class java/util/List\n 784: nop\n 785: astore 46\n 787: aload 46\n 789: checkcast #50 // class java/lang/Iterable\n 792: astore 22\n 794: aload 18\n 796: aload 22\n 798: invokestatic #197 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 801: pop\n 802: goto 394\n 805: aload 18\n 807: checkcast #91 // class java/util/List\n 810: nop\n 811: nop\n 812: astore 7\n 814: goto 323\n 817: aload 7\n 819: astore 4\n 821: aload 4\n 823: checkcast #50 // class java/lang/Iterable\n 826: astore 5\n 828: iconst_0\n 829: istore 6\n 831: aload 5\n 833: invokeinterface #65, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 838: astore 7\n 840: aload 7\n 842: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 847: ifne 858\n 850: new #199 // class java/util/NoSuchElementException\n 853: dup\n 854: invokespecial #200 // Method java/util/NoSuchElementException.\"<init>\":()V\n 857: athrow\n 858: aload 7\n 860: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 865: astore 8\n 867: aload 7\n 869: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 874: ifne 882\n 877: aload 8\n 879: goto 953\n 882: aload 8\n 884: checkcast #170 // class Day5$Range\n 887: astore 9\n 889: iconst_0\n 890: istore 11\n 892: aload 9\n 894: invokevirtual #190 // Method Day5$Range.getStart:()J\n 897: lstore 9\n 899: aload 7\n 901: invokeinterface #75, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 906: astore 11\n 908: aload 11\n 910: checkcast #170 // class Day5$Range\n 913: astore 12\n 915: iconst_0\n 916: istore 14\n 918: aload 12\n 920: invokevirtual #190 // Method Day5$Range.getStart:()J\n 923: lstore 12\n 925: lload 9\n 927: lload 12\n 929: lcmp\n 930: ifle 941\n 933: aload 11\n 935: astore 8\n 937: lload 12\n 939: lstore 9\n 941: aload 7\n 943: invokeinterface #71, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 948: ifne 899\n 951: aload 8\n 953: checkcast #170 // class Day5$Range\n 956: invokevirtual #190 // Method Day5$Range.getStart:()J\n 959: invokestatic #133 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 962: areturn\n\n static {};\n Code:\n 0: new #2 // class Day5\n 3: dup\n 4: invokespecial #236 // Method \"<init>\":()V\n 7: putstatic #239 // Field INSTANCE:LDay5;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day5$Mapping.class", "javap": "Compiled from \"Day5.kt\"\npublic final class Day5$Mapping {\n public static final Day5$Mapping$Companion Companion;\n\n private final java.lang.String category;\n\n private final java.util.List<Day5$RangeMapping> rangeMappings;\n\n public Day5$Mapping(java.lang.String, java.util.List<Day5$RangeMapping>);\n Code:\n 0: aload_1\n 1: ldc #10 // String category\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String rangeMappings\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #21 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #24 // Field category:Ljava/lang/String;\n 21: aload_0\n 22: aload_2\n 23: putfield #27 // Field rangeMappings:Ljava/util/List;\n 26: return\n\n public final java.lang.String getCategory();\n Code:\n 0: aload_0\n 1: getfield #24 // Field category:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day5$RangeMapping> getRangeMappings();\n Code:\n 0: aload_0\n 1: getfield #27 // Field rangeMappings:Ljava/util/List;\n 4: areturn\n\n public final java.util.List<Day5$Range> fork(Day5$Range);\n Code:\n 0: aload_1\n 1: ldc #39 // String range\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #27 // Field rangeMappings:Ljava/util/List;\n 10: checkcast #41 // class java/lang/Iterable\n 13: astore_2\n 14: iconst_0\n 15: istore_3\n 16: aload_2\n 17: instanceof #43 // class java/util/Collection\n 20: ifeq 39\n 23: aload_2\n 24: checkcast #43 // class java/util/Collection\n 27: invokeinterface #47, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 32: ifeq 39\n 35: iconst_0\n 36: goto 90\n 39: aload_2\n 40: invokeinterface #51, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 4\n 47: aload 4\n 49: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 89\n 57: aload 4\n 59: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 5\n 66: aload 5\n 68: checkcast #62 // class Day5$RangeMapping\n 71: astore 6\n 73: iconst_0\n 74: istore 7\n 76: aload 6\n 78: aload_1\n 79: invokevirtual #66 // Method Day5$RangeMapping.overlaps:(LDay5$Range;)Z\n 82: ifeq 47\n 85: iconst_1\n 86: goto 90\n 89: iconst_0\n 90: ifeq 98\n 93: aload_1\n 94: invokestatic #72 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 97: areturn\n 98: lconst_0\n 99: lstore 21\n 101: aload_1\n 102: invokevirtual #78 // Method Day5$Range.getStart:()J\n 105: lstore 21\n 107: aload_1\n 108: invokevirtual #81 // Method Day5$Range.getEnd:()J\n 111: lstore_3\n 112: new #83 // class java/util/ArrayList\n 115: dup\n 116: invokespecial #84 // Method java/util/ArrayList.\"<init>\":()V\n 119: checkcast #86 // class java/util/List\n 122: astore 5\n 124: lload 21\n 126: lload_3\n 127: lcmp\n 128: ifgt 772\n 131: aload_0\n 132: getfield #27 // Field rangeMappings:Ljava/util/List;\n 135: checkcast #41 // class java/lang/Iterable\n 138: astore 7\n 140: iconst_0\n 141: istore 8\n 143: aload 7\n 145: astore 9\n 147: new #83 // class java/util/ArrayList\n 150: dup\n 151: invokespecial #84 // Method java/util/ArrayList.\"<init>\":()V\n 154: checkcast #43 // class java/util/Collection\n 157: astore 10\n 159: iconst_0\n 160: istore 11\n 162: aload 9\n 164: invokeinterface #51, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 169: astore 13\n 171: aload 13\n 173: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 178: ifeq 249\n 181: aload 13\n 183: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 188: astore 15\n 190: aload 15\n 192: checkcast #62 // class Day5$RangeMapping\n 195: astore 17\n 197: iconst_0\n 198: istore 19\n 200: aload 17\n 202: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 205: lload 21\n 207: lcmp\n 208: ifgt 232\n 211: lload 21\n 213: aload 17\n 215: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 218: aload 17\n 220: invokevirtual #92 // Method Day5$RangeMapping.getRangeLength:()J\n 223: ladd\n 224: lcmp\n 225: ifge 232\n 228: iconst_1\n 229: goto 233\n 232: iconst_0\n 233: ifeq 171\n 236: aload 10\n 238: aload 15\n 240: invokeinterface #96, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 245: pop\n 246: goto 171\n 249: aload 10\n 251: checkcast #86 // class java/util/List\n 254: nop\n 255: checkcast #41 // class java/lang/Iterable\n 258: astore 7\n 260: nop\n 261: iconst_0\n 262: istore 8\n 264: aload 7\n 266: invokeinterface #51, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 271: astore 9\n 273: aload 9\n 275: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 280: ifne 287\n 283: aconst_null\n 284: goto 392\n 287: aload 9\n 289: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 294: astore 10\n 296: aload 9\n 298: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 303: ifne 311\n 306: aload 10\n 308: goto 392\n 311: aload 10\n 313: checkcast #62 // class Day5$RangeMapping\n 316: astore 11\n 318: iconst_0\n 319: istore 13\n 321: aload 11\n 323: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 326: aload_1\n 327: invokevirtual #78 // Method Day5$Range.getStart:()J\n 330: lsub\n 331: lstore 11\n 333: aload 9\n 335: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 340: astore 13\n 342: aload 13\n 344: checkcast #62 // class Day5$RangeMapping\n 347: astore 15\n 349: iconst_0\n 350: istore 17\n 352: aload 15\n 354: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 357: aload_1\n 358: invokevirtual #78 // Method Day5$Range.getStart:()J\n 361: lsub\n 362: lstore 15\n 364: lload 11\n 366: lload 15\n 368: lcmp\n 369: ifle 380\n 372: aload 13\n 374: astore 10\n 376: lload 15\n 378: lstore 11\n 380: aload 9\n 382: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 387: ifne 333\n 390: aload 10\n 392: checkcast #62 // class Day5$RangeMapping\n 395: astore 6\n 397: aload 6\n 399: ifnull 449\n 402: lload_3\n 403: aload 6\n 405: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 408: aload 6\n 410: invokevirtual #92 // Method Day5$RangeMapping.getRangeLength:()J\n 413: ladd\n 414: lconst_1\n 415: lsub\n 416: invokestatic #102 // Method java/lang/Long.min:(JJ)J\n 419: lstore 7\n 421: aload 5\n 423: new #74 // class Day5$Range\n 426: dup\n 427: lload 21\n 429: lload 7\n 431: invokespecial #105 // Method Day5$Range.\"<init>\":(JJ)V\n 434: invokeinterface #106, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 439: pop\n 440: lload 7\n 442: lconst_1\n 443: ladd\n 444: lstore 21\n 446: goto 124\n 449: aload_0\n 450: getfield #27 // Field rangeMappings:Ljava/util/List;\n 453: checkcast #41 // class java/lang/Iterable\n 456: astore 8\n 458: iconst_0\n 459: istore 9\n 461: aload 8\n 463: astore 10\n 465: new #83 // class java/util/ArrayList\n 468: dup\n 469: invokespecial #84 // Method java/util/ArrayList.\"<init>\":()V\n 472: checkcast #43 // class java/util/Collection\n 475: astore 11\n 477: iconst_0\n 478: istore 13\n 480: aload 10\n 482: invokeinterface #51, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 487: astore 15\n 489: aload 15\n 491: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 496: ifeq 556\n 499: aload 15\n 501: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 506: astore 17\n 508: aload 17\n 510: checkcast #62 // class Day5$RangeMapping\n 513: astore 19\n 515: iconst_0\n 516: istore 20\n 518: aload 19\n 520: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 523: aload 19\n 525: invokevirtual #92 // Method Day5$RangeMapping.getRangeLength:()J\n 528: ladd\n 529: lload 21\n 531: lcmp\n 532: ifle 539\n 535: iconst_1\n 536: goto 540\n 539: iconst_0\n 540: ifeq 489\n 543: aload 11\n 545: aload 17\n 547: invokeinterface #96, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 552: pop\n 553: goto 489\n 556: aload 11\n 558: checkcast #86 // class java/util/List\n 561: nop\n 562: checkcast #41 // class java/lang/Iterable\n 565: astore 8\n 567: nop\n 568: iconst_0\n 569: istore 9\n 571: aload 8\n 573: invokeinterface #51, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 578: astore 10\n 580: aload 10\n 582: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 587: ifne 594\n 590: aconst_null\n 591: goto 695\n 594: aload 10\n 596: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 601: astore 11\n 603: aload 10\n 605: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 610: ifne 618\n 613: aload 11\n 615: goto 695\n 618: aload 11\n 620: checkcast #62 // class Day5$RangeMapping\n 623: astore 13\n 625: iconst_0\n 626: istore 15\n 628: aload 13\n 630: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 633: lload 21\n 635: lsub\n 636: lstore 13\n 638: aload 10\n 640: invokeinterface #60, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 645: astore 15\n 647: aload 15\n 649: checkcast #62 // class Day5$RangeMapping\n 652: astore 17\n 654: iconst_0\n 655: istore 19\n 657: aload 17\n 659: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 662: lload 21\n 664: lsub\n 665: lstore 17\n 667: lload 13\n 669: lload 17\n 671: lcmp\n 672: ifle 683\n 675: aload 15\n 677: astore 11\n 679: lload 17\n 681: lstore 13\n 683: aload 10\n 685: invokeinterface #56, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 690: ifne 638\n 693: aload 11\n 695: checkcast #62 // class Day5$RangeMapping\n 698: astore 7\n 700: aload 7\n 702: ifnonnull 731\n 705: aload 5\n 707: new #74 // class Day5$Range\n 710: dup\n 711: lload 21\n 713: lload_3\n 714: invokespecial #105 // Method Day5$Range.\"<init>\":(JJ)V\n 717: invokeinterface #106, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 722: pop\n 723: lload_3\n 724: lconst_1\n 725: ladd\n 726: lstore 21\n 728: goto 124\n 731: lload_3\n 732: aload 7\n 734: invokevirtual #89 // Method Day5$RangeMapping.getSourceRangeStart:()J\n 737: lconst_1\n 738: lsub\n 739: invokestatic #102 // Method java/lang/Long.min:(JJ)J\n 742: lstore 8\n 744: aload 5\n 746: new #74 // class Day5$Range\n 749: dup\n 750: lload 21\n 752: lload 8\n 754: invokespecial #105 // Method Day5$Range.\"<init>\":(JJ)V\n 757: invokeinterface #106, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 762: pop\n 763: lload 8\n 765: lconst_1\n 766: ladd\n 767: lstore 21\n 769: goto 124\n 772: aload 5\n 774: areturn\n\n public final java.lang.String component1();\n Code:\n 0: aload_0\n 1: getfield #24 // Field category:Ljava/lang/String;\n 4: areturn\n\n public final java.util.List<Day5$RangeMapping> component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field rangeMappings:Ljava/util/List;\n 4: areturn\n\n public final Day5$Mapping copy(java.lang.String, java.util.List<Day5$RangeMapping>);\n Code:\n 0: aload_1\n 1: ldc #10 // String category\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_2\n 7: ldc #18 // String rangeMappings\n 9: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day5$Mapping\n 15: dup\n 16: aload_1\n 17: aload_2\n 18: invokespecial #149 // Method \"<init>\":(Ljava/lang/String;Ljava/util/List;)V\n 21: areturn\n\n public static Day5$Mapping copy$default(Day5$Mapping, java.lang.String, java.util.List, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #24 // Field category:Ljava/lang/String;\n 10: astore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #27 // Field rangeMappings:Ljava/util/List;\n 21: astore_2\n 22: aload_0\n 23: aload_1\n 24: aload_2\n 25: invokevirtual #153 // Method copy:(Ljava/lang/String;Ljava/util/List;)LDay5$Mapping;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #156 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #157 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #159 // String Mapping(category=\n 9: invokevirtual #163 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #24 // Field category:Ljava/lang/String;\n 16: invokevirtual #163 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 19: ldc #165 // String , rangeMappings=\n 21: invokevirtual #163 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field rangeMappings:Ljava/util/List;\n 28: invokevirtual #168 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #171 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #173 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #24 // Field category:Ljava/lang/String;\n 4: invokevirtual #179 // Method java/lang/String.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field rangeMappings:Ljava/util/List;\n 16: invokevirtual #180 // Method java/lang/Object.hashCode:()I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day5$Mapping\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day5$Mapping\n 20: astore_2\n 21: aload_0\n 22: getfield #24 // Field category:Ljava/lang/String;\n 25: aload_2\n 26: getfield #24 // Field category:Ljava/lang/String;\n 29: invokestatic #187 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 32: ifne 37\n 35: iconst_0\n 36: ireturn\n 37: aload_0\n 38: getfield #27 // Field rangeMappings:Ljava/util/List;\n 41: aload_2\n 42: getfield #27 // Field rangeMappings:Ljava/util/List;\n 45: invokestatic #187 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 48: ifne 53\n 51: iconst_0\n 52: ireturn\n 53: iconst_1\n 54: ireturn\n\n static {};\n Code:\n 0: new #191 // class Day5$Mapping$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #194 // Method Day5$Mapping$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #198 // Field Companion:LDay5$Mapping$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day5$Mapping$Companion.class", "javap": "Compiled from \"Day5.kt\"\npublic final class Day5$Mapping$Companion {\n private Day5$Mapping$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.util.List<Day5$Mapping> parseMappings(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: astore_2\n 8: new #24 // class java/util/ArrayList\n 11: dup\n 12: invokespecial #25 // Method java/util/ArrayList.\"<init>\":()V\n 15: checkcast #27 // class java/util/List\n 18: astore_3\n 19: aload_2\n 20: checkcast #29 // class java/util/Collection\n 23: invokeinterface #33, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 28: ifne 35\n 31: iconst_1\n 32: goto 36\n 35: iconst_0\n 36: ifeq 406\n 39: aload_2\n 40: invokestatic #39 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 43: checkcast #41 // class java/lang/CharSequence\n 46: iconst_1\n 47: anewarray #43 // class java/lang/String\n 50: astore 5\n 52: aload 5\n 54: iconst_0\n 55: ldc #45 // String\n 57: aastore\n 58: aload 5\n 60: iconst_0\n 61: iconst_0\n 62: bipush 6\n 64: aconst_null\n 65: invokestatic #51 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 68: invokestatic #39 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 71: checkcast #43 // class java/lang/String\n 74: astore 4\n 76: aload_2\n 77: checkcast #53 // class java/lang/Iterable\n 80: iconst_1\n 81: invokestatic #57 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 84: checkcast #53 // class java/lang/Iterable\n 87: astore 6\n 89: iconst_0\n 90: istore 7\n 92: new #24 // class java/util/ArrayList\n 95: dup\n 96: invokespecial #25 // Method java/util/ArrayList.\"<init>\":()V\n 99: astore 8\n 101: aload 6\n 103: invokeinterface #61, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 108: astore 9\n 110: aload 9\n 112: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 117: ifeq 175\n 120: aload 9\n 122: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 127: astore 10\n 129: aload 10\n 131: checkcast #43 // class java/lang/String\n 134: astore 11\n 136: iconst_0\n 137: istore 12\n 139: aload 11\n 141: checkcast #41 // class java/lang/CharSequence\n 144: invokeinterface #74, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 149: ifle 156\n 152: iconst_1\n 153: goto 157\n 156: iconst_0\n 157: nop\n 158: ifne 164\n 161: goto 175\n 164: aload 8\n 166: aload 10\n 168: invokevirtual #78 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 171: pop\n 172: goto 110\n 175: aload 8\n 177: checkcast #27 // class java/util/List\n 180: checkcast #53 // class java/lang/Iterable\n 183: astore 6\n 185: nop\n 186: iconst_0\n 187: istore 7\n 189: aload 6\n 191: astore 8\n 193: new #24 // class java/util/ArrayList\n 196: dup\n 197: aload 6\n 199: bipush 10\n 201: invokestatic #82 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 204: invokespecial #85 // Method java/util/ArrayList.\"<init>\":(I)V\n 207: checkcast #29 // class java/util/Collection\n 210: astore 9\n 212: iconst_0\n 213: istore 10\n 215: aload 8\n 217: invokeinterface #61, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 222: astore 11\n 224: aload 11\n 226: invokeinterface #66, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 231: ifeq 360\n 234: aload 11\n 236: invokeinterface #70, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 241: astore 12\n 243: aload 9\n 245: aload 12\n 247: checkcast #43 // class java/lang/String\n 250: astore 13\n 252: astore 19\n 254: iconst_0\n 255: istore 14\n 257: aload 13\n 259: checkcast #41 // class java/lang/CharSequence\n 262: iconst_1\n 263: anewarray #43 // class java/lang/String\n 266: astore 15\n 268: aload 15\n 270: iconst_0\n 271: ldc #45 // String\n 273: aastore\n 274: aload 15\n 276: iconst_0\n 277: iconst_0\n 278: bipush 6\n 280: aconst_null\n 281: invokestatic #51 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 284: astore 16\n 286: aload 16\n 288: iconst_0\n 289: invokeinterface #89, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 294: checkcast #43 // class java/lang/String\n 297: astore 15\n 299: aload 16\n 301: iconst_1\n 302: invokeinterface #89, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 307: checkcast #43 // class java/lang/String\n 310: astore 17\n 312: aload 16\n 314: iconst_2\n 315: invokeinterface #89, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 320: checkcast #43 // class java/lang/String\n 323: astore 18\n 325: new #91 // class Day5$RangeMapping\n 328: dup\n 329: aload 15\n 331: invokestatic #97 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 334: aload 17\n 336: invokestatic #97 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 339: aload 18\n 341: invokestatic #97 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 344: invokespecial #100 // Method Day5$RangeMapping.\"<init>\":(JJJ)V\n 347: nop\n 348: aload 19\n 350: swap\n 351: invokeinterface #101, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 356: pop\n 357: goto 224\n 360: aload 9\n 362: checkcast #27 // class java/util/List\n 365: nop\n 366: astore 5\n 368: aload_3\n 369: new #103 // class Day5$Mapping\n 372: dup\n 373: aload 4\n 375: aload 5\n 377: invokespecial #106 // Method Day5$Mapping.\"<init>\":(Ljava/lang/String;Ljava/util/List;)V\n 380: invokeinterface #107, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 385: pop\n 386: aload_2\n 387: checkcast #53 // class java/lang/Iterable\n 390: aload 5\n 392: invokeinterface #110, 1 // InterfaceMethod java/util/List.size:()I\n 397: iconst_2\n 398: iadd\n 399: invokestatic #57 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;\n 402: astore_2\n 403: goto 19\n 406: aload_3\n 407: areturn\n\n public Day5$Mapping$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #141 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day5$RangeMapping.class", "javap": "Compiled from \"Day5.kt\"\npublic final class Day5$RangeMapping {\n private final long destinationRangeStart;\n\n private final long sourceRangeStart;\n\n private final long rangeLength;\n\n public Day5$RangeMapping(long, long, long);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: lload_1\n 6: putfield #13 // Field destinationRangeStart:J\n 9: aload_0\n 10: lload_3\n 11: putfield #16 // Field sourceRangeStart:J\n 14: aload_0\n 15: lload 5\n 17: putfield #19 // Field rangeLength:J\n 20: return\n\n public final long getDestinationRangeStart();\n Code:\n 0: aload_0\n 1: getfield #13 // Field destinationRangeStart:J\n 4: lreturn\n\n public final long getSourceRangeStart();\n Code:\n 0: aload_0\n 1: getfield #16 // Field sourceRangeStart:J\n 4: lreturn\n\n public final long getRangeLength();\n Code:\n 0: aload_0\n 1: getfield #19 // Field rangeLength:J\n 4: lreturn\n\n public final long next(long);\n Code:\n 0: aload_0\n 1: getfield #16 // Field sourceRangeStart:J\n 4: lload_1\n 5: lcmp\n 6: ifgt 39\n 9: lload_1\n 10: aload_0\n 11: getfield #16 // Field sourceRangeStart:J\n 14: aload_0\n 15: getfield #19 // Field rangeLength:J\n 18: ladd\n 19: lcmp\n 20: ifgt 39\n 23: lload_1\n 24: aload_0\n 25: getfield #16 // Field sourceRangeStart:J\n 28: lsub\n 29: lstore_3\n 30: aload_0\n 31: getfield #13 // Field destinationRangeStart:J\n 34: lload_3\n 35: ladd\n 36: goto 40\n 39: lload_1\n 40: lreturn\n\n public final Day5$Range next(Day5$Range);\n Code:\n 0: aload_1\n 1: ldc #33 // String range\n 3: invokestatic #39 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: invokevirtual #44 // Method Day5$Range.getStart:()J\n 10: aload_0\n 11: getfield #16 // Field sourceRangeStart:J\n 14: lsub\n 15: lstore_2\n 16: new #41 // class Day5$Range\n 19: dup\n 20: aload_0\n 21: getfield #13 // Field destinationRangeStart:J\n 24: lload_2\n 25: ladd\n 26: aload_0\n 27: getfield #13 // Field destinationRangeStart:J\n 30: lload_2\n 31: ladd\n 32: aload_1\n 33: invokevirtual #47 // Method Day5$Range.getEnd:()J\n 36: ladd\n 37: aload_1\n 38: invokevirtual #44 // Method Day5$Range.getStart:()J\n 41: lsub\n 42: invokespecial #50 // Method Day5$Range.\"<init>\":(JJ)V\n 45: areturn\n\n public final boolean overlaps(long);\n Code:\n 0: aload_0\n 1: getfield #16 // Field sourceRangeStart:J\n 4: lload_1\n 5: lcmp\n 6: ifgt 27\n 9: lload_1\n 10: aload_0\n 11: getfield #16 // Field sourceRangeStart:J\n 14: aload_0\n 15: getfield #19 // Field rangeLength:J\n 18: ladd\n 19: lcmp\n 20: ifge 27\n 23: iconst_1\n 24: goto 28\n 27: iconst_0\n 28: ireturn\n\n public final boolean overlaps(Day5$Range);\n Code:\n 0: aload_1\n 1: ldc #33 // String range\n 3: invokestatic #39 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #16 // Field sourceRangeStart:J\n 10: aload_1\n 11: invokevirtual #44 // Method Day5$Range.getStart:()J\n 14: lcmp\n 15: ifgt 41\n 18: aload_1\n 19: invokevirtual #47 // Method Day5$Range.getEnd:()J\n 22: aload_0\n 23: getfield #16 // Field sourceRangeStart:J\n 26: aload_0\n 27: getfield #19 // Field rangeLength:J\n 30: ladd\n 31: lconst_1\n 32: lsub\n 33: lcmp\n 34: ifgt 41\n 37: iconst_1\n 38: goto 42\n 41: iconst_0\n 42: ireturn\n\n public final long component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field destinationRangeStart:J\n 4: lreturn\n\n public final long component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field sourceRangeStart:J\n 4: lreturn\n\n public final long component3();\n Code:\n 0: aload_0\n 1: getfield #19 // Field rangeLength:J\n 4: lreturn\n\n public final Day5$RangeMapping copy(long, long, long);\n Code:\n 0: new #2 // class Day5$RangeMapping\n 3: dup\n 4: lload_1\n 5: lload_3\n 6: lload 5\n 8: invokespecial #61 // Method \"<init>\":(JJJ)V\n 11: areturn\n\n public static Day5$RangeMapping copy$default(Day5$RangeMapping, long, long, long, int, java.lang.Object);\n Code:\n 0: iload 7\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #13 // Field destinationRangeStart:J\n 11: lstore_1\n 12: iload 7\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #16 // Field sourceRangeStart:J\n 23: lstore_3\n 24: iload 7\n 26: iconst_4\n 27: iand\n 28: ifeq 37\n 31: aload_0\n 32: getfield #19 // Field rangeLength:J\n 35: lstore 5\n 37: aload_0\n 38: lload_1\n 39: lload_3\n 40: lload 5\n 42: invokevirtual #65 // Method copy:(JJJ)LDay5$RangeMapping;\n 45: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #69 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #70 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #72 // String RangeMapping(destinationRangeStart=\n 9: invokevirtual #76 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field destinationRangeStart:J\n 16: invokevirtual #79 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 19: ldc #81 // String , sourceRangeStart=\n 21: invokevirtual #76 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field sourceRangeStart:J\n 28: invokevirtual #79 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 31: ldc #83 // String , rangeLength=\n 33: invokevirtual #76 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #19 // Field rangeLength:J\n 40: invokevirtual #79 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #86 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #88 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field destinationRangeStart:J\n 4: invokestatic #95 // Method java/lang/Long.hashCode:(J)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field sourceRangeStart:J\n 16: invokestatic #95 // Method java/lang/Long.hashCode:(J)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #19 // Field rangeLength:J\n 29: invokestatic #95 // Method java/lang/Long.hashCode:(J)I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day5$RangeMapping\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day5$RangeMapping\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field destinationRangeStart:J\n 25: aload_2\n 26: getfield #13 // Field destinationRangeStart:J\n 29: lcmp\n 30: ifeq 35\n 33: iconst_0\n 34: ireturn\n 35: aload_0\n 36: getfield #16 // Field sourceRangeStart:J\n 39: aload_2\n 40: getfield #16 // Field sourceRangeStart:J\n 43: lcmp\n 44: ifeq 49\n 47: iconst_0\n 48: ireturn\n 49: aload_0\n 50: getfield #19 // Field rangeLength:J\n 53: aload_2\n 54: getfield #19 // Field rangeLength:J\n 57: lcmp\n 58: ifeq 63\n 61: iconst_0\n 62: ireturn\n 63: iconst_1\n 64: ireturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day5$Range.class", "javap": "Compiled from \"Day5.kt\"\npublic final class Day5$Range {\n private final long start;\n\n private final long end;\n\n public Day5$Range(long, long);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: lload_1\n 6: putfield #13 // Field start:J\n 9: aload_0\n 10: lload_3\n 11: putfield #16 // Field end:J\n 14: return\n\n public final long getStart();\n Code:\n 0: aload_0\n 1: getfield #13 // Field start:J\n 4: lreturn\n\n public final long getEnd();\n Code:\n 0: aload_0\n 1: getfield #16 // Field end:J\n 4: lreturn\n\n public final long component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field start:J\n 4: lreturn\n\n public final long component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field end:J\n 4: lreturn\n\n public final Day5$Range copy(long, long);\n Code:\n 0: new #2 // class Day5$Range\n 3: dup\n 4: lload_1\n 5: lload_3\n 6: invokespecial #28 // Method \"<init>\":(JJ)V\n 9: areturn\n\n public static Day5$Range copy$default(Day5$Range, long, long, int, java.lang.Object);\n Code:\n 0: iload 5\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #13 // Field start:J\n 11: lstore_1\n 12: iload 5\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #16 // Field end:J\n 23: lstore_3\n 24: aload_0\n 25: lload_1\n 26: lload_3\n 27: invokevirtual #32 // Method copy:(JJ)LDay5$Range;\n 30: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #36 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #37 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #39 // String Range(start=\n 9: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field start:J\n 16: invokevirtual #46 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 19: ldc #48 // String , end=\n 21: invokevirtual #43 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field end:J\n 28: invokevirtual #46 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #51 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #53 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field start:J\n 4: invokestatic #60 // Method java/lang/Long.hashCode:(J)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field end:J\n 16: invokestatic #60 // Method java/lang/Long.hashCode:(J)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day5$Range\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day5$Range\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field start:J\n 25: aload_2\n 26: getfield #13 // Field start:J\n 29: lcmp\n 30: ifeq 35\n 33: iconst_0\n 34: ireturn\n 35: aload_0\n 36: getfield #16 // Field end:J\n 39: aload_2\n 40: getfield #16 // Field end:J\n 43: lcmp\n 44: ifeq 49\n 47: iconst_0\n 48: ireturn\n 49: iconst_1\n 50: ireturn\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day16.kt
import kotlin.String import kotlin.collections.List public object Day16 { enum class Direction { UP, DOWN, LEFT, RIGHT } public fun part1(input: List<String>): String { val startCoordinate = Day10.Coordinate(0, 0) val startDirection = Direction.RIGHT return energizeCount(startCoordinate, startDirection, input).toString() } private fun energizeCount(startCoordinate: Day10.Coordinate, startDirection: Direction, grid: List<String>): Int { val seenCoordinates = mutableSetOf<Pair<Day10.Coordinate, Direction>>() val queue = ArrayDeque<Pair<Day10.Coordinate, Direction>>() queue.add(startCoordinate to startDirection) while (queue.isNotEmpty()) { val (currentCoordinate, currentDirection) = queue.removeFirst() if (currentCoordinate.x < 0 || currentCoordinate.y < 0 || currentCoordinate.y >= grid.size || currentCoordinate.x >= grid[currentCoordinate.y].length) { continue } if (seenCoordinates.contains(currentCoordinate to currentDirection)) { continue } seenCoordinates.add(currentCoordinate to currentDirection) val nextCoordinates = next(currentCoordinate, currentDirection, grid) queue.addAll(nextCoordinates) } return seenCoordinates.map { (coordinate, _) -> coordinate }.distinct().count() } private fun next( currentCoordinate: Day10.Coordinate, direction: Direction, grid: List<String> ): List<Pair<Day10.Coordinate, Direction>> { val currentMarker = grid[currentCoordinate.y][currentCoordinate.x] when (currentMarker) { '|' -> { if (direction == Direction.UP || direction == Direction.DOWN) { val nextCoordinate = when (direction) { Direction.UP -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y - 1) Direction.DOWN -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y + 1) else -> throw IllegalStateException("Should not happen") } // Keep going the same direction return listOf(nextCoordinate to direction) } else { return listOf( Day10.Coordinate(currentCoordinate.x, currentCoordinate.y - 1) to Direction.UP, Day10.Coordinate(currentCoordinate.x, currentCoordinate.y + 1) to Direction.DOWN ) } } '-' -> { if (direction == Direction.LEFT || direction == Direction.RIGHT) { val nextCoordinate = when (direction) { Direction.LEFT -> Day10.Coordinate(currentCoordinate.x - 1, currentCoordinate.y) Direction.RIGHT -> Day10.Coordinate(currentCoordinate.x + 1, currentCoordinate.y) else -> throw IllegalStateException("Should not happen") } // Keep going the same direction return listOf(nextCoordinate to direction) } else { return listOf( Day10.Coordinate(currentCoordinate.x - 1, currentCoordinate.y) to Direction.LEFT, Day10.Coordinate(currentCoordinate.x + 1, currentCoordinate.y) to Direction.RIGHT ) } } '\\' -> { val (nextCoordinate, nextDirection) = when (direction) { Direction.RIGHT -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y + 1) to Direction.DOWN Direction.LEFT -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y - 1) to Direction.UP Direction.UP -> Day10.Coordinate(currentCoordinate.x - 1, currentCoordinate.y) to Direction.LEFT Direction.DOWN -> Day10.Coordinate(currentCoordinate.x + 1, currentCoordinate.y) to Direction.RIGHT } return listOf(nextCoordinate to nextDirection) } '/' -> { val (nextCoordinate, nextDirection) = when (direction) { Direction.LEFT -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y + 1) to Direction.DOWN Direction.RIGHT -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y - 1) to Direction.UP Direction.DOWN -> Day10.Coordinate(currentCoordinate.x - 1, currentCoordinate.y) to Direction.LEFT Direction.UP -> Day10.Coordinate(currentCoordinate.x + 1, currentCoordinate.y) to Direction.RIGHT } return listOf(nextCoordinate to nextDirection) } '.' -> { val nextCoordinate = when (direction) { Direction.UP -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y - 1) Direction.DOWN -> Day10.Coordinate(currentCoordinate.x, currentCoordinate.y + 1) Direction.LEFT -> Day10.Coordinate(currentCoordinate.x - 1, currentCoordinate.y) Direction.RIGHT -> Day10.Coordinate(currentCoordinate.x + 1, currentCoordinate.y) } return listOf(nextCoordinate to direction) } else -> throw IllegalStateException("Should not happen") } } public fun part2(input: List<String>): String { val leftStarts = (0 until input.size).map { y -> Day10.Coordinate(0, y) to Direction.RIGHT } val rightStarts = (0 until input.size).map { y -> Day10.Coordinate(input[y].length - 1, y) to Direction.LEFT } val topStarts = (0 until input[0].length).map { x -> Day10.Coordinate(x, 0) to Direction.DOWN } val bottomStarts = (0 until input[0].length).map { x -> Day10.Coordinate(x, input.size - 1) to Direction.UP } val allStarts = leftStarts + rightStarts + topStarts + bottomStarts return allStarts.maxOf { (coordinate, direction) -> energizeCount(coordinate, direction, input) }.toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day16$Direction.class", "javap": "Compiled from \"Day16.kt\"\npublic final class Day16$Direction extends java.lang.Enum<Day16$Direction> {\n public static final Day16$Direction UP;\n\n public static final Day16$Direction DOWN;\n\n public static final Day16$Direction LEFT;\n\n public static final Day16$Direction RIGHT;\n\n private static final Day16$Direction[] $VALUES;\n\n private static final kotlin.enums.EnumEntries $ENTRIES;\n\n private Day16$Direction();\n Code:\n 0: aload_0\n 1: aload_1\n 2: iload_2\n 3: invokespecial #10 // Method java/lang/Enum.\"<init>\":(Ljava/lang/String;I)V\n 6: return\n\n public static Day16$Direction[] values();\n Code:\n 0: getstatic #22 // Field $VALUES:[LDay16$Direction;\n 3: invokevirtual #28 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 6: checkcast #29 // class \"[LDay16$Direction;\"\n 9: areturn\n\n public static Day16$Direction valueOf(java.lang.String);\n Code:\n 0: ldc #2 // class Day16$Direction\n 2: aload_0\n 3: invokestatic #34 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;\n 6: checkcast #2 // class Day16$Direction\n 9: areturn\n\n public static kotlin.enums.EnumEntries<Day16$Direction> getEntries();\n Code:\n 0: getstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 3: areturn\n\n private static final Day16$Direction[] $values();\n Code:\n 0: iconst_4\n 1: anewarray #2 // class Day16$Direction\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: getstatic #47 // Field UP:LDay16$Direction;\n 10: aastore\n 11: aload_0\n 12: iconst_1\n 13: getstatic #50 // Field DOWN:LDay16$Direction;\n 16: aastore\n 17: aload_0\n 18: iconst_2\n 19: getstatic #53 // Field LEFT:LDay16$Direction;\n 22: aastore\n 23: aload_0\n 24: iconst_3\n 25: getstatic #56 // Field RIGHT:LDay16$Direction;\n 28: aastore\n 29: aload_0\n 30: areturn\n\n static {};\n Code:\n 0: new #2 // class Day16$Direction\n 3: dup\n 4: ldc #58 // String UP\n 6: iconst_0\n 7: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 10: putstatic #47 // Field UP:LDay16$Direction;\n 13: new #2 // class Day16$Direction\n 16: dup\n 17: ldc #60 // String DOWN\n 19: iconst_1\n 20: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 23: putstatic #50 // Field DOWN:LDay16$Direction;\n 26: new #2 // class Day16$Direction\n 29: dup\n 30: ldc #61 // String LEFT\n 32: iconst_2\n 33: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 36: putstatic #53 // Field LEFT:LDay16$Direction;\n 39: new #2 // class Day16$Direction\n 42: dup\n 43: ldc #62 // String RIGHT\n 45: iconst_3\n 46: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 49: putstatic #56 // Field RIGHT:LDay16$Direction;\n 52: invokestatic #64 // Method $values:()[LDay16$Direction;\n 55: putstatic #22 // Field $VALUES:[LDay16$Direction;\n 58: getstatic #22 // Field $VALUES:[LDay16$Direction;\n 61: checkcast #66 // class \"[Ljava/lang/Enum;\"\n 64: invokestatic #72 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;\n 67: putstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 70: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day16.class", "javap": "Compiled from \"Day16.kt\"\npublic final class Day16 {\n public static final Day16 INSTANCE;\n\n private Day16();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #24 // class Day10$Coordinate\n 9: dup\n 10: iconst_0\n 11: iconst_0\n 12: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 15: astore_2\n 16: getstatic #33 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 19: astore_3\n 20: aload_0\n 21: aload_2\n 22: aload_3\n 23: aload_1\n 24: invokespecial #37 // Method energizeCount:(LDay10$Coordinate;LDay16$Direction;Ljava/util/List;)I\n 27: invokestatic #43 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 30: areturn\n\n private final int energizeCount(Day10$Coordinate, Day16$Direction, java.util.List<java.lang.String>);\n Code:\n 0: new #50 // class java/util/LinkedHashSet\n 3: dup\n 4: invokespecial #51 // Method java/util/LinkedHashSet.\"<init>\":()V\n 7: checkcast #53 // class java/util/Set\n 10: astore 4\n 12: new #55 // class kotlin/collections/ArrayDeque\n 15: dup\n 16: invokespecial #56 // Method kotlin/collections/ArrayDeque.\"<init>\":()V\n 19: astore 5\n 21: aload 5\n 23: aload_1\n 24: aload_2\n 25: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 28: invokevirtual #66 // Method kotlin/collections/ArrayDeque.add:(Ljava/lang/Object;)Z\n 31: pop\n 32: aload 5\n 34: checkcast #68 // class java/util/Collection\n 37: invokeinterface #72, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 42: ifne 49\n 45: iconst_1\n 46: goto 50\n 49: iconst_0\n 50: ifeq 201\n 53: aload 5\n 55: invokevirtual #76 // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;\n 58: checkcast #78 // class kotlin/Pair\n 61: astore 6\n 63: aload 6\n 65: invokevirtual #81 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 68: checkcast #24 // class Day10$Coordinate\n 71: astore 7\n 73: aload 6\n 75: invokevirtual #84 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 78: checkcast #29 // class Day16$Direction\n 81: astore 8\n 83: aload 7\n 85: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 88: iflt 138\n 91: aload 7\n 93: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 96: iflt 138\n 99: aload 7\n 101: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 104: aload_3\n 105: invokeinterface #96, 1 // InterfaceMethod java/util/List.size:()I\n 110: if_icmpge 138\n 113: aload 7\n 115: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 118: aload_3\n 119: aload 7\n 121: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 124: invokeinterface #100, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 129: checkcast #39 // class java/lang/String\n 132: invokevirtual #103 // Method java/lang/String.length:()I\n 135: if_icmplt 141\n 138: goto 32\n 141: aload 4\n 143: aload 7\n 145: aload 8\n 147: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 150: invokeinterface #106, 2 // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z\n 155: ifeq 161\n 158: goto 32\n 161: aload 4\n 163: aload 7\n 165: aload 8\n 167: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 170: invokeinterface #107, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z\n 175: pop\n 176: aload_0\n 177: aload 7\n 179: aload 8\n 181: aload_3\n 182: invokespecial #111 // Method next:(LDay10$Coordinate;LDay16$Direction;Ljava/util/List;)Ljava/util/List;\n 185: astore 9\n 187: aload 5\n 189: aload 9\n 191: checkcast #68 // class java/util/Collection\n 194: invokevirtual #115 // Method kotlin/collections/ArrayDeque.addAll:(Ljava/util/Collection;)Z\n 197: pop\n 198: goto 32\n 201: aload 4\n 203: checkcast #117 // class java/lang/Iterable\n 206: astore 6\n 208: iconst_0\n 209: istore 7\n 211: aload 6\n 213: astore 8\n 215: new #119 // class java/util/ArrayList\n 218: dup\n 219: aload 6\n 221: bipush 10\n 223: invokestatic #125 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 226: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 229: checkcast #68 // class java/util/Collection\n 232: astore 9\n 234: iconst_0\n 235: istore 10\n 237: aload 8\n 239: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 244: astore 11\n 246: aload 11\n 248: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 253: ifeq 303\n 256: aload 11\n 258: invokeinterface #139, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 263: astore 12\n 265: aload 9\n 267: aload 12\n 269: checkcast #78 // class kotlin/Pair\n 272: astore 13\n 274: astore 16\n 276: iconst_0\n 277: istore 14\n 279: aload 13\n 281: invokevirtual #81 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 284: checkcast #24 // class Day10$Coordinate\n 287: astore 15\n 289: aload 15\n 291: aload 16\n 293: swap\n 294: invokeinterface #140, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 299: pop\n 300: goto 246\n 303: aload 9\n 305: checkcast #93 // class java/util/List\n 308: nop\n 309: checkcast #117 // class java/lang/Iterable\n 312: invokestatic #144 // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;\n 315: checkcast #68 // class java/util/Collection\n 318: invokeinterface #145, 1 // InterfaceMethod java/util/Collection.size:()I\n 323: ireturn\n\n private final java.util.List<kotlin.Pair<Day10$Coordinate, Day16$Direction>> next(Day10$Coordinate, Day16$Direction, java.util.List<java.lang.String>);\n Code:\n 0: aload_3\n 1: aload_1\n 2: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 5: invokeinterface #100, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 10: checkcast #39 // class java/lang/String\n 13: aload_1\n 14: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 17: invokevirtual #170 // Method java/lang/String.charAt:(I)C\n 20: istore 4\n 22: iload 4\n 24: lookupswitch { // 5\n 45: 248\n 46: 789\n 47: 605\n 92: 420\n 124: 76\n default: 928\n }\n 76: aload_2\n 77: getstatic #173 // Field Day16$Direction.UP:LDay16$Direction;\n 80: if_acmpeq 90\n 83: aload_2\n 84: getstatic #176 // Field Day16$Direction.DOWN:LDay16$Direction;\n 87: if_acmpne 182\n 90: aload_2\n 91: getstatic #182 // Field Day16$WhenMappings.$EnumSwitchMapping$0:[I\n 94: swap\n 95: invokevirtual #185 // Method Day16$Direction.ordinal:()I\n 98: iaload\n 99: tableswitch { // 1 to 2\n 1: 120\n 2: 140\n default: 160\n }\n 120: new #24 // class Day10$Coordinate\n 123: dup\n 124: aload_1\n 125: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 128: aload_1\n 129: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 132: iconst_1\n 133: isub\n 134: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 137: goto 170\n 140: new #24 // class Day10$Coordinate\n 143: dup\n 144: aload_1\n 145: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 148: aload_1\n 149: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 152: iconst_1\n 153: iadd\n 154: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 157: goto 170\n 160: new #187 // class java/lang/IllegalStateException\n 163: dup\n 164: ldc #189 // String Should not happen\n 166: invokespecial #192 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 169: athrow\n 170: astore 5\n 172: aload 5\n 174: aload_2\n 175: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 178: invokestatic #196 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 181: areturn\n 182: iconst_2\n 183: anewarray #78 // class kotlin/Pair\n 186: astore 5\n 188: aload 5\n 190: iconst_0\n 191: new #24 // class Day10$Coordinate\n 194: dup\n 195: aload_1\n 196: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 199: aload_1\n 200: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 203: iconst_1\n 204: isub\n 205: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 208: getstatic #173 // Field Day16$Direction.UP:LDay16$Direction;\n 211: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 214: aastore\n 215: aload 5\n 217: iconst_1\n 218: new #24 // class Day10$Coordinate\n 221: dup\n 222: aload_1\n 223: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 226: aload_1\n 227: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 230: iconst_1\n 231: iadd\n 232: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 235: getstatic #176 // Field Day16$Direction.DOWN:LDay16$Direction;\n 238: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 241: aastore\n 242: aload 5\n 244: invokestatic #199 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 247: areturn\n 248: aload_2\n 249: getstatic #202 // Field Day16$Direction.LEFT:LDay16$Direction;\n 252: if_acmpeq 262\n 255: aload_2\n 256: getstatic #33 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 259: if_acmpne 354\n 262: aload_2\n 263: getstatic #182 // Field Day16$WhenMappings.$EnumSwitchMapping$0:[I\n 266: swap\n 267: invokevirtual #185 // Method Day16$Direction.ordinal:()I\n 270: iaload\n 271: tableswitch { // 3 to 4\n 3: 292\n 4: 312\n default: 332\n }\n 292: new #24 // class Day10$Coordinate\n 295: dup\n 296: aload_1\n 297: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 300: iconst_1\n 301: isub\n 302: aload_1\n 303: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 306: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 309: goto 342\n 312: new #24 // class Day10$Coordinate\n 315: dup\n 316: aload_1\n 317: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 320: iconst_1\n 321: iadd\n 322: aload_1\n 323: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 326: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 329: goto 342\n 332: new #187 // class java/lang/IllegalStateException\n 335: dup\n 336: ldc #189 // String Should not happen\n 338: invokespecial #192 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 341: athrow\n 342: astore 5\n 344: aload 5\n 346: aload_2\n 347: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 350: invokestatic #196 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 353: areturn\n 354: iconst_2\n 355: anewarray #78 // class kotlin/Pair\n 358: astore 5\n 360: aload 5\n 362: iconst_0\n 363: new #24 // class Day10$Coordinate\n 366: dup\n 367: aload_1\n 368: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 371: iconst_1\n 372: isub\n 373: aload_1\n 374: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 377: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 380: getstatic #202 // Field Day16$Direction.LEFT:LDay16$Direction;\n 383: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 386: aastore\n 387: aload 5\n 389: iconst_1\n 390: new #24 // class Day10$Coordinate\n 393: dup\n 394: aload_1\n 395: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 398: iconst_1\n 399: iadd\n 400: aload_1\n 401: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 404: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 407: getstatic #33 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 410: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 413: aastore\n 414: aload 5\n 416: invokestatic #199 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 419: areturn\n 420: aload_2\n 421: getstatic #182 // Field Day16$WhenMappings.$EnumSwitchMapping$0:[I\n 424: swap\n 425: invokevirtual #185 // Method Day16$Direction.ordinal:()I\n 428: iaload\n 429: tableswitch { // 1 to 4\n 1: 512\n 2: 538\n 3: 486\n 4: 460\n default: 564\n }\n 460: new #24 // class Day10$Coordinate\n 463: dup\n 464: aload_1\n 465: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 468: aload_1\n 469: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 472: iconst_1\n 473: iadd\n 474: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 477: getstatic #176 // Field Day16$Direction.DOWN:LDay16$Direction;\n 480: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 483: goto 572\n 486: new #24 // class Day10$Coordinate\n 489: dup\n 490: aload_1\n 491: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 494: aload_1\n 495: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 498: iconst_1\n 499: isub\n 500: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 503: getstatic #173 // Field Day16$Direction.UP:LDay16$Direction;\n 506: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 509: goto 572\n 512: new #24 // class Day10$Coordinate\n 515: dup\n 516: aload_1\n 517: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 520: iconst_1\n 521: isub\n 522: aload_1\n 523: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 526: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 529: getstatic #202 // Field Day16$Direction.LEFT:LDay16$Direction;\n 532: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 535: goto 572\n 538: new #24 // class Day10$Coordinate\n 541: dup\n 542: aload_1\n 543: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 546: iconst_1\n 547: iadd\n 548: aload_1\n 549: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 552: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 555: getstatic #33 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 558: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 561: goto 572\n 564: new #204 // class kotlin/NoWhenBranchMatchedException\n 567: dup\n 568: invokespecial #205 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 571: athrow\n 572: astore 5\n 574: aload 5\n 576: invokevirtual #81 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 579: checkcast #24 // class Day10$Coordinate\n 582: astore 6\n 584: aload 5\n 586: invokevirtual #84 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 589: checkcast #29 // class Day16$Direction\n 592: astore 7\n 594: aload 6\n 596: aload 7\n 598: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 601: invokestatic #196 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 604: areturn\n 605: aload_2\n 606: getstatic #182 // Field Day16$WhenMappings.$EnumSwitchMapping$0:[I\n 609: swap\n 610: invokevirtual #185 // Method Day16$Direction.ordinal:()I\n 613: iaload\n 614: tableswitch { // 1 to 4\n 1: 722\n 2: 696\n 3: 644\n 4: 670\n default: 748\n }\n 644: new #24 // class Day10$Coordinate\n 647: dup\n 648: aload_1\n 649: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 652: aload_1\n 653: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 656: iconst_1\n 657: iadd\n 658: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 661: getstatic #176 // Field Day16$Direction.DOWN:LDay16$Direction;\n 664: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 667: goto 756\n 670: new #24 // class Day10$Coordinate\n 673: dup\n 674: aload_1\n 675: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 678: aload_1\n 679: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 682: iconst_1\n 683: isub\n 684: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 687: getstatic #173 // Field Day16$Direction.UP:LDay16$Direction;\n 690: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 693: goto 756\n 696: new #24 // class Day10$Coordinate\n 699: dup\n 700: aload_1\n 701: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 704: iconst_1\n 705: isub\n 706: aload_1\n 707: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 710: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 713: getstatic #202 // Field Day16$Direction.LEFT:LDay16$Direction;\n 716: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 719: goto 756\n 722: new #24 // class Day10$Coordinate\n 725: dup\n 726: aload_1\n 727: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 730: iconst_1\n 731: iadd\n 732: aload_1\n 733: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 736: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 739: getstatic #33 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 742: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 745: goto 756\n 748: new #204 // class kotlin/NoWhenBranchMatchedException\n 751: dup\n 752: invokespecial #205 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 755: athrow\n 756: astore 5\n 758: aload 5\n 760: invokevirtual #81 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 763: checkcast #24 // class Day10$Coordinate\n 766: astore 6\n 768: aload 5\n 770: invokevirtual #84 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 773: checkcast #29 // class Day16$Direction\n 776: astore 7\n 778: aload 6\n 780: aload 7\n 782: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 785: invokestatic #196 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 788: areturn\n 789: aload_2\n 790: getstatic #182 // Field Day16$WhenMappings.$EnumSwitchMapping$0:[I\n 793: swap\n 794: invokevirtual #185 // Method Day16$Direction.ordinal:()I\n 797: iaload\n 798: tableswitch { // 1 to 4\n 1: 828\n 2: 848\n 3: 868\n 4: 888\n default: 908\n }\n 828: new #24 // class Day10$Coordinate\n 831: dup\n 832: aload_1\n 833: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 836: aload_1\n 837: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 840: iconst_1\n 841: isub\n 842: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 845: goto 916\n 848: new #24 // class Day10$Coordinate\n 851: dup\n 852: aload_1\n 853: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 856: aload_1\n 857: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 860: iconst_1\n 861: iadd\n 862: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 865: goto 916\n 868: new #24 // class Day10$Coordinate\n 871: dup\n 872: aload_1\n 873: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 876: iconst_1\n 877: isub\n 878: aload_1\n 879: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 882: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 885: goto 916\n 888: new #24 // class Day10$Coordinate\n 891: dup\n 892: aload_1\n 893: invokevirtual #88 // Method Day10$Coordinate.getX:()I\n 896: iconst_1\n 897: iadd\n 898: aload_1\n 899: invokevirtual #91 // Method Day10$Coordinate.getY:()I\n 902: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 905: goto 916\n 908: new #204 // class kotlin/NoWhenBranchMatchedException\n 911: dup\n 912: invokespecial #205 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 915: athrow\n 916: astore 5\n 918: aload 5\n 920: aload_2\n 921: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 924: invokestatic #196 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 927: areturn\n 928: new #187 // class java/lang/IllegalStateException\n 931: dup\n 932: ldc #189 // String Should not happen\n 934: invokespecial #192 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 937: athrow\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: iconst_0\n 7: aload_1\n 8: invokeinterface #96, 1 // InterfaceMethod java/util/List.size:()I\n 13: invokestatic #217 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 16: checkcast #117 // class java/lang/Iterable\n 19: astore_3\n 20: iconst_0\n 21: istore 4\n 23: aload_3\n 24: astore 5\n 26: new #119 // class java/util/ArrayList\n 29: dup\n 30: aload_3\n 31: bipush 10\n 33: invokestatic #125 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 36: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 39: checkcast #68 // class java/util/Collection\n 42: astore 6\n 44: iconst_0\n 45: istore 7\n 47: aload 5\n 49: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 54: astore 8\n 56: aload 8\n 58: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 63: ifeq 115\n 66: aload 8\n 68: checkcast #219 // class kotlin/collections/IntIterator\n 71: invokevirtual #222 // Method kotlin/collections/IntIterator.nextInt:()I\n 74: istore 9\n 76: aload 6\n 78: iload 9\n 80: istore 10\n 82: astore 15\n 84: iconst_0\n 85: istore 11\n 87: new #24 // class Day10$Coordinate\n 90: dup\n 91: iconst_0\n 92: iload 10\n 94: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 97: getstatic #33 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 100: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 103: aload 15\n 105: swap\n 106: invokeinterface #140, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 111: pop\n 112: goto 56\n 115: aload 6\n 117: checkcast #93 // class java/util/List\n 120: nop\n 121: astore_2\n 122: iconst_0\n 123: aload_1\n 124: invokeinterface #96, 1 // InterfaceMethod java/util/List.size:()I\n 129: invokestatic #217 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 132: checkcast #117 // class java/lang/Iterable\n 135: astore 4\n 137: iconst_0\n 138: istore 5\n 140: aload 4\n 142: astore 6\n 144: new #119 // class java/util/ArrayList\n 147: dup\n 148: aload 4\n 150: bipush 10\n 152: invokestatic #125 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 155: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 158: checkcast #68 // class java/util/Collection\n 161: astore 7\n 163: iconst_0\n 164: istore 8\n 166: aload 6\n 168: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 173: astore 9\n 175: aload 9\n 177: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 182: ifeq 249\n 185: aload 9\n 187: checkcast #219 // class kotlin/collections/IntIterator\n 190: invokevirtual #222 // Method kotlin/collections/IntIterator.nextInt:()I\n 193: istore 10\n 195: aload 7\n 197: iload 10\n 199: istore 11\n 201: astore 15\n 203: iconst_0\n 204: istore 12\n 206: new #24 // class Day10$Coordinate\n 209: dup\n 210: aload_1\n 211: iload 11\n 213: invokeinterface #100, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 218: checkcast #39 // class java/lang/String\n 221: invokevirtual #103 // Method java/lang/String.length:()I\n 224: iconst_1\n 225: isub\n 226: iload 11\n 228: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 231: getstatic #202 // Field Day16$Direction.LEFT:LDay16$Direction;\n 234: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 237: aload 15\n 239: swap\n 240: invokeinterface #140, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 245: pop\n 246: goto 175\n 249: aload 7\n 251: checkcast #93 // class java/util/List\n 254: nop\n 255: astore_3\n 256: iconst_0\n 257: aload_1\n 258: iconst_0\n 259: invokeinterface #100, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 264: checkcast #39 // class java/lang/String\n 267: invokevirtual #103 // Method java/lang/String.length:()I\n 270: invokestatic #217 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 273: checkcast #117 // class java/lang/Iterable\n 276: astore 5\n 278: iconst_0\n 279: istore 6\n 281: aload 5\n 283: astore 7\n 285: new #119 // class java/util/ArrayList\n 288: dup\n 289: aload 5\n 291: bipush 10\n 293: invokestatic #125 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 296: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 299: checkcast #68 // class java/util/Collection\n 302: astore 8\n 304: iconst_0\n 305: istore 9\n 307: aload 7\n 309: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 314: astore 10\n 316: aload 10\n 318: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 323: ifeq 375\n 326: aload 10\n 328: checkcast #219 // class kotlin/collections/IntIterator\n 331: invokevirtual #222 // Method kotlin/collections/IntIterator.nextInt:()I\n 334: istore 11\n 336: aload 8\n 338: iload 11\n 340: istore 12\n 342: astore 15\n 344: iconst_0\n 345: istore 13\n 347: new #24 // class Day10$Coordinate\n 350: dup\n 351: iload 12\n 353: iconst_0\n 354: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 357: getstatic #176 // Field Day16$Direction.DOWN:LDay16$Direction;\n 360: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 363: aload 15\n 365: swap\n 366: invokeinterface #140, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 371: pop\n 372: goto 316\n 375: aload 8\n 377: checkcast #93 // class java/util/List\n 380: nop\n 381: astore 4\n 383: iconst_0\n 384: aload_1\n 385: iconst_0\n 386: invokeinterface #100, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 391: checkcast #39 // class java/lang/String\n 394: invokevirtual #103 // Method java/lang/String.length:()I\n 397: invokestatic #217 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 400: checkcast #117 // class java/lang/Iterable\n 403: astore 6\n 405: iconst_0\n 406: istore 7\n 408: aload 6\n 410: astore 8\n 412: new #119 // class java/util/ArrayList\n 415: dup\n 416: aload 6\n 418: bipush 10\n 420: invokestatic #125 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 423: invokespecial #128 // Method java/util/ArrayList.\"<init>\":(I)V\n 426: checkcast #68 // class java/util/Collection\n 429: astore 9\n 431: iconst_0\n 432: istore 10\n 434: aload 8\n 436: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 441: astore 11\n 443: aload 11\n 445: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 450: ifeq 509\n 453: aload 11\n 455: checkcast #219 // class kotlin/collections/IntIterator\n 458: invokevirtual #222 // Method kotlin/collections/IntIterator.nextInt:()I\n 461: istore 12\n 463: aload 9\n 465: iload 12\n 467: istore 13\n 469: astore 15\n 471: iconst_0\n 472: istore 14\n 474: new #24 // class Day10$Coordinate\n 477: dup\n 478: iload 13\n 480: aload_1\n 481: invokeinterface #96, 1 // InterfaceMethod java/util/List.size:()I\n 486: iconst_1\n 487: isub\n 488: invokespecial #27 // Method Day10$Coordinate.\"<init>\":(II)V\n 491: getstatic #173 // Field Day16$Direction.UP:LDay16$Direction;\n 494: invokestatic #62 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 497: aload 15\n 499: swap\n 500: invokeinterface #140, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 505: pop\n 506: goto 443\n 509: aload 9\n 511: checkcast #93 // class java/util/List\n 514: nop\n 515: astore 5\n 517: aload_2\n 518: checkcast #68 // class java/util/Collection\n 521: aload_3\n 522: checkcast #117 // class java/lang/Iterable\n 525: invokestatic #226 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 528: checkcast #68 // class java/util/Collection\n 531: aload 4\n 533: checkcast #117 // class java/lang/Iterable\n 536: invokestatic #226 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 539: checkcast #68 // class java/util/Collection\n 542: aload 5\n 544: checkcast #117 // class java/lang/Iterable\n 547: invokestatic #226 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 550: astore 6\n 552: aload 6\n 554: checkcast #117 // class java/lang/Iterable\n 557: invokeinterface #132, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 562: astore 8\n 564: aload 8\n 566: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 571: ifne 582\n 574: new #228 // class java/util/NoSuchElementException\n 577: dup\n 578: invokespecial #229 // Method java/util/NoSuchElementException.\"<init>\":()V\n 581: athrow\n 582: aload 8\n 584: invokeinterface #139, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 589: checkcast #78 // class kotlin/Pair\n 592: astore 9\n 594: iconst_0\n 595: istore 10\n 597: aload 9\n 599: invokevirtual #81 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 602: checkcast #24 // class Day10$Coordinate\n 605: astore 11\n 607: aload 9\n 609: invokevirtual #84 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 612: checkcast #29 // class Day16$Direction\n 615: astore 12\n 617: getstatic #232 // Field INSTANCE:LDay16;\n 620: aload 11\n 622: aload 12\n 624: aload_1\n 625: invokespecial #37 // Method energizeCount:(LDay10$Coordinate;LDay16$Direction;Ljava/util/List;)I\n 628: istore 9\n 630: aload 8\n 632: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 637: ifeq 702\n 640: aload 8\n 642: invokeinterface #139, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 647: checkcast #78 // class kotlin/Pair\n 650: astore 10\n 652: iconst_0\n 653: istore 11\n 655: aload 10\n 657: invokevirtual #81 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 660: checkcast #24 // class Day10$Coordinate\n 663: astore 12\n 665: aload 10\n 667: invokevirtual #84 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 670: checkcast #29 // class Day16$Direction\n 673: astore 13\n 675: getstatic #232 // Field INSTANCE:LDay16;\n 678: aload 12\n 680: aload 13\n 682: aload_1\n 683: invokespecial #37 // Method energizeCount:(LDay10$Coordinate;LDay16$Direction;Ljava/util/List;)I\n 686: istore 10\n 688: iload 9\n 690: iload 10\n 692: if_icmpge 630\n 695: iload 10\n 697: istore 9\n 699: goto 630\n 702: iload 9\n 704: invokestatic #43 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 707: areturn\n\n static {};\n Code:\n 0: new #2 // class Day16\n 3: dup\n 4: invokespecial #246 // Method \"<init>\":()V\n 7: putstatic #232 // Field INSTANCE:LDay16;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day16$WhenMappings.class", "javap": "Compiled from \"Day16.kt\"\npublic final class Day16$WhenMappings {\n public static final int[] $EnumSwitchMapping$0;\n\n static {};\n Code:\n 0: invokestatic #14 // Method Day16$Direction.values:()[LDay16$Direction;\n 3: arraylength\n 4: newarray int\n 6: astore_0\n 7: nop\n 8: aload_0\n 9: getstatic #18 // Field Day16$Direction.UP:LDay16$Direction;\n 12: invokevirtual #22 // Method Day16$Direction.ordinal:()I\n 15: iconst_1\n 16: iastore\n 17: goto 21\n 20: astore_1\n 21: nop\n 22: aload_0\n 23: getstatic #25 // Field Day16$Direction.DOWN:LDay16$Direction;\n 26: invokevirtual #22 // Method Day16$Direction.ordinal:()I\n 29: iconst_2\n 30: iastore\n 31: goto 35\n 34: astore_1\n 35: nop\n 36: aload_0\n 37: getstatic #28 // Field Day16$Direction.LEFT:LDay16$Direction;\n 40: invokevirtual #22 // Method Day16$Direction.ordinal:()I\n 43: iconst_3\n 44: iastore\n 45: goto 49\n 48: astore_1\n 49: nop\n 50: aload_0\n 51: getstatic #31 // Field Day16$Direction.RIGHT:LDay16$Direction;\n 54: invokevirtual #22 // Method Day16$Direction.ordinal:()I\n 57: iconst_4\n 58: iastore\n 59: goto 63\n 62: astore_1\n 63: aload_0\n 64: putstatic #35 // Field $EnumSwitchMapping$0:[I\n 67: return\n Exception table:\n from to target type\n 7 17 20 Class java/lang/NoSuchFieldError\n 21 31 34 Class java/lang/NoSuchFieldError\n 35 45 48 Class java/lang/NoSuchFieldError\n 49 59 62 Class java/lang/NoSuchFieldError\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day11.kt
import kotlin.String import kotlin.collections.List object Day11 { fun part1(input: List<String>): String { val pairs = generatePairs(input) val emptyRows = generateEmptyRows(input) val emptyColumns = generateEmptyColumns(input) return pairs.sumOf { (a, b) -> manhattanDistance(a, b) + crossingRows(a, b, emptyRows) + crossingColumns(a, b, emptyColumns) }.toString() } private fun crossingColumns(a: Day10.Coordinate, b: Day10.Coordinate, emptyColumns: Set<Int>): Long { return emptyColumns.count { a.x < it && b.x > it || a.x > it && b.x < it }.toLong() } private fun crossingRows(a: Day10.Coordinate, b: Day10.Coordinate, emptyRows: Set<Int>): Long { return emptyRows.count { a.y < it && b.y > it || a.y > it && b.y < it }.toLong() } private fun manhattanDistance(a: Day10.Coordinate, b: Day10.Coordinate): Long { return (Math.abs(a.x - b.x) + Math.abs(a.y - b.y)).toLong() } fun part2(input: List<String>): String { val pairs = generatePairs(input) val emptyRows = generateEmptyRows(input) val emptyColumns = generateEmptyColumns(input) return pairs.sumOf { (a, b) -> manhattanDistance(a, b) + crossingRows(a, b, emptyRows) * 999_999L + crossingColumns( a, b, emptyColumns ) * 999_999L }.toString() } private fun generatePairs(input: List<String>): List<Pair<Day10.Coordinate, Day10.Coordinate>> { val coordinates = input.mapIndexed { y, line -> line.mapIndexedNotNull { x, c -> if (c == '#') { Day10.Coordinate(x, y) } else { null } } }.flatten() return coordinates.indices.flatMap { i -> (i + 1..<coordinates.size).map { j -> Pair(coordinates[i], coordinates[j]) } } } private fun generateEmptyColumns(input: List<String>): Set<Int> { return (0..<input[0].length).filter { col -> input.all { it[col] == '.' } }.toSet() } private fun generateEmptyRows(input: List<String>): Set<Int> { return input.mapIndexedNotNull { y, line -> if (line.all { it == '.' }) { y } else { null } }.toSet() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day11.class", "javap": "Compiled from \"Day11.kt\"\npublic final class Day11 {\n public static final Day11 INSTANCE;\n\n private Day11();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method generatePairs:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_0\n 13: aload_1\n 14: invokespecial #30 // Method generateEmptyRows:(Ljava/util/List;)Ljava/util/Set;\n 17: astore_3\n 18: aload_0\n 19: aload_1\n 20: invokespecial #33 // Method generateEmptyColumns:(Ljava/util/List;)Ljava/util/Set;\n 23: astore 4\n 25: aload_2\n 26: checkcast #35 // class java/lang/Iterable\n 29: astore 5\n 31: lconst_0\n 32: lstore 6\n 34: aload 5\n 36: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 8\n 43: aload 8\n 45: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 143\n 53: aload 8\n 55: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 9\n 62: lload 6\n 64: aload 9\n 66: checkcast #51 // class kotlin/Pair\n 69: astore 10\n 71: lstore 14\n 73: iconst_0\n 74: istore 11\n 76: aload 10\n 78: invokevirtual #54 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 81: checkcast #56 // class Day10$Coordinate\n 84: astore 12\n 86: aload 10\n 88: invokevirtual #59 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 91: checkcast #56 // class Day10$Coordinate\n 94: astore 13\n 96: getstatic #62 // Field INSTANCE:LDay11;\n 99: aload 12\n 101: aload 13\n 103: invokespecial #66 // Method manhattanDistance:(LDay10$Coordinate;LDay10$Coordinate;)J\n 106: getstatic #62 // Field INSTANCE:LDay11;\n 109: aload 12\n 111: aload 13\n 113: aload_3\n 114: invokespecial #70 // Method crossingRows:(LDay10$Coordinate;LDay10$Coordinate;Ljava/util/Set;)J\n 117: ladd\n 118: getstatic #62 // Field INSTANCE:LDay11;\n 121: aload 12\n 123: aload 13\n 125: aload 4\n 127: invokespecial #73 // Method crossingColumns:(LDay10$Coordinate;LDay10$Coordinate;Ljava/util/Set;)J\n 130: ladd\n 131: lstore 16\n 133: lload 14\n 135: lload 16\n 137: ladd\n 138: lstore 6\n 140: goto 43\n 143: lload 6\n 145: invokestatic #79 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 148: areturn\n\n private final long crossingColumns(Day10$Coordinate, Day10$Coordinate, java.util.Set<java.lang.Integer>);\n Code:\n 0: aload_3\n 1: checkcast #35 // class java/lang/Iterable\n 4: astore 4\n 6: iconst_0\n 7: istore 5\n 9: aload 4\n 11: instanceof #96 // class java/util/Collection\n 14: ifeq 34\n 17: aload 4\n 19: checkcast #96 // class java/util/Collection\n 22: invokeinterface #99, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 27: ifeq 34\n 30: iconst_0\n 31: goto 138\n 34: iconst_0\n 35: istore 6\n 37: aload 4\n 39: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 7\n 46: aload 7\n 48: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 136\n 56: aload 7\n 58: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 8\n 65: aload 8\n 67: checkcast #101 // class java/lang/Number\n 70: invokevirtual #105 // Method java/lang/Number.intValue:()I\n 73: istore 9\n 75: iconst_0\n 76: istore 10\n 78: aload_1\n 79: invokevirtual #108 // Method Day10$Coordinate.getX:()I\n 82: iload 9\n 84: if_icmpge 96\n 87: aload_2\n 88: invokevirtual #108 // Method Day10$Coordinate.getX:()I\n 91: iload 9\n 93: if_icmpgt 114\n 96: aload_1\n 97: invokevirtual #108 // Method Day10$Coordinate.getX:()I\n 100: iload 9\n 102: if_icmple 118\n 105: aload_2\n 106: invokevirtual #108 // Method Day10$Coordinate.getX:()I\n 109: iload 9\n 111: if_icmpge 118\n 114: iconst_1\n 115: goto 119\n 118: iconst_0\n 119: ifeq 46\n 122: iinc 6, 1\n 125: iload 6\n 127: ifge 46\n 130: invokestatic #113 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 133: goto 46\n 136: iload 6\n 138: i2l\n 139: lreturn\n\n private final long crossingRows(Day10$Coordinate, Day10$Coordinate, java.util.Set<java.lang.Integer>);\n Code:\n 0: aload_3\n 1: checkcast #35 // class java/lang/Iterable\n 4: astore 4\n 6: iconst_0\n 7: istore 5\n 9: aload 4\n 11: instanceof #96 // class java/util/Collection\n 14: ifeq 34\n 17: aload 4\n 19: checkcast #96 // class java/util/Collection\n 22: invokeinterface #99, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 27: ifeq 34\n 30: iconst_0\n 31: goto 138\n 34: iconst_0\n 35: istore 6\n 37: aload 4\n 39: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 44: astore 7\n 46: aload 7\n 48: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 53: ifeq 136\n 56: aload 7\n 58: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 63: astore 8\n 65: aload 8\n 67: checkcast #101 // class java/lang/Number\n 70: invokevirtual #105 // Method java/lang/Number.intValue:()I\n 73: istore 9\n 75: iconst_0\n 76: istore 10\n 78: aload_1\n 79: invokevirtual #124 // Method Day10$Coordinate.getY:()I\n 82: iload 9\n 84: if_icmpge 96\n 87: aload_2\n 88: invokevirtual #124 // Method Day10$Coordinate.getY:()I\n 91: iload 9\n 93: if_icmpgt 114\n 96: aload_1\n 97: invokevirtual #124 // Method Day10$Coordinate.getY:()I\n 100: iload 9\n 102: if_icmple 118\n 105: aload_2\n 106: invokevirtual #124 // Method Day10$Coordinate.getY:()I\n 109: iload 9\n 111: if_icmpge 118\n 114: iconst_1\n 115: goto 119\n 118: iconst_0\n 119: ifeq 46\n 122: iinc 6, 1\n 125: iload 6\n 127: ifge 46\n 130: invokestatic #113 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 133: goto 46\n 136: iload 6\n 138: i2l\n 139: lreturn\n\n private final long manhattanDistance(Day10$Coordinate, Day10$Coordinate);\n Code:\n 0: aload_1\n 1: invokevirtual #108 // Method Day10$Coordinate.getX:()I\n 4: aload_2\n 5: invokevirtual #108 // Method Day10$Coordinate.getX:()I\n 8: isub\n 9: invokestatic #131 // Method java/lang/Math.abs:(I)I\n 12: aload_1\n 13: invokevirtual #124 // Method Day10$Coordinate.getY:()I\n 16: aload_2\n 17: invokevirtual #124 // Method Day10$Coordinate.getY:()I\n 20: isub\n 21: invokestatic #131 // Method java/lang/Math.abs:(I)I\n 24: iadd\n 25: i2l\n 26: lreturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method generatePairs:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_0\n 13: aload_1\n 14: invokespecial #30 // Method generateEmptyRows:(Ljava/util/List;)Ljava/util/Set;\n 17: astore_3\n 18: aload_0\n 19: aload_1\n 20: invokespecial #33 // Method generateEmptyColumns:(Ljava/util/List;)Ljava/util/Set;\n 23: astore 4\n 25: aload_2\n 26: checkcast #35 // class java/lang/Iterable\n 29: astore 5\n 31: lconst_0\n 32: lstore 6\n 34: aload 5\n 36: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 41: astore 8\n 43: aload 8\n 45: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 50: ifeq 152\n 53: aload 8\n 55: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 60: astore 9\n 62: lload 6\n 64: aload 9\n 66: checkcast #51 // class kotlin/Pair\n 69: astore 10\n 71: lstore 14\n 73: iconst_0\n 74: istore 11\n 76: aload 10\n 78: invokevirtual #54 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 81: checkcast #56 // class Day10$Coordinate\n 84: astore 12\n 86: aload 10\n 88: invokevirtual #59 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 91: checkcast #56 // class Day10$Coordinate\n 94: astore 13\n 96: getstatic #62 // Field INSTANCE:LDay11;\n 99: aload 12\n 101: aload 13\n 103: invokespecial #66 // Method manhattanDistance:(LDay10$Coordinate;LDay10$Coordinate;)J\n 106: getstatic #62 // Field INSTANCE:LDay11;\n 109: aload 12\n 111: aload 13\n 113: aload_3\n 114: invokespecial #70 // Method crossingRows:(LDay10$Coordinate;LDay10$Coordinate;Ljava/util/Set;)J\n 117: ldc2_w #133 // long 999999l\n 120: lmul\n 121: ladd\n 122: getstatic #62 // Field INSTANCE:LDay11;\n 125: aload 12\n 127: aload 13\n 129: aload 4\n 131: invokespecial #73 // Method crossingColumns:(LDay10$Coordinate;LDay10$Coordinate;Ljava/util/Set;)J\n 134: ldc2_w #133 // long 999999l\n 137: lmul\n 138: ladd\n 139: nop\n 140: lstore 16\n 142: lload 14\n 144: lload 16\n 146: ladd\n 147: lstore 6\n 149: goto 43\n 152: lload 6\n 154: invokestatic #79 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 157: areturn\n\n private final java.util.List<kotlin.Pair<Day10$Coordinate, Day10$Coordinate>> generatePairs(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #35 // class java/lang/Iterable\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: astore 5\n 11: new #138 // class java/util/ArrayList\n 14: dup\n 15: aload_3\n 16: bipush 10\n 18: invokestatic #142 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 21: invokespecial #145 // Method java/util/ArrayList.\"<init>\":(I)V\n 24: checkcast #96 // class java/util/Collection\n 27: astore 6\n 29: iconst_0\n 30: istore 7\n 32: iconst_0\n 33: istore 8\n 35: aload 5\n 37: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 42: astore 9\n 44: aload 9\n 46: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 51: ifeq 259\n 54: aload 9\n 56: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 10\n 63: aload 6\n 65: iload 8\n 67: iinc 8, 1\n 70: istore 11\n 72: iload 11\n 74: ifge 80\n 77: invokestatic #148 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 80: iload 11\n 82: aload 10\n 84: checkcast #75 // class java/lang/String\n 87: astore 12\n 89: istore 13\n 91: astore 33\n 93: iconst_0\n 94: istore 14\n 96: aload 12\n 98: checkcast #150 // class java/lang/CharSequence\n 101: astore 15\n 103: iconst_0\n 104: istore 16\n 106: aload 15\n 108: astore 17\n 110: new #138 // class java/util/ArrayList\n 113: dup\n 114: invokespecial #151 // Method java/util/ArrayList.\"<init>\":()V\n 117: checkcast #96 // class java/util/Collection\n 120: astore 18\n 122: iconst_0\n 123: istore 19\n 125: aload 17\n 127: astore 20\n 129: iconst_0\n 130: istore 21\n 132: iconst_0\n 133: istore 22\n 135: iconst_0\n 136: istore 23\n 138: iload 23\n 140: aload 20\n 142: invokeinterface #154, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 147: if_icmpge 239\n 150: aload 20\n 152: iload 23\n 154: invokeinterface #158, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 159: istore 24\n 161: iload 22\n 163: iinc 22, 1\n 166: iload 24\n 168: istore 25\n 170: istore 26\n 172: iconst_0\n 173: istore 27\n 175: iload 26\n 177: iload 25\n 179: istore 28\n 181: istore 29\n 183: iconst_0\n 184: istore 30\n 186: iload 28\n 188: bipush 35\n 190: if_icmpne 207\n 193: new #56 // class Day10$Coordinate\n 196: dup\n 197: iload 29\n 199: iload 13\n 201: invokespecial #161 // Method Day10$Coordinate.\"<init>\":(II)V\n 204: goto 208\n 207: aconst_null\n 208: nop\n 209: dup\n 210: ifnull 231\n 213: astore 31\n 215: iconst_0\n 216: istore 32\n 218: aload 18\n 220: aload 31\n 222: invokeinterface #165, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 227: pop\n 228: goto 232\n 231: pop\n 232: nop\n 233: iinc 23, 1\n 236: goto 138\n 239: nop\n 240: aload 18\n 242: checkcast #91 // class java/util/List\n 245: nop\n 246: nop\n 247: aload 33\n 249: swap\n 250: invokeinterface #165, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 255: pop\n 256: goto 44\n 259: aload 6\n 261: checkcast #91 // class java/util/List\n 264: nop\n 265: checkcast #35 // class java/lang/Iterable\n 268: invokestatic #169 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;\n 271: astore_2\n 272: aload_2\n 273: checkcast #96 // class java/util/Collection\n 276: invokestatic #173 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;\n 279: checkcast #35 // class java/lang/Iterable\n 282: astore_3\n 283: iconst_0\n 284: istore 4\n 286: aload_3\n 287: astore 5\n 289: new #138 // class java/util/ArrayList\n 292: dup\n 293: invokespecial #151 // Method java/util/ArrayList.\"<init>\":()V\n 296: checkcast #96 // class java/util/Collection\n 299: astore 6\n 301: iconst_0\n 302: istore 7\n 304: aload 5\n 306: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 311: astore 8\n 313: aload 8\n 315: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 320: ifeq 485\n 323: aload 8\n 325: checkcast #175 // class kotlin/collections/IntIterator\n 328: invokevirtual #178 // Method kotlin/collections/IntIterator.nextInt:()I\n 331: istore 9\n 333: iload 9\n 335: istore 10\n 337: iconst_0\n 338: istore 11\n 340: iload 10\n 342: iconst_1\n 343: iadd\n 344: aload_2\n 345: invokeinterface #181, 1 // InterfaceMethod java/util/List.size:()I\n 350: invokestatic #187 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 353: checkcast #35 // class java/lang/Iterable\n 356: astore 12\n 358: iconst_0\n 359: istore 13\n 361: aload 12\n 363: astore 14\n 365: new #138 // class java/util/ArrayList\n 368: dup\n 369: aload 12\n 371: bipush 10\n 373: invokestatic #142 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 376: invokespecial #145 // Method java/util/ArrayList.\"<init>\":(I)V\n 379: checkcast #96 // class java/util/Collection\n 382: astore 15\n 384: iconst_0\n 385: istore 16\n 387: aload 14\n 389: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 394: astore 17\n 396: aload 17\n 398: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 403: ifeq 462\n 406: aload 17\n 408: checkcast #175 // class kotlin/collections/IntIterator\n 411: invokevirtual #178 // Method kotlin/collections/IntIterator.nextInt:()I\n 414: istore 18\n 416: aload 15\n 418: iload 18\n 420: istore 19\n 422: astore 20\n 424: iconst_0\n 425: istore 21\n 427: new #51 // class kotlin/Pair\n 430: dup\n 431: aload_2\n 432: iload 10\n 434: invokeinterface #191, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 439: aload_2\n 440: iload 19\n 442: invokeinterface #191, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 447: invokespecial #194 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 450: aload 20\n 452: swap\n 453: invokeinterface #165, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 458: pop\n 459: goto 396\n 462: aload 15\n 464: checkcast #91 // class java/util/List\n 467: nop\n 468: checkcast #35 // class java/lang/Iterable\n 471: nop\n 472: astore 10\n 474: aload 6\n 476: aload 10\n 478: invokestatic #198 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 481: pop\n 482: goto 313\n 485: aload 6\n 487: checkcast #91 // class java/util/List\n 490: nop\n 491: areturn\n\n private final java.util.Set<java.lang.Integer> generateEmptyColumns(java.util.List<java.lang.String>);\n Code:\n 0: iconst_0\n 1: aload_1\n 2: iconst_0\n 3: invokeinterface #191, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 8: checkcast #75 // class java/lang/String\n 11: invokevirtual #243 // Method java/lang/String.length:()I\n 14: invokestatic #187 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;\n 17: checkcast #35 // class java/lang/Iterable\n 20: astore_2\n 21: iconst_0\n 22: istore_3\n 23: aload_2\n 24: astore 4\n 26: new #138 // class java/util/ArrayList\n 29: dup\n 30: invokespecial #151 // Method java/util/ArrayList.\"<init>\":()V\n 33: checkcast #96 // class java/util/Collection\n 36: astore 5\n 38: iconst_0\n 39: istore 6\n 41: aload 4\n 43: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 7\n 50: aload 7\n 52: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 196\n 60: aload 7\n 62: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 8\n 69: aload 8\n 71: checkcast #101 // class java/lang/Number\n 74: invokevirtual #105 // Method java/lang/Number.intValue:()I\n 77: istore 9\n 79: iconst_0\n 80: istore 10\n 82: aload_1\n 83: checkcast #35 // class java/lang/Iterable\n 86: astore 11\n 88: iconst_0\n 89: istore 12\n 91: aload 11\n 93: instanceof #96 // class java/util/Collection\n 96: ifeq 116\n 99: aload 11\n 101: checkcast #96 // class java/util/Collection\n 104: invokeinterface #99, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 109: ifeq 116\n 112: iconst_1\n 113: goto 179\n 116: aload 11\n 118: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 123: astore 13\n 125: aload 13\n 127: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 132: ifeq 178\n 135: aload 13\n 137: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 142: astore 14\n 144: aload 14\n 146: checkcast #75 // class java/lang/String\n 149: astore 15\n 151: iconst_0\n 152: istore 16\n 154: aload 15\n 156: iload 9\n 158: invokevirtual #244 // Method java/lang/String.charAt:(I)C\n 161: bipush 46\n 163: if_icmpne 170\n 166: iconst_1\n 167: goto 171\n 170: iconst_0\n 171: ifne 125\n 174: iconst_0\n 175: goto 179\n 178: iconst_1\n 179: nop\n 180: ifeq 50\n 183: aload 5\n 185: aload 8\n 187: invokeinterface #165, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 192: pop\n 193: goto 50\n 196: aload 5\n 198: checkcast #91 // class java/util/List\n 201: nop\n 202: checkcast #35 // class java/lang/Iterable\n 205: invokestatic #248 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 208: areturn\n\n private final java.util.Set<java.lang.Integer> generateEmptyRows(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #35 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: astore 4\n 10: new #138 // class java/util/ArrayList\n 13: dup\n 14: invokespecial #151 // Method java/util/ArrayList.\"<init>\":()V\n 17: checkcast #96 // class java/util/Collection\n 20: astore 5\n 22: iconst_0\n 23: istore 6\n 25: aload 4\n 27: astore 7\n 29: iconst_0\n 30: istore 8\n 32: iconst_0\n 33: istore 9\n 35: aload 7\n 37: invokeinterface #39, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 42: astore 10\n 44: aload 10\n 46: invokeinterface #45, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 51: ifeq 212\n 54: aload 10\n 56: invokeinterface #49, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 11\n 63: iload 9\n 65: iinc 9, 1\n 68: istore 12\n 70: iload 12\n 72: ifge 78\n 75: invokestatic #148 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V\n 78: iload 12\n 80: aload 11\n 82: astore 13\n 84: istore 14\n 86: iconst_0\n 87: istore 15\n 89: iload 14\n 91: aload 13\n 93: checkcast #75 // class java/lang/String\n 96: astore 16\n 98: istore 17\n 100: iconst_0\n 101: istore 18\n 103: aload 16\n 105: checkcast #150 // class java/lang/CharSequence\n 108: astore 19\n 110: iconst_0\n 111: istore 20\n 113: iconst_0\n 114: istore 21\n 116: iload 21\n 118: aload 19\n 120: invokeinterface #154, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 125: if_icmpge 171\n 128: aload 19\n 130: iload 21\n 132: invokeinterface #158, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 137: istore 22\n 139: iload 22\n 141: istore 23\n 143: iconst_0\n 144: istore 24\n 146: iload 23\n 148: bipush 46\n 150: if_icmpne 157\n 153: iconst_1\n 154: goto 158\n 157: iconst_0\n 158: ifne 165\n 161: iconst_0\n 162: goto 172\n 165: iinc 21, 1\n 168: goto 116\n 171: iconst_1\n 172: ifeq 183\n 175: iload 17\n 177: invokestatic #262 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 180: goto 184\n 183: aconst_null\n 184: nop\n 185: dup\n 186: ifnull 207\n 189: astore 25\n 191: iconst_0\n 192: istore 26\n 194: aload 5\n 196: aload 25\n 198: invokeinterface #165, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 203: pop\n 204: goto 208\n 207: pop\n 208: nop\n 209: goto 44\n 212: nop\n 213: aload 5\n 215: checkcast #91 // class java/util/List\n 218: nop\n 219: checkcast #35 // class java/lang/Iterable\n 222: invokestatic #248 // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;\n 225: areturn\n\n static {};\n Code:\n 0: new #2 // class Day11\n 3: dup\n 4: invokespecial #268 // Method \"<init>\":()V\n 7: putstatic #62 // Field INSTANCE:LDay11;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day18.kt
import java.util.* import kotlin.String import kotlin.collections.List object Day18 { data class Segment(val coordinates: Set<Day17.Coordinate>) { val minX = coordinates.minOf { it.x } val maxX = coordinates.maxOf { it.x } val minY = coordinates.minOf { it.y } val maxY = coordinates.maxOf { it.y } fun crosses(coordinate: Day17.Coordinate): Boolean { return if (minX == maxX && minX == coordinate.x) { coordinate.y in minY..maxY } else if (minY == maxY && minY == coordinate.y) { coordinate.x in minX..maxX } else { false } } fun crosses(y: Int): Boolean { return y in minY..maxY } fun length(): Int { return if (minX == maxX) { maxY - minY + 1 } else { maxX - minX + 1 } } /** * Returns true if the segment is vertical, false otherwise */ fun isVertical(): Boolean { return minX == maxX } /** * Returns true if the segment is horizontal, false otherwise */ fun isHorizontal(): Boolean { return minY == maxY } override fun hashCode(): Int { return Objects.hash(minX, maxX, minY, maxY) } override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false other as Segment if (coordinates != other.coordinates) return false if (minX != other.minX) return false if (maxX != other.maxX) return false if (minY != other.minY) return false if (maxY != other.maxY) return false return true } } enum class Direction { UP, DOWN, LEFT, RIGHT } data class Instruction(val direction: Direction, val steps: Int, val colorCode: String) { fun toTrueInstruction(): Instruction { val directionCode = colorCode.last() val hexSteps = colorCode.drop(1).dropLast(1) val steps = hexSteps.toInt(16) val direction = when (directionCode) { '0' -> Direction.RIGHT '1' -> Direction.DOWN '2' -> Direction.LEFT '3' -> Direction.UP else -> throw IllegalStateException("Should not happen") } return Instruction(direction, steps, colorCode) } companion object { fun parse(input: String): Instruction { val pattern = "([U|L|D|R]) ([0-9]+) \\((#[a-z0-9]+)\\)".toRegex() val (rawDirection, rawSteps, rawColorCode) = pattern.matchEntire(input)!!.destructured val direction = when (rawDirection) { "U" -> Direction.UP "D" -> Direction.DOWN "L" -> Direction.LEFT "R" -> Direction.RIGHT else -> throw IllegalStateException("Should not happen") } val steps = rawSteps.toInt() return Instruction(direction, steps, rawColorCode) } } } fun part1(input: List<String>): String { val instructions = input.map { Instruction.parse(it) } return cubicMetersEnclosed(instructions).toString() } fun cubicMetersEnclosed(instructions: List<Instruction>): Long { val segments = dig(instructions) val minY = segments.minOf { it.minY } val maxY = segments.maxOf { it.maxY } val minX = segments.minOf { it.minX } val maxX = segments.maxOf { it.maxX } val delta = maxY - minY var current = 0 var mySegments = segments.sortedWith(compareBy({ it.minY }, { it.maxY })) val enclosedCoordinates = (minY..maxY).sumOf { y -> val startCoordinate = Day17.Coordinate(minX, y) val endCoordinate = Day17.Coordinate(maxX, y) val ret = rayCast(startCoordinate, endCoordinate, mySegments) current += 1 if (current % 1000000 == 0) { mySegments = mySegments.filter { it.maxY >= y } println("Progress: ${String.format("%.2f", current.toDouble() / delta * 100)}%") } ret } val segmentSizes = segments.sumOf { it.length() } val duplicateSegments = segments.flatMap { it.coordinates.toList() }.groupBy { it }.filter { it.value.size > 1 }.keys.size return (enclosedCoordinates + segmentSizes - duplicateSegments) } private fun rayCast( startCoordinate: Day17.Coordinate, endCoordinate: Day17.Coordinate, segments: List<Segment> ): Long { var segmentsEncountered = 0 var cellsWithinPolygon = 0L val runningSegmentsCrossed = mutableSetOf<Segment>() var currentX = startCoordinate.x val segmentsCrossedByRay = segments .takeWhile { it.minY <= endCoordinate.y } .filter { it.crosses(startCoordinate.y) } while (currentX <= endCoordinate.x) { val currentCoordinate = Day17.Coordinate(currentX, startCoordinate.y) val segmentCrosses = segmentsCrossedByRay.filter { it.crosses(currentCoordinate) } val sizeBefore = runningSegmentsCrossed.size runningSegmentsCrossed.addAll(segmentCrosses) val sizeAfter = runningSegmentsCrossed.size val touchedAnotherSegment = sizeAfter > sizeBefore if (segmentCrosses.isNotEmpty()) { // Advance the current position to the max x value of the segment we crossed currentX = segmentCrosses.maxOf { it.maxX } // This is an odd edge case // where there are overlapping segments that are connected // but we encountered the last one if (!touchedAnotherSegment) { currentX += 1 } } else { if (isSingleOrSnakeShaped(runningSegmentsCrossed)) { segmentsEncountered += 1 } runningSegmentsCrossed.clear() val nextSegmentToBeCrossed = segmentsCrossedByRay .minOfOrNull { if (it.minX > currentX) it.minX else Int.MAX_VALUE } val nextX = nextSegmentToBeCrossed ?: (endCoordinate.x + 1) // If the number of segments encountered is odd, then we are within the polygon val isWithinPolygon = segmentsEncountered % 2 == 1 if (isWithinPolygon) { val lengthOfEmptySpace = nextX - currentX cellsWithinPolygon += lengthOfEmptySpace } // Advance the current position to the next segment crossing since all of // these are filled or ignored currentX = nextX } } return cellsWithinPolygon } /** * An annoying case in which we can run into * is when we have a single segment or a snake shaped segment * * # * # * # * # # # * # * # * # * * This counts as one segment */ private fun isSingleOrSnakeShaped(crossedSegments: Set<Segment>): Boolean { if (crossedSegments.isEmpty()) { return false } if (crossedSegments.size == 1) { return true } if (crossedSegments.size == 2) { return false } val verticalSegments = crossedSegments.count { it.isVertical() } val horizontalSegments = crossedSegments.count { it.isHorizontal() } return if (verticalSegments > horizontalSegments) { // This means that the segments are vertical but share a same y coordinte, like // // # // # // # // # # # // # // # // # val sorted = crossedSegments.sortedWith( compareBy({ it.minX }, { it.maxX }) ) val start = sorted.first() val end = sorted.last() val ys = start.coordinates.map { it.y }.toList() + end.coordinates.map { it.y }.toList() val grouped = ys.groupBy { it } val ysThatAppearTwice = grouped.filter { it.value.size == 2 }.keys.first() ysThatAppearTwice > ys.min() && ysThatAppearTwice < ys.max() } else { // This means that the segments are horizontal but share a same x coordinate, like // // # # # # // # // # // # // # // # // # # # # val sorted = crossedSegments.sortedWith(compareBy({ it.minY }, { it.maxY })) val start = sorted.first() val end = sorted.last() val xs = start.coordinates.map { it.x }.toList() + end.coordinates.map { it.x }.toList() val grouped = xs.groupBy { it } val xsThatAppearTwice = grouped.filter { it.value.size == 2 }.keys.first() xsThatAppearTwice > xs.min() && xsThatAppearTwice < xs.max() } } /** * Take a list of instructions that take a starting point and a direction to "dig", which * will then be represented as line segments */ fun dig(instructions: List<Instruction>): List<Segment> { val currentCoordinate = Day17.Coordinate(0, 0) return instructions.fold(currentCoordinate to emptyList<Segment>()) { (currentCoordinate, segments), instruction -> val direction = instruction.direction val steps = instruction.steps val nextCoordinate = when (direction) { Direction.UP -> Day17.Coordinate(currentCoordinate.x, currentCoordinate.y - steps) Direction.DOWN -> Day17.Coordinate(currentCoordinate.x, currentCoordinate.y + steps) Direction.LEFT -> Day17.Coordinate(currentCoordinate.x - steps, currentCoordinate.y) Direction.RIGHT -> Day17.Coordinate(currentCoordinate.x + steps, currentCoordinate.y) } val segment = Segment(setOf(currentCoordinate, nextCoordinate)) nextCoordinate to (segments + listOf(segment)) }.second } fun part2(input: List<String>): String { val instructions = input.map { Instruction.parse(it) }.map { it.toTrueInstruction() } return cubicMetersEnclosed(instructions).toString() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day18$Direction.class", "javap": "Compiled from \"Day18.kt\"\npublic final class Day18$Direction extends java.lang.Enum<Day18$Direction> {\n public static final Day18$Direction UP;\n\n public static final Day18$Direction DOWN;\n\n public static final Day18$Direction LEFT;\n\n public static final Day18$Direction RIGHT;\n\n private static final Day18$Direction[] $VALUES;\n\n private static final kotlin.enums.EnumEntries $ENTRIES;\n\n private Day18$Direction();\n Code:\n 0: aload_0\n 1: aload_1\n 2: iload_2\n 3: invokespecial #10 // Method java/lang/Enum.\"<init>\":(Ljava/lang/String;I)V\n 6: return\n\n public static Day18$Direction[] values();\n Code:\n 0: getstatic #22 // Field $VALUES:[LDay18$Direction;\n 3: invokevirtual #28 // Method java/lang/Object.clone:()Ljava/lang/Object;\n 6: checkcast #29 // class \"[LDay18$Direction;\"\n 9: areturn\n\n public static Day18$Direction valueOf(java.lang.String);\n Code:\n 0: ldc #2 // class Day18$Direction\n 2: aload_0\n 3: invokestatic #34 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;\n 6: checkcast #2 // class Day18$Direction\n 9: areturn\n\n public static kotlin.enums.EnumEntries<Day18$Direction> getEntries();\n Code:\n 0: getstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 3: areturn\n\n private static final Day18$Direction[] $values();\n Code:\n 0: iconst_4\n 1: anewarray #2 // class Day18$Direction\n 4: astore_0\n 5: aload_0\n 6: iconst_0\n 7: getstatic #47 // Field UP:LDay18$Direction;\n 10: aastore\n 11: aload_0\n 12: iconst_1\n 13: getstatic #50 // Field DOWN:LDay18$Direction;\n 16: aastore\n 17: aload_0\n 18: iconst_2\n 19: getstatic #53 // Field LEFT:LDay18$Direction;\n 22: aastore\n 23: aload_0\n 24: iconst_3\n 25: getstatic #56 // Field RIGHT:LDay18$Direction;\n 28: aastore\n 29: aload_0\n 30: areturn\n\n static {};\n Code:\n 0: new #2 // class Day18$Direction\n 3: dup\n 4: ldc #58 // String UP\n 6: iconst_0\n 7: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 10: putstatic #47 // Field UP:LDay18$Direction;\n 13: new #2 // class Day18$Direction\n 16: dup\n 17: ldc #60 // String DOWN\n 19: iconst_1\n 20: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 23: putstatic #50 // Field DOWN:LDay18$Direction;\n 26: new #2 // class Day18$Direction\n 29: dup\n 30: ldc #61 // String LEFT\n 32: iconst_2\n 33: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 36: putstatic #53 // Field LEFT:LDay18$Direction;\n 39: new #2 // class Day18$Direction\n 42: dup\n 43: ldc #62 // String RIGHT\n 45: iconst_3\n 46: invokespecial #59 // Method \"<init>\":(Ljava/lang/String;I)V\n 49: putstatic #56 // Field RIGHT:LDay18$Direction;\n 52: invokestatic #64 // Method $values:()[LDay18$Direction;\n 55: putstatic #22 // Field $VALUES:[LDay18$Direction;\n 58: getstatic #22 // Field $VALUES:[LDay18$Direction;\n 61: checkcast #66 // class \"[Ljava/lang/Enum;\"\n 64: invokestatic #72 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;\n 67: putstatic #43 // Field $ENTRIES:Lkotlin/enums/EnumEntries;\n 70: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day18$Instruction$Companion.class", "javap": "Compiled from \"Day18.kt\"\npublic final class Day18$Instruction$Companion {\n private Day18$Instruction$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day18$Instruction parse(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #23 // class kotlin/text/Regex\n 9: dup\n 10: ldc #25 // String ([U|L|D|R]) ([0-9]+) \\\\((#[a-z0-9]+)\\\\)\n 12: invokespecial #28 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 15: astore_2\n 16: aload_2\n 17: aload_1\n 18: checkcast #30 // class java/lang/CharSequence\n 21: invokevirtual #34 // Method kotlin/text/Regex.matchEntire:(Ljava/lang/CharSequence;)Lkotlin/text/MatchResult;\n 24: dup\n 25: invokestatic #38 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 28: invokeinterface #44, 1 // InterfaceMethod kotlin/text/MatchResult.getDestructured:()Lkotlin/text/MatchResult$Destructured;\n 33: astore_3\n 34: aload_3\n 35: invokevirtual #50 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 38: invokeinterface #54, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 43: iconst_1\n 44: invokeinterface #60, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 49: checkcast #62 // class java/lang/String\n 52: astore 4\n 54: aload_3\n 55: invokevirtual #50 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 58: invokeinterface #54, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 63: iconst_2\n 64: invokeinterface #60, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 69: checkcast #62 // class java/lang/String\n 72: astore 5\n 74: aload_3\n 75: invokevirtual #50 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;\n 78: invokeinterface #54, 1 // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;\n 83: iconst_3\n 84: invokeinterface #60, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 89: checkcast #62 // class java/lang/String\n 92: astore 6\n 94: aload 4\n 96: astore 8\n 98: aload 8\n 100: invokevirtual #66 // Method java/lang/String.hashCode:()I\n 103: lookupswitch { // 4\n 68: 157\n 76: 183\n 82: 144\n 85: 170\n default: 220\n }\n 144: aload 8\n 146: ldc #68 // String R\n 148: invokevirtual #72 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 151: ifne 214\n 154: goto 220\n 157: aload 8\n 159: ldc #74 // String D\n 161: invokevirtual #72 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 164: ifne 202\n 167: goto 220\n 170: aload 8\n 172: ldc #76 // String U\n 174: invokevirtual #72 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 177: ifne 196\n 180: goto 220\n 183: aload 8\n 185: ldc #78 // String L\n 187: invokevirtual #72 // Method java/lang/String.equals:(Ljava/lang/Object;)Z\n 190: ifne 208\n 193: goto 220\n 196: getstatic #84 // Field Day18$Direction.UP:LDay18$Direction;\n 199: goto 230\n 202: getstatic #87 // Field Day18$Direction.DOWN:LDay18$Direction;\n 205: goto 230\n 208: getstatic #90 // Field Day18$Direction.LEFT:LDay18$Direction;\n 211: goto 230\n 214: getstatic #93 // Field Day18$Direction.RIGHT:LDay18$Direction;\n 217: goto 230\n 220: new #95 // class java/lang/IllegalStateException\n 223: dup\n 224: ldc #97 // String Should not happen\n 226: invokespecial #98 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 229: athrow\n 230: astore 7\n 232: aload 5\n 234: invokestatic #104 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 237: istore 8\n 239: new #106 // class Day18$Instruction\n 242: dup\n 243: aload 7\n 245: iload 8\n 247: aload 6\n 249: invokespecial #109 // Method Day18$Instruction.\"<init>\":(LDay18$Direction;ILjava/lang/String;)V\n 252: areturn\n\n public Day18$Instruction$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #120 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day18$Segment.class", "javap": "Compiled from \"Day18.kt\"\npublic final class Day18$Segment {\n private final java.util.Set<Day17$Coordinate> coordinates;\n\n private final int minX;\n\n private final int maxX;\n\n private final int minY;\n\n private final int maxY;\n\n public Day18$Segment(java.util.Set<Day17$Coordinate>);\n Code:\n 0: aload_1\n 1: ldc #10 // String coordinates\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokespecial #19 // Method java/lang/Object.\"<init>\":()V\n 10: aload_0\n 11: aload_1\n 12: putfield #22 // Field coordinates:Ljava/util/Set;\n 15: aload_0\n 16: aload_0\n 17: getfield #22 // Field coordinates:Ljava/util/Set;\n 20: checkcast #24 // class java/lang/Iterable\n 23: astore_2\n 24: astore 7\n 26: aload_2\n 27: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 32: astore_3\n 33: aload_3\n 34: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 39: ifne 50\n 42: new #36 // class java/util/NoSuchElementException\n 45: dup\n 46: invokespecial #37 // Method java/util/NoSuchElementException.\"<init>\":()V\n 49: athrow\n 50: aload_3\n 51: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 56: checkcast #43 // class Day17$Coordinate\n 59: astore 4\n 61: iconst_0\n 62: istore 5\n 64: aload 4\n 66: invokevirtual #47 // Method Day17$Coordinate.getX:()I\n 69: istore 4\n 71: aload_3\n 72: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 77: ifeq 115\n 80: aload_3\n 81: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 86: checkcast #43 // class Day17$Coordinate\n 89: astore 5\n 91: iconst_0\n 92: istore 6\n 94: aload 5\n 96: invokevirtual #47 // Method Day17$Coordinate.getX:()I\n 99: istore 5\n 101: iload 4\n 103: iload 5\n 105: if_icmple 71\n 108: iload 5\n 110: istore 4\n 112: goto 71\n 115: iload 4\n 117: istore 8\n 119: aload 7\n 121: iload 8\n 123: putfield #51 // Field minX:I\n 126: aload_0\n 127: aload_0\n 128: getfield #22 // Field coordinates:Ljava/util/Set;\n 131: checkcast #24 // class java/lang/Iterable\n 134: astore_2\n 135: astore 7\n 137: aload_2\n 138: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 143: astore_3\n 144: aload_3\n 145: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 150: ifne 161\n 153: new #36 // class java/util/NoSuchElementException\n 156: dup\n 157: invokespecial #37 // Method java/util/NoSuchElementException.\"<init>\":()V\n 160: athrow\n 161: aload_3\n 162: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 167: checkcast #43 // class Day17$Coordinate\n 170: astore 4\n 172: iconst_0\n 173: istore 5\n 175: aload 4\n 177: invokevirtual #47 // Method Day17$Coordinate.getX:()I\n 180: istore 4\n 182: aload_3\n 183: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 188: ifeq 226\n 191: aload_3\n 192: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 197: checkcast #43 // class Day17$Coordinate\n 200: astore 5\n 202: iconst_0\n 203: istore 6\n 205: aload 5\n 207: invokevirtual #47 // Method Day17$Coordinate.getX:()I\n 210: istore 5\n 212: iload 4\n 214: iload 5\n 216: if_icmpge 182\n 219: iload 5\n 221: istore 4\n 223: goto 182\n 226: iload 4\n 228: istore 8\n 230: aload 7\n 232: iload 8\n 234: putfield #54 // Field maxX:I\n 237: aload_0\n 238: aload_0\n 239: getfield #22 // Field coordinates:Ljava/util/Set;\n 242: checkcast #24 // class java/lang/Iterable\n 245: astore_2\n 246: astore 7\n 248: aload_2\n 249: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 254: astore_3\n 255: aload_3\n 256: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 261: ifne 272\n 264: new #36 // class java/util/NoSuchElementException\n 267: dup\n 268: invokespecial #37 // Method java/util/NoSuchElementException.\"<init>\":()V\n 271: athrow\n 272: aload_3\n 273: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 278: checkcast #43 // class Day17$Coordinate\n 281: astore 4\n 283: iconst_0\n 284: istore 5\n 286: aload 4\n 288: invokevirtual #57 // Method Day17$Coordinate.getY:()I\n 291: istore 4\n 293: aload_3\n 294: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 299: ifeq 337\n 302: aload_3\n 303: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 308: checkcast #43 // class Day17$Coordinate\n 311: astore 5\n 313: iconst_0\n 314: istore 6\n 316: aload 5\n 318: invokevirtual #57 // Method Day17$Coordinate.getY:()I\n 321: istore 5\n 323: iload 4\n 325: iload 5\n 327: if_icmple 293\n 330: iload 5\n 332: istore 4\n 334: goto 293\n 337: iload 4\n 339: istore 8\n 341: aload 7\n 343: iload 8\n 345: putfield #60 // Field minY:I\n 348: aload_0\n 349: aload_0\n 350: getfield #22 // Field coordinates:Ljava/util/Set;\n 353: checkcast #24 // class java/lang/Iterable\n 356: astore_2\n 357: astore 7\n 359: aload_2\n 360: invokeinterface #28, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 365: astore_3\n 366: aload_3\n 367: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 372: ifne 383\n 375: new #36 // class java/util/NoSuchElementException\n 378: dup\n 379: invokespecial #37 // Method java/util/NoSuchElementException.\"<init>\":()V\n 382: athrow\n 383: aload_3\n 384: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 389: checkcast #43 // class Day17$Coordinate\n 392: astore 4\n 394: iconst_0\n 395: istore 5\n 397: aload 4\n 399: invokevirtual #57 // Method Day17$Coordinate.getY:()I\n 402: istore 4\n 404: aload_3\n 405: invokeinterface #34, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 410: ifeq 448\n 413: aload_3\n 414: invokeinterface #41, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 419: checkcast #43 // class Day17$Coordinate\n 422: astore 5\n 424: iconst_0\n 425: istore 6\n 427: aload 5\n 429: invokevirtual #57 // Method Day17$Coordinate.getY:()I\n 432: istore 5\n 434: iload 4\n 436: iload 5\n 438: if_icmpge 404\n 441: iload 5\n 443: istore 4\n 445: goto 404\n 448: iload 4\n 450: istore 8\n 452: aload 7\n 454: iload 8\n 456: putfield #63 // Field maxY:I\n 459: return\n\n public final java.util.Set<Day17$Coordinate> getCoordinates();\n Code:\n 0: aload_0\n 1: getfield #22 // Field coordinates:Ljava/util/Set;\n 4: areturn\n\n public final int getMinX();\n Code:\n 0: aload_0\n 1: getfield #51 // Field minX:I\n 4: ireturn\n\n public final int getMaxX();\n Code:\n 0: aload_0\n 1: getfield #54 // Field maxX:I\n 4: ireturn\n\n public final int getMinY();\n Code:\n 0: aload_0\n 1: getfield #60 // Field minY:I\n 4: ireturn\n\n public final int getMaxY();\n Code:\n 0: aload_0\n 1: getfield #63 // Field maxY:I\n 4: ireturn\n\n public final boolean crosses(Day17$Coordinate);\n Code:\n 0: aload_1\n 1: ldc #84 // String coordinate\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getfield #51 // Field minX:I\n 10: aload_0\n 11: getfield #54 // Field maxX:I\n 14: if_icmpne 68\n 17: aload_0\n 18: getfield #51 // Field minX:I\n 21: aload_1\n 22: invokevirtual #47 // Method Day17$Coordinate.getX:()I\n 25: if_icmpne 68\n 28: aload_0\n 29: getfield #60 // Field minY:I\n 32: istore_2\n 33: aload_0\n 34: getfield #63 // Field maxY:I\n 37: istore_3\n 38: aload_1\n 39: invokevirtual #57 // Method Day17$Coordinate.getY:()I\n 42: istore 4\n 44: iload_2\n 45: iload 4\n 47: if_icmpgt 64\n 50: iload 4\n 52: iload_3\n 53: if_icmpgt 60\n 56: iconst_1\n 57: goto 131\n 60: iconst_0\n 61: goto 131\n 64: iconst_0\n 65: goto 131\n 68: aload_0\n 69: getfield #60 // Field minY:I\n 72: aload_0\n 73: getfield #63 // Field maxY:I\n 76: if_icmpne 130\n 79: aload_0\n 80: getfield #60 // Field minY:I\n 83: aload_1\n 84: invokevirtual #57 // Method Day17$Coordinate.getY:()I\n 87: if_icmpne 130\n 90: aload_0\n 91: getfield #51 // Field minX:I\n 94: istore_2\n 95: aload_0\n 96: getfield #54 // Field maxX:I\n 99: istore_3\n 100: aload_1\n 101: invokevirtual #47 // Method Day17$Coordinate.getX:()I\n 104: istore 4\n 106: iload_2\n 107: iload 4\n 109: if_icmpgt 126\n 112: iload 4\n 114: iload_3\n 115: if_icmpgt 122\n 118: iconst_1\n 119: goto 131\n 122: iconst_0\n 123: goto 131\n 126: iconst_0\n 127: goto 131\n 130: iconst_0\n 131: ireturn\n\n public final boolean crosses(int);\n Code:\n 0: aload_0\n 1: getfield #60 // Field minY:I\n 4: istore_2\n 5: iload_1\n 6: aload_0\n 7: getfield #63 // Field maxY:I\n 10: if_icmpgt 26\n 13: iload_2\n 14: iload_1\n 15: if_icmpgt 22\n 18: iconst_1\n 19: goto 27\n 22: iconst_0\n 23: goto 27\n 26: iconst_0\n 27: ireturn\n\n public final int length();\n Code:\n 0: aload_0\n 1: getfield #51 // Field minX:I\n 4: aload_0\n 5: getfield #54 // Field maxX:I\n 8: if_icmpne 25\n 11: aload_0\n 12: getfield #63 // Field maxY:I\n 15: aload_0\n 16: getfield #60 // Field minY:I\n 19: isub\n 20: iconst_1\n 21: iadd\n 22: goto 36\n 25: aload_0\n 26: getfield #54 // Field maxX:I\n 29: aload_0\n 30: getfield #51 // Field minX:I\n 33: isub\n 34: iconst_1\n 35: iadd\n 36: ireturn\n\n public final boolean isVertical();\n Code:\n 0: aload_0\n 1: getfield #51 // Field minX:I\n 4: aload_0\n 5: getfield #54 // Field maxX:I\n 8: if_icmpne 15\n 11: iconst_1\n 12: goto 16\n 15: iconst_0\n 16: ireturn\n\n public final boolean isHorizontal();\n Code:\n 0: aload_0\n 1: getfield #60 // Field minY:I\n 4: aload_0\n 5: getfield #63 // Field maxY:I\n 8: if_icmpne 15\n 11: iconst_1\n 12: goto 16\n 15: iconst_0\n 16: ireturn\n\n public int hashCode();\n Code:\n 0: iconst_4\n 1: anewarray #4 // class java/lang/Object\n 4: astore_1\n 5: aload_1\n 6: iconst_0\n 7: aload_0\n 8: getfield #51 // Field minX:I\n 11: invokestatic #96 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: aastore\n 15: aload_1\n 16: iconst_1\n 17: aload_0\n 18: getfield #54 // Field maxX:I\n 21: invokestatic #96 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 24: aastore\n 25: aload_1\n 26: iconst_2\n 27: aload_0\n 28: getfield #60 // Field minY:I\n 31: invokestatic #96 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 34: aastore\n 35: aload_1\n 36: iconst_3\n 37: aload_0\n 38: getfield #63 // Field maxY:I\n 41: invokestatic #96 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 44: aastore\n 45: aload_1\n 46: invokestatic #102 // Method java/util/Objects.hash:([Ljava/lang/Object;)I\n 49: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_0\n 8: invokevirtual #109 // Method java/lang/Object.getClass:()Ljava/lang/Class;\n 11: aload_1\n 12: dup\n 13: ifnull 22\n 16: invokevirtual #109 // Method java/lang/Object.getClass:()Ljava/lang/Class;\n 19: goto 24\n 22: pop\n 23: aconst_null\n 24: invokestatic #113 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 27: ifne 32\n 30: iconst_0\n 31: ireturn\n 32: aload_1\n 33: ldc #115 // String null cannot be cast to non-null type <root>.Day18.Segment\n 35: invokestatic #118 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)V\n 38: aload_1\n 39: checkcast #2 // class Day18$Segment\n 42: pop\n 43: aload_0\n 44: getfield #22 // Field coordinates:Ljava/util/Set;\n 47: aload_1\n 48: checkcast #2 // class Day18$Segment\n 51: getfield #22 // Field coordinates:Ljava/util/Set;\n 54: invokestatic #113 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 57: ifne 62\n 60: iconst_0\n 61: ireturn\n 62: aload_0\n 63: getfield #51 // Field minX:I\n 66: aload_1\n 67: checkcast #2 // class Day18$Segment\n 70: getfield #51 // Field minX:I\n 73: if_icmpeq 78\n 76: iconst_0\n 77: ireturn\n 78: aload_0\n 79: getfield #54 // Field maxX:I\n 82: aload_1\n 83: checkcast #2 // class Day18$Segment\n 86: getfield #54 // Field maxX:I\n 89: if_icmpeq 94\n 92: iconst_0\n 93: ireturn\n 94: aload_0\n 95: getfield #60 // Field minY:I\n 98: aload_1\n 99: checkcast #2 // class Day18$Segment\n 102: getfield #60 // Field minY:I\n 105: if_icmpeq 110\n 108: iconst_0\n 109: ireturn\n 110: aload_0\n 111: getfield #63 // Field maxY:I\n 114: aload_1\n 115: checkcast #2 // class Day18$Segment\n 118: getfield #63 // Field maxY:I\n 121: if_icmpeq 126\n 124: iconst_0\n 125: ireturn\n 126: iconst_1\n 127: ireturn\n\n public final java.util.Set<Day17$Coordinate> component1();\n Code:\n 0: aload_0\n 1: getfield #22 // Field coordinates:Ljava/util/Set;\n 4: areturn\n\n public final Day18$Segment copy(java.util.Set<Day17$Coordinate>);\n Code:\n 0: aload_1\n 1: ldc #10 // String coordinates\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #2 // class Day18$Segment\n 9: dup\n 10: aload_1\n 11: invokespecial #128 // Method \"<init>\":(Ljava/util/Set;)V\n 14: areturn\n\n public static Day18$Segment copy$default(Day18$Segment, java.util.Set, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #22 // Field coordinates:Ljava/util/Set;\n 10: astore_1\n 11: aload_0\n 12: aload_1\n 13: invokevirtual #132 // Method copy:(Ljava/util/Set;)LDay18$Segment;\n 16: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #136 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #137 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #139 // String Segment(coordinates=\n 9: invokevirtual #143 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #22 // Field coordinates:Ljava/util/Set;\n 16: invokevirtual #146 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: bipush 41\n 21: invokevirtual #149 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 24: invokevirtual #151 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 27: areturn\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day18$Instruction.class", "javap": "Compiled from \"Day18.kt\"\npublic final class Day18$Instruction {\n public static final Day18$Instruction$Companion Companion;\n\n private final Day18$Direction direction;\n\n private final int steps;\n\n private final java.lang.String colorCode;\n\n public Day18$Instruction(Day18$Direction, int, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #9 // String direction\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: ldc #17 // String colorCode\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokespecial #20 // Method java/lang/Object.\"<init>\":()V\n 16: aload_0\n 17: aload_1\n 18: putfield #23 // Field direction:LDay18$Direction;\n 21: aload_0\n 22: iload_2\n 23: putfield #27 // Field steps:I\n 26: aload_0\n 27: aload_3\n 28: putfield #30 // Field colorCode:Ljava/lang/String;\n 31: return\n\n public final Day18$Direction getDirection();\n Code:\n 0: aload_0\n 1: getfield #23 // Field direction:LDay18$Direction;\n 4: areturn\n\n public final int getSteps();\n Code:\n 0: aload_0\n 1: getfield #27 // Field steps:I\n 4: ireturn\n\n public final java.lang.String getColorCode();\n Code:\n 0: aload_0\n 1: getfield #30 // Field colorCode:Ljava/lang/String;\n 4: areturn\n\n public final Day18$Instruction toTrueInstruction();\n Code:\n 0: aload_0\n 1: getfield #30 // Field colorCode:Ljava/lang/String;\n 4: checkcast #42 // class java/lang/CharSequence\n 7: invokestatic #48 // Method kotlin/text/StringsKt.last:(Ljava/lang/CharSequence;)C\n 10: istore_1\n 11: aload_0\n 12: getfield #30 // Field colorCode:Ljava/lang/String;\n 15: iconst_1\n 16: invokestatic #52 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;\n 19: iconst_1\n 20: invokestatic #55 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;\n 23: astore_2\n 24: aload_2\n 25: bipush 16\n 27: invokestatic #61 // Method kotlin/text/CharsKt.checkRadix:(I)I\n 30: invokestatic #67 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I\n 33: istore_3\n 34: iload_1\n 35: tableswitch { // 48 to 51\n 48: 64\n 49: 70\n 50: 76\n 51: 82\n default: 88\n }\n 64: getstatic #72 // Field Day18$Direction.RIGHT:LDay18$Direction;\n 67: goto 98\n 70: getstatic #75 // Field Day18$Direction.DOWN:LDay18$Direction;\n 73: goto 98\n 76: getstatic #78 // Field Day18$Direction.LEFT:LDay18$Direction;\n 79: goto 98\n 82: getstatic #81 // Field Day18$Direction.UP:LDay18$Direction;\n 85: goto 98\n 88: new #83 // class java/lang/IllegalStateException\n 91: dup\n 92: ldc #85 // String Should not happen\n 94: invokespecial #88 // Method java/lang/IllegalStateException.\"<init>\":(Ljava/lang/String;)V\n 97: athrow\n 98: astore 4\n 100: new #2 // class Day18$Instruction\n 103: dup\n 104: aload 4\n 106: iload_3\n 107: aload_0\n 108: getfield #30 // Field colorCode:Ljava/lang/String;\n 111: invokespecial #90 // Method \"<init>\":(LDay18$Direction;ILjava/lang/String;)V\n 114: areturn\n\n public final Day18$Direction component1();\n Code:\n 0: aload_0\n 1: getfield #23 // Field direction:LDay18$Direction;\n 4: areturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #27 // Field steps:I\n 4: ireturn\n\n public final java.lang.String component3();\n Code:\n 0: aload_0\n 1: getfield #30 // Field colorCode:Ljava/lang/String;\n 4: areturn\n\n public final Day18$Instruction copy(Day18$Direction, int, java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #9 // String direction\n 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_3\n 7: ldc #17 // String colorCode\n 9: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: new #2 // class Day18$Instruction\n 15: dup\n 16: aload_1\n 17: iload_2\n 18: aload_3\n 19: invokespecial #90 // Method \"<init>\":(LDay18$Direction;ILjava/lang/String;)V\n 22: areturn\n\n public static Day18$Instruction copy$default(Day18$Instruction, Day18$Direction, int, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload 4\n 2: iconst_1\n 3: iand\n 4: ifeq 12\n 7: aload_0\n 8: getfield #23 // Field direction:LDay18$Direction;\n 11: astore_1\n 12: iload 4\n 14: iconst_2\n 15: iand\n 16: ifeq 24\n 19: aload_0\n 20: getfield #27 // Field steps:I\n 23: istore_2\n 24: iload 4\n 26: iconst_4\n 27: iand\n 28: ifeq 36\n 31: aload_0\n 32: getfield #30 // Field colorCode:Ljava/lang/String;\n 35: astore_3\n 36: aload_0\n 37: aload_1\n 38: iload_2\n 39: aload_3\n 40: invokevirtual #104 // Method copy:(LDay18$Direction;ILjava/lang/String;)LDay18$Instruction;\n 43: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #107 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #108 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #110 // String Instruction(direction=\n 9: invokevirtual #114 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #23 // Field direction:LDay18$Direction;\n 16: invokevirtual #117 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;\n 19: ldc #119 // String , steps=\n 21: invokevirtual #114 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #27 // Field steps:I\n 28: invokevirtual #122 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: ldc #124 // String , colorCode=\n 33: invokevirtual #114 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 36: aload_0\n 37: getfield #30 // Field colorCode:Ljava/lang/String;\n 40: invokevirtual #114 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 43: bipush 41\n 45: invokevirtual #127 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 48: invokevirtual #129 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 51: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #23 // Field direction:LDay18$Direction;\n 4: invokevirtual #132 // Method Day18$Direction.hashCode:()I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #27 // Field steps:I\n 16: invokestatic #134 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: bipush 31\n 24: imul\n 25: aload_0\n 26: getfield #30 // Field colorCode:Ljava/lang/String;\n 29: invokevirtual #135 // Method java/lang/String.hashCode:()I\n 32: iadd\n 33: istore_1\n 34: iload_1\n 35: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day18$Instruction\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day18$Instruction\n 20: astore_2\n 21: aload_0\n 22: getfield #23 // Field direction:LDay18$Direction;\n 25: aload_2\n 26: getfield #23 // Field direction:LDay18$Direction;\n 29: if_acmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #27 // Field steps:I\n 38: aload_2\n 39: getfield #27 // Field steps:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: aload_0\n 48: getfield #30 // Field colorCode:Ljava/lang/String;\n 51: aload_2\n 52: getfield #30 // Field colorCode:Ljava/lang/String;\n 55: invokestatic #143 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z\n 58: ifne 63\n 61: iconst_0\n 62: ireturn\n 63: iconst_1\n 64: ireturn\n\n static {};\n Code:\n 0: new #148 // class Day18$Instruction$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #151 // Method Day18$Instruction$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #155 // Field Companion:LDay18$Instruction$Companion;\n 11: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day18.class", "javap": "Compiled from \"Day18.kt\"\npublic final class Day18 {\n public static final Day18 INSTANCE;\n\n private Day18();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_3\n 11: iconst_0\n 12: istore 4\n 14: aload_3\n 15: astore 5\n 17: new #26 // class java/util/ArrayList\n 20: dup\n 21: aload_3\n 22: bipush 10\n 24: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 27: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 30: checkcast #37 // class java/util/Collection\n 33: astore 6\n 35: iconst_0\n 36: istore 7\n 38: aload 5\n 40: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 8\n 47: aload 8\n 49: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 100\n 57: aload 8\n 59: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 9\n 66: aload 6\n 68: aload 9\n 70: checkcast #53 // class java/lang/String\n 73: astore 10\n 75: astore 12\n 77: iconst_0\n 78: istore 11\n 80: getstatic #59 // Field Day18$Instruction.Companion:LDay18$Instruction$Companion;\n 83: aload 10\n 85: invokevirtual #65 // Method Day18$Instruction$Companion.parse:(Ljava/lang/String;)LDay18$Instruction;\n 88: aload 12\n 90: swap\n 91: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 96: pop\n 97: goto 47\n 100: aload 6\n 102: checkcast #71 // class java/util/List\n 105: nop\n 106: astore_2\n 107: aload_0\n 108: aload_2\n 109: invokevirtual #75 // Method cubicMetersEnclosed:(Ljava/util/List;)J\n 112: invokestatic #79 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 115: areturn\n\n public final long cubicMetersEnclosed(java.util.List<Day18$Instruction>);\n Code:\n 0: aload_1\n 1: ldc #96 // String instructions\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokevirtual #100 // Method dig:(Ljava/util/List;)Ljava/util/List;\n 11: astore_2\n 12: aload_2\n 13: checkcast #24 // class java/lang/Iterable\n 16: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 21: astore 5\n 23: aload 5\n 25: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 30: ifne 41\n 33: new #102 // class java/util/NoSuchElementException\n 36: dup\n 37: invokespecial #103 // Method java/util/NoSuchElementException.\"<init>\":()V\n 40: athrow\n 41: aload 5\n 43: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 48: checkcast #105 // class Day18$Segment\n 51: astore 6\n 53: iconst_0\n 54: istore 7\n 56: aload 6\n 58: invokevirtual #109 // Method Day18$Segment.getMinY:()I\n 61: istore 6\n 63: aload 5\n 65: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 70: ifeq 109\n 73: aload 5\n 75: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 80: checkcast #105 // class Day18$Segment\n 83: astore 7\n 85: iconst_0\n 86: istore 8\n 88: aload 7\n 90: invokevirtual #109 // Method Day18$Segment.getMinY:()I\n 93: istore 7\n 95: iload 6\n 97: iload 7\n 99: if_icmple 63\n 102: iload 7\n 104: istore 6\n 106: goto 63\n 109: iload 6\n 111: istore_3\n 112: aload_2\n 113: checkcast #24 // class java/lang/Iterable\n 116: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 6\n 123: aload 6\n 125: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifne 141\n 133: new #102 // class java/util/NoSuchElementException\n 136: dup\n 137: invokespecial #103 // Method java/util/NoSuchElementException.\"<init>\":()V\n 140: athrow\n 141: aload 6\n 143: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 148: checkcast #105 // class Day18$Segment\n 151: astore 7\n 153: iconst_0\n 154: istore 8\n 156: aload 7\n 158: invokevirtual #112 // Method Day18$Segment.getMaxY:()I\n 161: istore 7\n 163: aload 6\n 165: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 170: ifeq 209\n 173: aload 6\n 175: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 180: checkcast #105 // class Day18$Segment\n 183: astore 8\n 185: iconst_0\n 186: istore 9\n 188: aload 8\n 190: invokevirtual #112 // Method Day18$Segment.getMaxY:()I\n 193: istore 8\n 195: iload 7\n 197: iload 8\n 199: if_icmpge 163\n 202: iload 8\n 204: istore 7\n 206: goto 163\n 209: iload 7\n 211: istore 4\n 213: aload_2\n 214: checkcast #24 // class java/lang/Iterable\n 217: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 222: astore 7\n 224: aload 7\n 226: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 231: ifne 242\n 234: new #102 // class java/util/NoSuchElementException\n 237: dup\n 238: invokespecial #103 // Method java/util/NoSuchElementException.\"<init>\":()V\n 241: athrow\n 242: aload 7\n 244: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 249: checkcast #105 // class Day18$Segment\n 252: astore 8\n 254: iconst_0\n 255: istore 9\n 257: aload 8\n 259: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 262: istore 8\n 264: aload 7\n 266: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 271: ifeq 310\n 274: aload 7\n 276: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 281: checkcast #105 // class Day18$Segment\n 284: astore 9\n 286: iconst_0\n 287: istore 10\n 289: aload 9\n 291: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 294: istore 9\n 296: iload 8\n 298: iload 9\n 300: if_icmple 264\n 303: iload 9\n 305: istore 8\n 307: goto 264\n 310: iload 8\n 312: istore 5\n 314: aload_2\n 315: checkcast #24 // class java/lang/Iterable\n 318: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 323: astore 8\n 325: aload 8\n 327: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 332: ifne 343\n 335: new #102 // class java/util/NoSuchElementException\n 338: dup\n 339: invokespecial #103 // Method java/util/NoSuchElementException.\"<init>\":()V\n 342: athrow\n 343: aload 8\n 345: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 350: checkcast #105 // class Day18$Segment\n 353: astore 9\n 355: iconst_0\n 356: istore 10\n 358: aload 9\n 360: invokevirtual #118 // Method Day18$Segment.getMaxX:()I\n 363: istore 9\n 365: aload 8\n 367: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 372: ifeq 411\n 375: aload 8\n 377: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 382: checkcast #105 // class Day18$Segment\n 385: astore 10\n 387: iconst_0\n 388: istore 11\n 390: aload 10\n 392: invokevirtual #118 // Method Day18$Segment.getMaxX:()I\n 395: istore 10\n 397: iload 9\n 399: iload 10\n 401: if_icmpge 365\n 404: iload 10\n 406: istore 9\n 408: goto 365\n 411: iload 9\n 413: istore 6\n 415: iload 4\n 417: iload_3\n 418: isub\n 419: istore 7\n 421: iconst_0\n 422: istore 8\n 424: new #120 // class kotlin/jvm/internal/Ref$ObjectRef\n 427: dup\n 428: invokespecial #121 // Method kotlin/jvm/internal/Ref$ObjectRef.\"<init>\":()V\n 431: astore 9\n 433: aload 9\n 435: aload_2\n 436: checkcast #24 // class java/lang/Iterable\n 439: iconst_2\n 440: anewarray #123 // class kotlin/jvm/functions/Function1\n 443: astore 10\n 445: aload 10\n 447: iconst_0\n 448: invokedynamic #142, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;\n 453: aastore\n 454: aload 10\n 456: iconst_1\n 457: invokedynamic #147, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;\n 462: aastore\n 463: aload 10\n 465: invokestatic #153 // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;\n 468: invokestatic #157 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 471: putfield #160 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 474: new #162 // class kotlin/ranges/IntRange\n 477: dup\n 478: iload_3\n 479: iload 4\n 481: invokespecial #165 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 484: checkcast #24 // class java/lang/Iterable\n 487: astore 12\n 489: lconst_0\n 490: lstore 13\n 492: aload 12\n 494: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 499: astore 15\n 501: aload 15\n 503: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 508: ifeq 808\n 511: aload 15\n 513: checkcast #167 // class kotlin/collections/IntIterator\n 516: invokevirtual #170 // Method kotlin/collections/IntIterator.nextInt:()I\n 519: istore 16\n 521: lload 13\n 523: iload 16\n 525: istore 17\n 527: lstore 33\n 529: iconst_0\n 530: istore 18\n 532: new #172 // class Day17$Coordinate\n 535: dup\n 536: iload 5\n 538: iload 17\n 540: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 543: astore 19\n 545: new #172 // class Day17$Coordinate\n 548: dup\n 549: iload 6\n 551: iload 17\n 553: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 556: astore 20\n 558: getstatic #176 // Field INSTANCE:LDay18;\n 561: aload 19\n 563: aload 20\n 565: aload 9\n 567: getfield #160 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 570: checkcast #71 // class java/util/List\n 573: invokespecial #180 // Method rayCast:(LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;)J\n 576: lstore 21\n 578: iload 8\n 580: iconst_1\n 581: iadd\n 582: istore 8\n 584: iload 8\n 586: ldc #181 // int 1000000\n 588: irem\n 589: ifne 794\n 592: aload 9\n 594: aload 9\n 596: getfield #160 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 599: checkcast #24 // class java/lang/Iterable\n 602: astore 23\n 604: astore 24\n 606: iconst_0\n 607: istore 25\n 609: aload 23\n 611: astore 26\n 613: new #26 // class java/util/ArrayList\n 616: dup\n 617: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 620: checkcast #37 // class java/util/Collection\n 623: astore 27\n 625: iconst_0\n 626: istore 28\n 628: aload 26\n 630: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 635: astore 29\n 637: aload 29\n 639: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 644: ifeq 697\n 647: aload 29\n 649: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 654: astore 30\n 656: aload 30\n 658: checkcast #105 // class Day18$Segment\n 661: astore 31\n 663: iconst_0\n 664: istore 32\n 666: aload 31\n 668: invokevirtual #112 // Method Day18$Segment.getMaxY:()I\n 671: iload 17\n 673: if_icmplt 680\n 676: iconst_1\n 677: goto 681\n 680: iconst_0\n 681: ifeq 637\n 684: aload 27\n 686: aload 30\n 688: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 693: pop\n 694: goto 637\n 697: aload 27\n 699: checkcast #71 // class java/util/List\n 702: nop\n 703: aload 24\n 705: swap\n 706: putfield #160 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;\n 709: new #184 // class java/lang/StringBuilder\n 712: dup\n 713: invokespecial #185 // Method java/lang/StringBuilder.\"<init>\":()V\n 716: ldc #187 // String Progress:\n 718: invokevirtual #191 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 721: getstatic #196 // Field kotlin/jvm/internal/StringCompanionObject.INSTANCE:Lkotlin/jvm/internal/StringCompanionObject;\n 724: pop\n 725: ldc #198 // String %.2f\n 727: astore 25\n 729: iconst_1\n 730: anewarray #4 // class java/lang/Object\n 733: astore 26\n 735: aload 26\n 737: iconst_0\n 738: iload 8\n 740: i2d\n 741: iload 7\n 743: i2d\n 744: ddiv\n 745: bipush 100\n 747: i2d\n 748: dmul\n 749: invokestatic #203 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;\n 752: aastore\n 753: aload 26\n 755: astore 26\n 757: aload 25\n 759: aload 26\n 761: aload 26\n 763: arraylength\n 764: invokestatic #209 // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;\n 767: invokestatic #213 // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;\n 770: dup\n 771: ldc #215 // String format(...)\n 773: invokestatic #218 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 776: invokevirtual #191 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 779: bipush 37\n 781: invokevirtual #221 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 784: invokevirtual #225 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 787: getstatic #231 // Field java/lang/System.out:Ljava/io/PrintStream;\n 790: swap\n 791: invokevirtual #237 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 794: lload 21\n 796: lstore 35\n 798: lload 33\n 800: lload 35\n 802: ladd\n 803: lstore 13\n 805: goto 501\n 808: lload 13\n 810: lstore 10\n 812: aload_2\n 813: checkcast #24 // class java/lang/Iterable\n 816: astore 13\n 818: iconst_0\n 819: istore 14\n 821: aload 13\n 823: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 828: astore 15\n 830: aload 15\n 832: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 837: ifeq 880\n 840: aload 15\n 842: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 847: astore 16\n 849: iload 14\n 851: aload 16\n 853: checkcast #105 // class Day18$Segment\n 856: astore 17\n 858: istore 33\n 860: iconst_0\n 861: istore 18\n 863: aload 17\n 865: invokevirtual #240 // Method Day18$Segment.length:()I\n 868: istore 34\n 870: iload 33\n 872: iload 34\n 874: iadd\n 875: istore 14\n 877: goto 830\n 880: iload 14\n 882: istore 12\n 884: aload_2\n 885: checkcast #24 // class java/lang/Iterable\n 888: astore 14\n 890: iconst_0\n 891: istore 15\n 893: aload 14\n 895: astore 16\n 897: new #26 // class java/util/ArrayList\n 900: dup\n 901: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 904: checkcast #37 // class java/util/Collection\n 907: astore 17\n 909: iconst_0\n 910: istore 18\n 912: aload 16\n 914: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 919: astore 19\n 921: aload 19\n 923: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 928: ifeq 977\n 931: aload 19\n 933: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 938: astore 20\n 940: aload 20\n 942: checkcast #105 // class Day18$Segment\n 945: astore 21\n 947: iconst_0\n 948: istore 22\n 950: aload 21\n 952: invokevirtual #244 // Method Day18$Segment.getCoordinates:()Ljava/util/Set;\n 955: checkcast #24 // class java/lang/Iterable\n 958: invokestatic #248 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 961: checkcast #24 // class java/lang/Iterable\n 964: astore 21\n 966: aload 17\n 968: aload 21\n 970: invokestatic #252 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 973: pop\n 974: goto 921\n 977: aload 17\n 979: checkcast #71 // class java/util/List\n 982: nop\n 983: checkcast #24 // class java/lang/Iterable\n 986: astore 14\n 988: nop\n 989: iconst_0\n 990: istore 15\n 992: aload 14\n 994: astore 16\n 996: new #254 // class java/util/LinkedHashMap\n 999: dup\n 1000: invokespecial #255 // Method java/util/LinkedHashMap.\"<init>\":()V\n 1003: checkcast #257 // class java/util/Map\n 1006: astore 17\n 1008: iconst_0\n 1009: istore 18\n 1011: aload 16\n 1013: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1018: astore 19\n 1020: aload 19\n 1022: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1027: ifeq 1129\n 1030: aload 19\n 1032: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1037: astore 20\n 1039: aload 20\n 1041: checkcast #172 // class Day17$Coordinate\n 1044: astore 21\n 1046: iconst_0\n 1047: istore 22\n 1049: aload 21\n 1051: astore 23\n 1053: aload 17\n 1055: astore 24\n 1057: iconst_0\n 1058: istore 25\n 1060: aload 24\n 1062: aload 23\n 1064: invokeinterface #260, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 1069: astore 26\n 1071: aload 26\n 1073: ifnonnull 1108\n 1076: iconst_0\n 1077: istore 27\n 1079: new #26 // class java/util/ArrayList\n 1082: dup\n 1083: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 1086: checkcast #71 // class java/util/List\n 1089: astore 27\n 1091: aload 24\n 1093: aload 23\n 1095: aload 27\n 1097: invokeinterface #264, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1102: pop\n 1103: aload 27\n 1105: goto 1110\n 1108: aload 26\n 1110: nop\n 1111: checkcast #71 // class java/util/List\n 1114: astore 21\n 1116: aload 21\n 1118: aload 20\n 1120: invokeinterface #265, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 1125: pop\n 1126: goto 1020\n 1129: aload 17\n 1131: nop\n 1132: astore 14\n 1134: nop\n 1135: iconst_0\n 1136: istore 15\n 1138: aload 14\n 1140: astore 16\n 1142: new #254 // class java/util/LinkedHashMap\n 1145: dup\n 1146: invokespecial #255 // Method java/util/LinkedHashMap.\"<init>\":()V\n 1149: checkcast #257 // class java/util/Map\n 1152: astore 17\n 1154: iconst_0\n 1155: istore 18\n 1157: aload 16\n 1159: invokeinterface #268, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 1164: invokeinterface #271, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 1169: astore 19\n 1171: aload 19\n 1173: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1178: ifeq 1252\n 1181: aload 19\n 1183: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1188: checkcast #273 // class java/util/Map$Entry\n 1191: astore 20\n 1193: aload 20\n 1195: astore 21\n 1197: iconst_0\n 1198: istore 22\n 1200: aload 21\n 1202: invokeinterface #276, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 1207: checkcast #71 // class java/util/List\n 1210: invokeinterface #279, 1 // InterfaceMethod java/util/List.size:()I\n 1215: iconst_1\n 1216: if_icmple 1223\n 1219: iconst_1\n 1220: goto 1224\n 1223: iconst_0\n 1224: ifeq 1171\n 1227: aload 17\n 1229: aload 20\n 1231: invokeinterface #282, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 1236: aload 20\n 1238: invokeinterface #276, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 1243: invokeinterface #264, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1248: pop\n 1249: goto 1171\n 1252: aload 17\n 1254: nop\n 1255: invokeinterface #285, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 1260: invokeinterface #286, 1 // InterfaceMethod java/util/Set.size:()I\n 1265: istore 13\n 1267: lload 10\n 1269: iload 12\n 1271: i2l\n 1272: ladd\n 1273: iload 13\n 1275: i2l\n 1276: lsub\n 1277: lreturn\n\n private final long rayCast(Day17$Coordinate, Day17$Coordinate, java.util.List<Day18$Segment>);\n Code:\n 0: iconst_0\n 1: istore 4\n 3: lconst_0\n 4: lstore 5\n 6: new #342 // class java/util/LinkedHashSet\n 9: dup\n 10: invokespecial #343 // Method java/util/LinkedHashSet.\"<init>\":()V\n 13: checkcast #270 // class java/util/Set\n 16: astore 7\n 18: iconst_0\n 19: istore 8\n 21: aload_1\n 22: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 25: istore 8\n 27: aload_3\n 28: checkcast #24 // class java/lang/Iterable\n 31: astore 10\n 33: nop\n 34: iconst_0\n 35: istore 11\n 37: new #26 // class java/util/ArrayList\n 40: dup\n 41: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 44: astore 12\n 46: aload 10\n 48: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 53: astore 13\n 55: aload 13\n 57: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 62: ifeq 118\n 65: aload 13\n 67: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 72: astore 14\n 74: aload 14\n 76: checkcast #105 // class Day18$Segment\n 79: astore 15\n 81: iconst_0\n 82: istore 16\n 84: aload 15\n 86: invokevirtual #109 // Method Day18$Segment.getMinY:()I\n 89: aload_2\n 90: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 93: if_icmpgt 100\n 96: iconst_1\n 97: goto 101\n 100: iconst_0\n 101: ifne 107\n 104: goto 118\n 107: aload 12\n 109: aload 14\n 111: invokevirtual #350 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 114: pop\n 115: goto 55\n 118: aload 12\n 120: checkcast #71 // class java/util/List\n 123: checkcast #24 // class java/lang/Iterable\n 126: astore 10\n 128: nop\n 129: iconst_0\n 130: istore 11\n 132: aload 10\n 134: astore 12\n 136: new #26 // class java/util/ArrayList\n 139: dup\n 140: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 143: checkcast #37 // class java/util/Collection\n 146: astore 13\n 148: iconst_0\n 149: istore 14\n 151: aload 12\n 153: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 158: astore 15\n 160: aload 15\n 162: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 167: ifeq 214\n 170: aload 15\n 172: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 177: astore 16\n 179: aload 16\n 181: checkcast #105 // class Day18$Segment\n 184: astore 17\n 186: iconst_0\n 187: istore 18\n 189: aload 17\n 191: aload_1\n 192: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 195: invokevirtual #354 // Method Day18$Segment.crosses:(I)Z\n 198: ifeq 160\n 201: aload 13\n 203: aload 16\n 205: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 210: pop\n 211: goto 160\n 214: aload 13\n 216: checkcast #71 // class java/util/List\n 219: nop\n 220: astore 9\n 222: iload 8\n 224: aload_2\n 225: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 228: if_icmpgt 758\n 231: new #172 // class Day17$Coordinate\n 234: dup\n 235: iload 8\n 237: aload_1\n 238: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 241: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 244: astore 10\n 246: aload 9\n 248: checkcast #24 // class java/lang/Iterable\n 251: astore 12\n 253: iconst_0\n 254: istore 13\n 256: aload 12\n 258: astore 14\n 260: new #26 // class java/util/ArrayList\n 263: dup\n 264: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 267: checkcast #37 // class java/util/Collection\n 270: astore 15\n 272: iconst_0\n 273: istore 16\n 275: aload 14\n 277: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 282: astore 17\n 284: aload 17\n 286: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 291: ifeq 336\n 294: aload 17\n 296: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 301: astore 18\n 303: aload 18\n 305: checkcast #105 // class Day18$Segment\n 308: astore 19\n 310: iconst_0\n 311: istore 20\n 313: aload 19\n 315: aload 10\n 317: invokevirtual #357 // Method Day18$Segment.crosses:(LDay17$Coordinate;)Z\n 320: ifeq 284\n 323: aload 15\n 325: aload 18\n 327: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 332: pop\n 333: goto 284\n 336: aload 15\n 338: checkcast #71 // class java/util/List\n 341: nop\n 342: astore 11\n 344: aload 7\n 346: invokeinterface #286, 1 // InterfaceMethod java/util/Set.size:()I\n 351: istore 12\n 353: aload 7\n 355: aload 11\n 357: checkcast #37 // class java/util/Collection\n 360: invokeinterface #360, 2 // InterfaceMethod java/util/Set.addAll:(Ljava/util/Collection;)Z\n 365: pop\n 366: aload 7\n 368: invokeinterface #286, 1 // InterfaceMethod java/util/Set.size:()I\n 373: istore 13\n 375: iload 13\n 377: iload 12\n 379: if_icmple 386\n 382: iconst_1\n 383: goto 387\n 386: iconst_0\n 387: istore 14\n 389: aload 11\n 391: checkcast #37 // class java/util/Collection\n 394: invokeinterface #363, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 399: ifne 406\n 402: iconst_1\n 403: goto 407\n 406: iconst_0\n 407: ifeq 526\n 410: aload 11\n 412: checkcast #24 // class java/lang/Iterable\n 415: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 420: astore 16\n 422: aload 16\n 424: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 429: ifne 440\n 432: new #102 // class java/util/NoSuchElementException\n 435: dup\n 436: invokespecial #103 // Method java/util/NoSuchElementException.\"<init>\":()V\n 439: athrow\n 440: aload 16\n 442: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 447: checkcast #105 // class Day18$Segment\n 450: astore 17\n 452: iconst_0\n 453: istore 18\n 455: aload 17\n 457: invokevirtual #118 // Method Day18$Segment.getMaxX:()I\n 460: istore 17\n 462: aload 16\n 464: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 469: ifeq 508\n 472: aload 16\n 474: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 479: checkcast #105 // class Day18$Segment\n 482: astore 18\n 484: iconst_0\n 485: istore 19\n 487: aload 18\n 489: invokevirtual #118 // Method Day18$Segment.getMaxX:()I\n 492: istore 18\n 494: iload 17\n 496: iload 18\n 498: if_icmpge 462\n 501: iload 18\n 503: istore 17\n 505: goto 462\n 508: iload 17\n 510: istore 8\n 512: iload 14\n 514: ifne 222\n 517: iload 8\n 519: iconst_1\n 520: iadd\n 521: istore 8\n 523: goto 222\n 526: aload_0\n 527: aload 7\n 529: invokespecial #367 // Method isSingleOrSnakeShaped:(Ljava/util/Set;)Z\n 532: ifeq 538\n 535: iinc 4, 1\n 538: aload 7\n 540: invokeinterface #370, 1 // InterfaceMethod java/util/Set.clear:()V\n 545: aload 9\n 547: checkcast #24 // class java/lang/Iterable\n 550: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 555: astore 17\n 557: aload 17\n 559: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 564: ifne 571\n 567: aconst_null\n 568: goto 690\n 571: aload 17\n 573: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 578: checkcast #105 // class Day18$Segment\n 581: astore 18\n 583: iconst_0\n 584: istore 19\n 586: aload 18\n 588: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 591: iload 8\n 593: if_icmple 604\n 596: aload 18\n 598: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 601: goto 607\n 604: ldc_w #371 // int 2147483647\n 607: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 610: checkcast #378 // class java/lang/Comparable\n 613: astore 18\n 615: aload 17\n 617: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 622: ifeq 688\n 625: aload 17\n 627: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 632: checkcast #105 // class Day18$Segment\n 635: astore 19\n 637: iconst_0\n 638: istore 20\n 640: aload 19\n 642: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 645: iload 8\n 647: if_icmple 658\n 650: aload 19\n 652: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 655: goto 661\n 658: ldc_w #371 // int 2147483647\n 661: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 664: checkcast #378 // class java/lang/Comparable\n 667: astore 19\n 669: aload 18\n 671: aload 19\n 673: invokeinterface #382, 2 // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I\n 678: ifle 615\n 681: aload 19\n 683: astore 18\n 685: goto 615\n 688: aload 18\n 690: checkcast #373 // class java/lang/Integer\n 693: astore 15\n 695: aload 15\n 697: dup\n 698: ifnull 707\n 701: invokevirtual #385 // Method java/lang/Integer.intValue:()I\n 704: goto 714\n 707: pop\n 708: aload_2\n 709: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 712: iconst_1\n 713: iadd\n 714: istore 16\n 716: iload 4\n 718: iconst_2\n 719: irem\n 720: iconst_1\n 721: if_icmpne 728\n 724: iconst_1\n 725: goto 729\n 728: iconst_0\n 729: istore 17\n 731: iload 17\n 733: ifeq 751\n 736: iload 16\n 738: iload 8\n 740: isub\n 741: istore 18\n 743: lload 5\n 745: iload 18\n 747: i2l\n 748: ladd\n 749: lstore 5\n 751: iload 16\n 753: istore 8\n 755: goto 222\n 758: lload 5\n 760: lreturn\n\n private final boolean isSingleOrSnakeShaped(java.util.Set<Day18$Segment>);\n Code:\n 0: aload_1\n 1: invokeinterface #414, 1 // InterfaceMethod java/util/Set.isEmpty:()Z\n 6: ifeq 11\n 9: iconst_0\n 10: ireturn\n 11: aload_1\n 12: invokeinterface #286, 1 // InterfaceMethod java/util/Set.size:()I\n 17: iconst_1\n 18: if_icmpne 23\n 21: iconst_1\n 22: ireturn\n 23: aload_1\n 24: invokeinterface #286, 1 // InterfaceMethod java/util/Set.size:()I\n 29: iconst_2\n 30: if_icmpne 35\n 33: iconst_0\n 34: ireturn\n 35: aload_1\n 36: checkcast #24 // class java/lang/Iterable\n 39: astore_3\n 40: iconst_0\n 41: istore 4\n 43: aload_3\n 44: instanceof #37 // class java/util/Collection\n 47: ifeq 66\n 50: aload_3\n 51: checkcast #37 // class java/util/Collection\n 54: invokeinterface #363, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 59: ifeq 66\n 62: iconst_0\n 63: goto 130\n 66: iconst_0\n 67: istore 5\n 69: aload_3\n 70: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 75: astore 6\n 77: aload 6\n 79: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 84: ifeq 128\n 87: aload 6\n 89: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 94: astore 7\n 96: aload 7\n 98: checkcast #105 // class Day18$Segment\n 101: astore 8\n 103: iconst_0\n 104: istore 9\n 106: aload 8\n 108: invokevirtual #417 // Method Day18$Segment.isVertical:()Z\n 111: ifeq 77\n 114: iinc 5, 1\n 117: iload 5\n 119: ifge 77\n 122: invokestatic #420 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 125: goto 77\n 128: iload 5\n 130: istore_2\n 131: aload_1\n 132: checkcast #24 // class java/lang/Iterable\n 135: astore 4\n 137: iconst_0\n 138: istore 5\n 140: aload 4\n 142: instanceof #37 // class java/util/Collection\n 145: ifeq 165\n 148: aload 4\n 150: checkcast #37 // class java/util/Collection\n 153: invokeinterface #363, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 158: ifeq 165\n 161: iconst_0\n 162: goto 230\n 165: iconst_0\n 166: istore 6\n 168: aload 4\n 170: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 175: astore 7\n 177: aload 7\n 179: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 184: ifeq 228\n 187: aload 7\n 189: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 194: astore 8\n 196: aload 8\n 198: checkcast #105 // class Day18$Segment\n 201: astore 9\n 203: iconst_0\n 204: istore 10\n 206: aload 9\n 208: invokevirtual #423 // Method Day18$Segment.isHorizontal:()Z\n 211: ifeq 177\n 214: iinc 6, 1\n 217: iload 6\n 219: ifge 177\n 222: invokestatic #420 // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V\n 225: goto 177\n 228: iload 6\n 230: istore_3\n 231: iload_2\n 232: iload_3\n 233: if_icmple 883\n 236: aload_1\n 237: checkcast #24 // class java/lang/Iterable\n 240: iconst_2\n 241: anewarray #123 // class kotlin/jvm/functions/Function1\n 244: astore 5\n 246: aload 5\n 248: iconst_0\n 249: invokedynamic #428, 0 // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;\n 254: aastore\n 255: aload 5\n 257: iconst_1\n 258: invokedynamic #433, 0 // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function1;\n 263: aastore\n 264: aload 5\n 266: invokestatic #153 // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;\n 269: invokestatic #157 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 272: astore 4\n 274: aload 4\n 276: invokestatic #437 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 279: checkcast #105 // class Day18$Segment\n 282: astore 5\n 284: aload 4\n 286: invokestatic #440 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 289: checkcast #105 // class Day18$Segment\n 292: astore 6\n 294: aload 5\n 296: invokevirtual #244 // Method Day18$Segment.getCoordinates:()Ljava/util/Set;\n 299: checkcast #24 // class java/lang/Iterable\n 302: astore 8\n 304: iconst_0\n 305: istore 9\n 307: aload 8\n 309: astore 10\n 311: new #26 // class java/util/ArrayList\n 314: dup\n 315: aload 8\n 317: bipush 10\n 319: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 322: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 325: checkcast #37 // class java/util/Collection\n 328: astore 11\n 330: iconst_0\n 331: istore 12\n 333: aload 10\n 335: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 340: astore 13\n 342: aload 13\n 344: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 349: ifeq 395\n 352: aload 13\n 354: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 359: astore 14\n 361: aload 11\n 363: aload 14\n 365: checkcast #172 // class Day17$Coordinate\n 368: astore 15\n 370: astore 23\n 372: iconst_0\n 373: istore 16\n 375: aload 15\n 377: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 380: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 383: aload 23\n 385: swap\n 386: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 391: pop\n 392: goto 342\n 395: aload 11\n 397: checkcast #71 // class java/util/List\n 400: nop\n 401: checkcast #24 // class java/lang/Iterable\n 404: invokestatic #248 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 407: checkcast #37 // class java/util/Collection\n 410: aload 6\n 412: invokevirtual #244 // Method Day18$Segment.getCoordinates:()Ljava/util/Set;\n 415: checkcast #24 // class java/lang/Iterable\n 418: astore 8\n 420: astore 23\n 422: iconst_0\n 423: istore 9\n 425: aload 8\n 427: astore 10\n 429: new #26 // class java/util/ArrayList\n 432: dup\n 433: aload 8\n 435: bipush 10\n 437: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 440: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 443: checkcast #37 // class java/util/Collection\n 446: astore 11\n 448: iconst_0\n 449: istore 12\n 451: aload 10\n 453: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 458: astore 13\n 460: aload 13\n 462: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 467: ifeq 513\n 470: aload 13\n 472: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 477: astore 14\n 479: aload 11\n 481: aload 14\n 483: checkcast #172 // class Day17$Coordinate\n 486: astore 15\n 488: astore 24\n 490: iconst_0\n 491: istore 16\n 493: aload 15\n 495: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 498: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 501: aload 24\n 503: swap\n 504: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 509: pop\n 510: goto 460\n 513: aload 11\n 515: checkcast #71 // class java/util/List\n 518: nop\n 519: aload 23\n 521: swap\n 522: checkcast #24 // class java/lang/Iterable\n 525: invokestatic #248 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 528: checkcast #24 // class java/lang/Iterable\n 531: invokestatic #444 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 534: astore 7\n 536: aload 7\n 538: checkcast #24 // class java/lang/Iterable\n 541: astore 9\n 543: iconst_0\n 544: istore 10\n 546: aload 9\n 548: astore 11\n 550: new #254 // class java/util/LinkedHashMap\n 553: dup\n 554: invokespecial #255 // Method java/util/LinkedHashMap.\"<init>\":()V\n 557: checkcast #257 // class java/util/Map\n 560: astore 12\n 562: iconst_0\n 563: istore 13\n 565: aload 11\n 567: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 572: astore 14\n 574: aload 14\n 576: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 581: ifeq 689\n 584: aload 14\n 586: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 591: astore 15\n 593: aload 15\n 595: checkcast #446 // class java/lang/Number\n 598: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 601: istore 16\n 603: iconst_0\n 604: istore 17\n 606: iload 16\n 608: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 611: astore 18\n 613: aload 12\n 615: astore 19\n 617: iconst_0\n 618: istore 20\n 620: aload 19\n 622: aload 18\n 624: invokeinterface #260, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 629: astore 21\n 631: aload 21\n 633: ifnonnull 668\n 636: iconst_0\n 637: istore 22\n 639: new #26 // class java/util/ArrayList\n 642: dup\n 643: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 646: checkcast #71 // class java/util/List\n 649: astore 22\n 651: aload 19\n 653: aload 18\n 655: aload 22\n 657: invokeinterface #264, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 662: pop\n 663: aload 22\n 665: goto 670\n 668: aload 21\n 670: nop\n 671: checkcast #71 // class java/util/List\n 674: astore 16\n 676: aload 16\n 678: aload 15\n 680: invokeinterface #265, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 685: pop\n 686: goto 574\n 689: aload 12\n 691: nop\n 692: astore 8\n 694: aload 8\n 696: astore 10\n 698: iconst_0\n 699: istore 11\n 701: aload 10\n 703: astore 12\n 705: new #254 // class java/util/LinkedHashMap\n 708: dup\n 709: invokespecial #255 // Method java/util/LinkedHashMap.\"<init>\":()V\n 712: checkcast #257 // class java/util/Map\n 715: astore 13\n 717: iconst_0\n 718: istore 14\n 720: aload 12\n 722: invokeinterface #268, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 727: invokeinterface #271, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 732: astore 15\n 734: aload 15\n 736: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 741: ifeq 815\n 744: aload 15\n 746: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 751: checkcast #273 // class java/util/Map$Entry\n 754: astore 16\n 756: aload 16\n 758: astore 17\n 760: iconst_0\n 761: istore 18\n 763: aload 17\n 765: invokeinterface #276, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 770: checkcast #71 // class java/util/List\n 773: invokeinterface #279, 1 // InterfaceMethod java/util/List.size:()I\n 778: iconst_2\n 779: if_icmpne 786\n 782: iconst_1\n 783: goto 787\n 786: iconst_0\n 787: ifeq 734\n 790: aload 13\n 792: aload 16\n 794: invokeinterface #282, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 799: aload 16\n 801: invokeinterface #276, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 806: invokeinterface #264, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 811: pop\n 812: goto 734\n 815: aload 13\n 817: nop\n 818: invokeinterface #285, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 823: checkcast #24 // class java/lang/Iterable\n 826: invokestatic #450 // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;\n 829: checkcast #446 // class java/lang/Number\n 832: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 835: istore 9\n 837: iload 9\n 839: aload 7\n 841: checkcast #24 // class java/lang/Iterable\n 844: invokestatic #454 // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 847: checkcast #446 // class java/lang/Number\n 850: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 853: if_icmple 879\n 856: iload 9\n 858: aload 7\n 860: checkcast #24 // class java/lang/Iterable\n 863: invokestatic #457 // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 866: checkcast #446 // class java/lang/Number\n 869: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 872: if_icmpge 879\n 875: iconst_1\n 876: goto 1527\n 879: iconst_0\n 880: goto 1527\n 883: aload_1\n 884: checkcast #24 // class java/lang/Iterable\n 887: iconst_2\n 888: anewarray #123 // class kotlin/jvm/functions/Function1\n 891: astore 5\n 893: aload 5\n 895: iconst_0\n 896: invokedynamic #462, 0 // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;\n 901: aastore\n 902: aload 5\n 904: iconst_1\n 905: invokedynamic #467, 0 // InvokeDynamic #5:invoke:()Lkotlin/jvm/functions/Function1;\n 910: aastore\n 911: aload 5\n 913: invokestatic #153 // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;\n 916: invokestatic #157 // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;\n 919: astore 4\n 921: aload 4\n 923: invokestatic #437 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 926: checkcast #105 // class Day18$Segment\n 929: astore 5\n 931: aload 4\n 933: invokestatic #440 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 936: checkcast #105 // class Day18$Segment\n 939: astore 6\n 941: aload 5\n 943: invokevirtual #244 // Method Day18$Segment.getCoordinates:()Ljava/util/Set;\n 946: checkcast #24 // class java/lang/Iterable\n 949: astore 8\n 951: iconst_0\n 952: istore 9\n 954: aload 8\n 956: astore 10\n 958: new #26 // class java/util/ArrayList\n 961: dup\n 962: aload 8\n 964: bipush 10\n 966: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 969: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 972: checkcast #37 // class java/util/Collection\n 975: astore 11\n 977: iconst_0\n 978: istore 12\n 980: aload 10\n 982: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 987: astore 13\n 989: aload 13\n 991: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 996: ifeq 1042\n 999: aload 13\n 1001: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1006: astore 14\n 1008: aload 11\n 1010: aload 14\n 1012: checkcast #172 // class Day17$Coordinate\n 1015: astore 15\n 1017: astore 23\n 1019: iconst_0\n 1020: istore 16\n 1022: aload 15\n 1024: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 1027: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1030: aload 23\n 1032: swap\n 1033: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1038: pop\n 1039: goto 989\n 1042: aload 11\n 1044: checkcast #71 // class java/util/List\n 1047: nop\n 1048: checkcast #24 // class java/lang/Iterable\n 1051: invokestatic #248 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 1054: checkcast #37 // class java/util/Collection\n 1057: aload 6\n 1059: invokevirtual #244 // Method Day18$Segment.getCoordinates:()Ljava/util/Set;\n 1062: checkcast #24 // class java/lang/Iterable\n 1065: astore 8\n 1067: astore 23\n 1069: iconst_0\n 1070: istore 9\n 1072: aload 8\n 1074: astore 10\n 1076: new #26 // class java/util/ArrayList\n 1079: dup\n 1080: aload 8\n 1082: bipush 10\n 1084: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 1087: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 1090: checkcast #37 // class java/util/Collection\n 1093: astore 11\n 1095: iconst_0\n 1096: istore 12\n 1098: aload 10\n 1100: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1105: astore 13\n 1107: aload 13\n 1109: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1114: ifeq 1160\n 1117: aload 13\n 1119: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1124: astore 14\n 1126: aload 11\n 1128: aload 14\n 1130: checkcast #172 // class Day17$Coordinate\n 1133: astore 15\n 1135: astore 24\n 1137: iconst_0\n 1138: istore 16\n 1140: aload 15\n 1142: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 1145: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1148: aload 24\n 1150: swap\n 1151: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 1156: pop\n 1157: goto 1107\n 1160: aload 11\n 1162: checkcast #71 // class java/util/List\n 1165: nop\n 1166: aload 23\n 1168: swap\n 1169: checkcast #24 // class java/lang/Iterable\n 1172: invokestatic #248 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;\n 1175: checkcast #24 // class java/lang/Iterable\n 1178: invokestatic #444 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 1181: astore 7\n 1183: aload 7\n 1185: checkcast #24 // class java/lang/Iterable\n 1188: astore 9\n 1190: iconst_0\n 1191: istore 10\n 1193: aload 9\n 1195: astore 11\n 1197: new #254 // class java/util/LinkedHashMap\n 1200: dup\n 1201: invokespecial #255 // Method java/util/LinkedHashMap.\"<init>\":()V\n 1204: checkcast #257 // class java/util/Map\n 1207: astore 12\n 1209: iconst_0\n 1210: istore 13\n 1212: aload 11\n 1214: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 1219: astore 14\n 1221: aload 14\n 1223: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1228: ifeq 1336\n 1231: aload 14\n 1233: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1238: astore 15\n 1240: aload 15\n 1242: checkcast #446 // class java/lang/Number\n 1245: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 1248: istore 16\n 1250: iconst_0\n 1251: istore 17\n 1253: iload 16\n 1255: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 1258: astore 18\n 1260: aload 12\n 1262: astore 19\n 1264: iconst_0\n 1265: istore 20\n 1267: aload 19\n 1269: aload 18\n 1271: invokeinterface #260, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 1276: astore 21\n 1278: aload 21\n 1280: ifnonnull 1315\n 1283: iconst_0\n 1284: istore 22\n 1286: new #26 // class java/util/ArrayList\n 1289: dup\n 1290: invokespecial #182 // Method java/util/ArrayList.\"<init>\":()V\n 1293: checkcast #71 // class java/util/List\n 1296: astore 22\n 1298: aload 19\n 1300: aload 18\n 1302: aload 22\n 1304: invokeinterface #264, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1309: pop\n 1310: aload 22\n 1312: goto 1317\n 1315: aload 21\n 1317: nop\n 1318: checkcast #71 // class java/util/List\n 1321: astore 16\n 1323: aload 16\n 1325: aload 15\n 1327: invokeinterface #265, 2 // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z\n 1332: pop\n 1333: goto 1221\n 1336: aload 12\n 1338: nop\n 1339: astore 8\n 1341: aload 8\n 1343: astore 10\n 1345: iconst_0\n 1346: istore 11\n 1348: aload 10\n 1350: astore 12\n 1352: new #254 // class java/util/LinkedHashMap\n 1355: dup\n 1356: invokespecial #255 // Method java/util/LinkedHashMap.\"<init>\":()V\n 1359: checkcast #257 // class java/util/Map\n 1362: astore 13\n 1364: iconst_0\n 1365: istore 14\n 1367: aload 12\n 1369: invokeinterface #268, 1 // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;\n 1374: invokeinterface #271, 1 // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;\n 1379: astore 15\n 1381: aload 15\n 1383: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 1388: ifeq 1462\n 1391: aload 15\n 1393: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 1398: checkcast #273 // class java/util/Map$Entry\n 1401: astore 16\n 1403: aload 16\n 1405: astore 17\n 1407: iconst_0\n 1408: istore 18\n 1410: aload 17\n 1412: invokeinterface #276, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 1417: checkcast #71 // class java/util/List\n 1420: invokeinterface #279, 1 // InterfaceMethod java/util/List.size:()I\n 1425: iconst_2\n 1426: if_icmpne 1433\n 1429: iconst_1\n 1430: goto 1434\n 1433: iconst_0\n 1434: ifeq 1381\n 1437: aload 13\n 1439: aload 16\n 1441: invokeinterface #282, 1 // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;\n 1446: aload 16\n 1448: invokeinterface #276, 1 // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;\n 1453: invokeinterface #264, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 1458: pop\n 1459: goto 1381\n 1462: aload 13\n 1464: nop\n 1465: invokeinterface #285, 1 // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;\n 1470: checkcast #24 // class java/lang/Iterable\n 1473: invokestatic #450 // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;\n 1476: checkcast #446 // class java/lang/Number\n 1479: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 1482: istore 9\n 1484: iload 9\n 1486: aload 7\n 1488: checkcast #24 // class java/lang/Iterable\n 1491: invokestatic #454 // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 1494: checkcast #446 // class java/lang/Number\n 1497: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 1500: if_icmple 1526\n 1503: iload 9\n 1505: aload 7\n 1507: checkcast #24 // class java/lang/Iterable\n 1510: invokestatic #457 // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;\n 1513: checkcast #446 // class java/lang/Number\n 1516: invokevirtual #447 // Method java/lang/Number.intValue:()I\n 1519: if_icmpge 1526\n 1522: iconst_1\n 1523: goto 1527\n 1526: iconst_0\n 1527: ireturn\n\n public final java.util.List<Day18$Segment> dig(java.util.List<Day18$Instruction>);\n Code:\n 0: aload_1\n 1: ldc #96 // String instructions\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #172 // class Day17$Coordinate\n 9: dup\n 10: iconst_0\n 11: iconst_0\n 12: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 15: astore_2\n 16: aload_1\n 17: checkcast #24 // class java/lang/Iterable\n 20: astore_3\n 21: aload_2\n 22: invokestatic #497 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;\n 25: invokestatic #503 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 28: astore 4\n 30: iconst_0\n 31: istore 5\n 33: aload 4\n 35: astore 6\n 37: aload_3\n 38: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 7\n 45: aload 7\n 47: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 312\n 55: aload 7\n 57: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 8\n 64: aload 6\n 66: aload 8\n 68: checkcast #55 // class Day18$Instruction\n 71: astore 9\n 73: astore 10\n 75: iconst_0\n 76: istore 11\n 78: aload 10\n 80: invokevirtual #508 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 83: checkcast #172 // class Day17$Coordinate\n 86: astore 12\n 88: aload 10\n 90: invokevirtual #511 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 93: checkcast #71 // class java/util/List\n 96: astore 13\n 98: aload 9\n 100: invokevirtual #515 // Method Day18$Instruction.getDirection:()LDay18$Direction;\n 103: astore 14\n 105: aload 9\n 107: invokevirtual #518 // Method Day18$Instruction.getSteps:()I\n 110: istore 15\n 112: aload 14\n 114: getstatic #524 // Field Day18$WhenMappings.$EnumSwitchMapping$0:[I\n 117: swap\n 118: invokevirtual #529 // Method Day18$Direction.ordinal:()I\n 121: iaload\n 122: tableswitch { // 1 to 4\n 1: 152\n 2: 175\n 3: 198\n 4: 221\n default: 244\n }\n 152: new #172 // class Day17$Coordinate\n 155: dup\n 156: aload 12\n 158: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 161: aload 12\n 163: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 166: iload 15\n 168: isub\n 169: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 172: goto 252\n 175: new #172 // class Day17$Coordinate\n 178: dup\n 179: aload 12\n 181: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 184: aload 12\n 186: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 189: iload 15\n 191: iadd\n 192: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 195: goto 252\n 198: new #172 // class Day17$Coordinate\n 201: dup\n 202: aload 12\n 204: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 207: iload 15\n 209: isub\n 210: aload 12\n 212: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 215: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 218: goto 252\n 221: new #172 // class Day17$Coordinate\n 224: dup\n 225: aload 12\n 227: invokevirtual #346 // Method Day17$Coordinate.getX:()I\n 230: iload 15\n 232: iadd\n 233: aload 12\n 235: invokevirtual #349 // Method Day17$Coordinate.getY:()I\n 238: invokespecial #173 // Method Day17$Coordinate.\"<init>\":(II)V\n 241: goto 252\n 244: new #531 // class kotlin/NoWhenBranchMatchedException\n 247: dup\n 248: invokespecial #532 // Method kotlin/NoWhenBranchMatchedException.\"<init>\":()V\n 251: athrow\n 252: astore 16\n 254: new #105 // class Day18$Segment\n 257: dup\n 258: iconst_2\n 259: anewarray #172 // class Day17$Coordinate\n 262: astore 17\n 264: aload 17\n 266: iconst_0\n 267: aload 12\n 269: aastore\n 270: aload 17\n 272: iconst_1\n 273: aload 16\n 275: aastore\n 276: aload 17\n 278: invokestatic #538 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;\n 281: invokespecial #541 // Method Day18$Segment.\"<init>\":(Ljava/util/Set;)V\n 284: astore 18\n 286: aload 16\n 288: aload 13\n 290: checkcast #37 // class java/util/Collection\n 293: aload 18\n 295: invokestatic #545 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 298: checkcast #24 // class java/lang/Iterable\n 301: invokestatic #444 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;\n 304: invokestatic #503 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 307: astore 6\n 309: goto 45\n 312: aload 6\n 314: invokevirtual #548 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;\n 317: checkcast #71 // class java/util/List\n 320: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_3\n 11: iconst_0\n 12: istore 4\n 14: aload_3\n 15: astore 5\n 17: new #26 // class java/util/ArrayList\n 20: dup\n 21: aload_3\n 22: bipush 10\n 24: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 27: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 30: checkcast #37 // class java/util/Collection\n 33: astore 6\n 35: iconst_0\n 36: istore 7\n 38: aload 5\n 40: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 45: astore 8\n 47: aload 8\n 49: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 54: ifeq 100\n 57: aload 8\n 59: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 64: astore 9\n 66: aload 6\n 68: aload 9\n 70: checkcast #53 // class java/lang/String\n 73: astore 10\n 75: astore 12\n 77: iconst_0\n 78: istore 11\n 80: getstatic #59 // Field Day18$Instruction.Companion:LDay18$Instruction$Companion;\n 83: aload 10\n 85: invokevirtual #65 // Method Day18$Instruction$Companion.parse:(Ljava/lang/String;)LDay18$Instruction;\n 88: aload 12\n 90: swap\n 91: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 96: pop\n 97: goto 47\n 100: aload 6\n 102: checkcast #71 // class java/util/List\n 105: nop\n 106: checkcast #24 // class java/lang/Iterable\n 109: astore_3\n 110: nop\n 111: iconst_0\n 112: istore 4\n 114: aload_3\n 115: astore 5\n 117: new #26 // class java/util/ArrayList\n 120: dup\n 121: aload_3\n 122: bipush 10\n 124: invokestatic #32 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 127: invokespecial #35 // Method java/util/ArrayList.\"<init>\":(I)V\n 130: checkcast #37 // class java/util/Collection\n 133: astore 6\n 135: iconst_0\n 136: istore 7\n 138: aload 5\n 140: invokeinterface #41, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 145: astore 8\n 147: aload 8\n 149: invokeinterface #47, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 154: ifeq 197\n 157: aload 8\n 159: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 164: astore 9\n 166: aload 6\n 168: aload 9\n 170: checkcast #55 // class Day18$Instruction\n 173: astore 10\n 175: astore 12\n 177: iconst_0\n 178: istore 11\n 180: aload 10\n 182: invokevirtual #565 // Method Day18$Instruction.toTrueInstruction:()LDay18$Instruction;\n 185: aload 12\n 187: swap\n 188: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 193: pop\n 194: goto 147\n 197: aload 6\n 199: checkcast #71 // class java/util/List\n 202: nop\n 203: astore_2\n 204: aload_0\n 205: aload_2\n 206: invokevirtual #75 // Method cubicMetersEnclosed:(Ljava/util/List;)J\n 209: invokestatic #79 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 212: areturn\n\n private static final java.lang.Comparable cubicMetersEnclosed$lambda$5(Day18$Segment);\n Code:\n 0: aload_0\n 1: ldc_w #568 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #109 // Method Day18$Segment.getMinY:()I\n 11: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #378 // class java/lang/Comparable\n 17: areturn\n\n private static final java.lang.Comparable cubicMetersEnclosed$lambda$6(Day18$Segment);\n Code:\n 0: aload_0\n 1: ldc_w #568 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #112 // Method Day18$Segment.getMaxY:()I\n 11: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #378 // class java/lang/Comparable\n 17: areturn\n\n private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$20(Day18$Segment);\n Code:\n 0: aload_0\n 1: ldc_w #568 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #115 // Method Day18$Segment.getMinX:()I\n 11: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #378 // class java/lang/Comparable\n 17: areturn\n\n private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$21(Day18$Segment);\n Code:\n 0: aload_0\n 1: ldc_w #568 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #118 // Method Day18$Segment.getMaxX:()I\n 11: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #378 // class java/lang/Comparable\n 17: areturn\n\n private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$26(Day18$Segment);\n Code:\n 0: aload_0\n 1: ldc_w #568 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #109 // Method Day18$Segment.getMinY:()I\n 11: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #378 // class java/lang/Comparable\n 17: areturn\n\n private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$27(Day18$Segment);\n Code:\n 0: aload_0\n 1: ldc_w #568 // String it\n 4: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 7: aload_0\n 8: invokevirtual #112 // Method Day18$Segment.getMaxY:()I\n 11: invokestatic #376 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 14: checkcast #378 // class java/lang/Comparable\n 17: areturn\n\n static {};\n Code:\n 0: new #2 // class Day18\n 3: dup\n 4: invokespecial #570 // Method \"<init>\":()V\n 7: putstatic #176 // Field INSTANCE:LDay18;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day18$WhenMappings.class", "javap": "Compiled from \"Day18.kt\"\npublic final class Day18$WhenMappings {\n public static final int[] $EnumSwitchMapping$0;\n\n static {};\n Code:\n 0: invokestatic #14 // Method Day18$Direction.values:()[LDay18$Direction;\n 3: arraylength\n 4: newarray int\n 6: astore_0\n 7: nop\n 8: aload_0\n 9: getstatic #18 // Field Day18$Direction.UP:LDay18$Direction;\n 12: invokevirtual #22 // Method Day18$Direction.ordinal:()I\n 15: iconst_1\n 16: iastore\n 17: goto 21\n 20: astore_1\n 21: nop\n 22: aload_0\n 23: getstatic #25 // Field Day18$Direction.DOWN:LDay18$Direction;\n 26: invokevirtual #22 // Method Day18$Direction.ordinal:()I\n 29: iconst_2\n 30: iastore\n 31: goto 35\n 34: astore_1\n 35: nop\n 36: aload_0\n 37: getstatic #28 // Field Day18$Direction.LEFT:LDay18$Direction;\n 40: invokevirtual #22 // Method Day18$Direction.ordinal:()I\n 43: iconst_3\n 44: iastore\n 45: goto 49\n 48: astore_1\n 49: nop\n 50: aload_0\n 51: getstatic #31 // Field Day18$Direction.RIGHT:LDay18$Direction;\n 54: invokevirtual #22 // Method Day18$Direction.ordinal:()I\n 57: iconst_4\n 58: iastore\n 59: goto 63\n 62: astore_1\n 63: aload_0\n 64: putstatic #35 // Field $EnumSwitchMapping$0:[I\n 67: return\n Exception table:\n from to target type\n 7 17 20 Class java/lang/NoSuchFieldError\n 21 31 34 Class java/lang/NoSuchFieldError\n 35 45 48 Class java/lang/NoSuchFieldError\n 49 59 62 Class java/lang/NoSuchFieldError\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day4.kt
import kotlin.String import kotlin.collections.List import kotlin.math.pow object Day4 { data class CardData(val cardIndex: Int, val winningNumberCount: Int) { companion object { fun parseCardData(input: String): CardData { val (cardInformation, numberInformation) = input.split(":") val cardIndex = cardInformation.trimStart(*"Card ".toCharArray()).toInt() val (winningNumberInformation, cardNumberInformation) = numberInformation.split("|") val winningNumbers = parseNumbers(winningNumberInformation) val cardNumbers = parseNumbers(cardNumberInformation) val winningNumberCount = cardNumbers.filter { winningNumbers.contains(it) }.count() return CardData(cardIndex, winningNumberCount) } private fun parseNumbers(numbers: String): List<Int> { return numbers.trimStart(*" ".toCharArray()) .trimEnd(*" ".toCharArray()) .split(" ") .filter(String::isNotEmpty) .map { it.toInt() } } } fun score(): Int { val exp = winningNumberCount - 1 return 2.0.pow(exp.toDouble()).toInt() } fun cardIndexesToCopy(): IntRange { return (cardIndex + 1..cardIndex + winningNumberCount) } } fun part1(input: List<String>): String = input.map(CardData::parseCardData).map(CardData::score).sum().toString() fun part2(input: List<String>): String = findTotalCards(input.map(CardData::parseCardData)).toString() private fun findTotalCards(cards: List<CardData>): Int { val cardMultiplierCount = mutableMapOf<Int, Int>() return cards.map { val multiplier = (cardMultiplierCount[it.cardIndex] ?: 0) + 1 it.cardIndexesToCopy().forEach { cardMultiplierCount.merge(it, multiplier) { a, b -> a + b } } multiplier }.sum() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day4$CardData$Companion.class", "javap": "Compiled from \"Day4.kt\"\npublic final class Day4$CardData$Companion {\n private Day4$CardData$Companion();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final Day4$CardData parseCardData(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #15 // String input\n 3: invokestatic #21 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #23 // class java/lang/CharSequence\n 10: iconst_1\n 11: anewarray #25 // class java/lang/String\n 14: astore_3\n 15: aload_3\n 16: iconst_0\n 17: ldc #27 // String :\n 19: aastore\n 20: aload_3\n 21: iconst_0\n 22: iconst_0\n 23: bipush 6\n 25: aconst_null\n 26: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 29: astore_2\n 30: aload_2\n 31: iconst_0\n 32: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 37: checkcast #25 // class java/lang/String\n 40: astore_3\n 41: aload_2\n 42: iconst_1\n 43: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 48: checkcast #25 // class java/lang/String\n 51: astore 4\n 53: aload_3\n 54: ldc #41 // String Card\n 56: invokevirtual #45 // Method java/lang/String.toCharArray:()[C\n 59: dup\n 60: ldc #47 // String toCharArray(...)\n 62: invokestatic #50 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 65: astore 6\n 67: aload 6\n 69: aload 6\n 71: arraylength\n 72: invokestatic #56 // Method java/util/Arrays.copyOf:([CI)[C\n 75: invokestatic #60 // Method kotlin/text/StringsKt.trimStart:(Ljava/lang/String;[C)Ljava/lang/String;\n 78: invokestatic #66 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 81: istore 5\n 83: aload 4\n 85: checkcast #23 // class java/lang/CharSequence\n 88: iconst_1\n 89: anewarray #25 // class java/lang/String\n 92: astore 7\n 94: aload 7\n 96: iconst_0\n 97: ldc #68 // String |\n 99: aastore\n 100: aload 7\n 102: iconst_0\n 103: iconst_0\n 104: bipush 6\n 106: aconst_null\n 107: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 110: astore 6\n 112: aload 6\n 114: iconst_0\n 115: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 120: checkcast #25 // class java/lang/String\n 123: astore 7\n 125: aload 6\n 127: iconst_1\n 128: invokeinterface #39, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 133: checkcast #25 // class java/lang/String\n 136: astore 8\n 138: aload_0\n 139: aload 7\n 141: invokespecial #72 // Method parseNumbers:(Ljava/lang/String;)Ljava/util/List;\n 144: astore 9\n 146: aload_0\n 147: aload 8\n 149: invokespecial #72 // Method parseNumbers:(Ljava/lang/String;)Ljava/util/List;\n 152: astore 10\n 154: aload 10\n 156: checkcast #74 // class java/lang/Iterable\n 159: astore 12\n 161: iconst_0\n 162: istore 13\n 164: aload 12\n 166: astore 14\n 168: new #76 // class java/util/ArrayList\n 171: dup\n 172: invokespecial #77 // Method java/util/ArrayList.\"<init>\":()V\n 175: checkcast #79 // class java/util/Collection\n 178: astore 15\n 180: iconst_0\n 181: istore 16\n 183: aload 14\n 185: invokeinterface #83, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 190: astore 17\n 192: aload 17\n 194: invokeinterface #89, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 199: ifeq 252\n 202: aload 17\n 204: invokeinterface #93, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 209: astore 18\n 211: aload 18\n 213: checkcast #95 // class java/lang/Number\n 216: invokevirtual #99 // Method java/lang/Number.intValue:()I\n 219: istore 19\n 221: iconst_0\n 222: istore 20\n 224: aload 9\n 226: iload 19\n 228: invokestatic #103 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 231: invokeinterface #107, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 236: ifeq 192\n 239: aload 15\n 241: aload 18\n 243: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 248: pop\n 249: goto 192\n 252: aload 15\n 254: checkcast #35 // class java/util/List\n 257: nop\n 258: checkcast #79 // class java/util/Collection\n 261: invokeinterface #113, 1 // InterfaceMethod java/util/Collection.size:()I\n 266: istore 11\n 268: new #115 // class Day4$CardData\n 271: dup\n 272: iload 5\n 274: iload 11\n 276: invokespecial #118 // Method Day4$CardData.\"<init>\":(II)V\n 279: areturn\n\n private final java.util.List<java.lang.Integer> parseNumbers(java.lang.String);\n Code:\n 0: aload_1\n 1: ldc #143 // String\n 3: invokevirtual #45 // Method java/lang/String.toCharArray:()[C\n 6: dup\n 7: ldc #47 // String toCharArray(...)\n 9: invokestatic #50 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: astore_2\n 13: aload_2\n 14: aload_2\n 15: arraylength\n 16: invokestatic #56 // Method java/util/Arrays.copyOf:([CI)[C\n 19: invokestatic #60 // Method kotlin/text/StringsKt.trimStart:(Ljava/lang/String;[C)Ljava/lang/String;\n 22: ldc #143 // String\n 24: invokevirtual #45 // Method java/lang/String.toCharArray:()[C\n 27: dup\n 28: ldc #47 // String toCharArray(...)\n 30: invokestatic #50 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 33: astore_2\n 34: aload_2\n 35: aload_2\n 36: arraylength\n 37: invokestatic #56 // Method java/util/Arrays.copyOf:([CI)[C\n 40: invokestatic #146 // Method kotlin/text/StringsKt.trimEnd:(Ljava/lang/String;[C)Ljava/lang/String;\n 43: checkcast #23 // class java/lang/CharSequence\n 46: iconst_1\n 47: anewarray #25 // class java/lang/String\n 50: astore_2\n 51: aload_2\n 52: iconst_0\n 53: ldc #143 // String\n 55: aastore\n 56: aload_2\n 57: iconst_0\n 58: iconst_0\n 59: bipush 6\n 61: aconst_null\n 62: invokestatic #33 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 65: checkcast #74 // class java/lang/Iterable\n 68: astore_2\n 69: nop\n 70: iconst_0\n 71: istore_3\n 72: aload_2\n 73: astore 4\n 75: new #76 // class java/util/ArrayList\n 78: dup\n 79: invokespecial #77 // Method java/util/ArrayList.\"<init>\":()V\n 82: checkcast #79 // class java/util/Collection\n 85: astore 5\n 87: iconst_0\n 88: istore 6\n 90: aload 4\n 92: invokeinterface #83, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 97: astore 7\n 99: aload 7\n 101: invokeinterface #89, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 106: ifeq 163\n 109: aload 7\n 111: invokeinterface #93, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 116: astore 8\n 118: aload 8\n 120: checkcast #25 // class java/lang/String\n 123: astore 9\n 125: iconst_0\n 126: istore 10\n 128: aload 9\n 130: checkcast #23 // class java/lang/CharSequence\n 133: invokeinterface #149, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 138: ifle 145\n 141: iconst_1\n 142: goto 146\n 145: iconst_0\n 146: nop\n 147: ifeq 99\n 150: aload 5\n 152: aload 8\n 154: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 159: pop\n 160: goto 99\n 163: aload 5\n 165: checkcast #35 // class java/util/List\n 168: nop\n 169: checkcast #74 // class java/lang/Iterable\n 172: astore_2\n 173: nop\n 174: iconst_0\n 175: istore_3\n 176: aload_2\n 177: astore 4\n 179: new #76 // class java/util/ArrayList\n 182: dup\n 183: aload_2\n 184: bipush 10\n 186: invokestatic #155 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 189: invokespecial #158 // Method java/util/ArrayList.\"<init>\":(I)V\n 192: checkcast #79 // class java/util/Collection\n 195: astore 5\n 197: iconst_0\n 198: istore 6\n 200: aload 4\n 202: invokeinterface #83, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 207: astore 7\n 209: aload 7\n 211: invokeinterface #89, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 216: ifeq 263\n 219: aload 7\n 221: invokeinterface #93, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 226: astore 8\n 228: aload 5\n 230: aload 8\n 232: checkcast #25 // class java/lang/String\n 235: astore 9\n 237: astore 11\n 239: iconst_0\n 240: istore 10\n 242: aload 9\n 244: invokestatic #66 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 247: nop\n 248: invokestatic #103 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 251: aload 11\n 253: swap\n 254: invokeinterface #110, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 259: pop\n 260: goto 209\n 263: aload 5\n 265: checkcast #35 // class java/util/List\n 268: nop\n 269: areturn\n\n public Day4$CardData$Companion(kotlin.jvm.internal.DefaultConstructorMarker);\n Code:\n 0: aload_0\n 1: invokespecial #169 // Method \"<init>\":()V\n 4: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day4.class", "javap": "Compiled from \"Day4.kt\"\npublic final class Day4 {\n public static final Day4 INSTANCE;\n\n private Day4();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: checkcast #24 // class java/lang/Iterable\n 10: astore_2\n 11: getstatic #30 // Field Day4$CardData.Companion:LDay4$CardData$Companion;\n 14: astore_3\n 15: iconst_0\n 16: istore 4\n 18: aload_2\n 19: astore 5\n 21: new #32 // class java/util/ArrayList\n 24: dup\n 25: aload_2\n 26: bipush 10\n 28: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 31: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 34: checkcast #43 // class java/util/Collection\n 37: astore 6\n 39: iconst_0\n 40: istore 7\n 42: aload 5\n 44: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 49: astore 8\n 51: aload 8\n 53: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 58: ifeq 102\n 61: aload 8\n 63: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 68: astore 9\n 70: aload 6\n 72: aload 9\n 74: checkcast #59 // class java/lang/String\n 77: astore 10\n 79: astore 12\n 81: iconst_0\n 82: istore 11\n 84: aload_3\n 85: aload 10\n 87: invokevirtual #65 // Method Day4$CardData$Companion.parseCardData:(Ljava/lang/String;)LDay4$CardData;\n 90: aload 12\n 92: swap\n 93: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 98: pop\n 99: goto 51\n 102: aload 6\n 104: checkcast #71 // class java/util/List\n 107: nop\n 108: checkcast #24 // class java/lang/Iterable\n 111: astore_2\n 112: nop\n 113: iconst_0\n 114: istore_3\n 115: aload_2\n 116: astore 4\n 118: new #32 // class java/util/ArrayList\n 121: dup\n 122: aload_2\n 123: bipush 10\n 125: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 128: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 131: checkcast #43 // class java/util/Collection\n 134: astore 5\n 136: iconst_0\n 137: istore 6\n 139: aload 4\n 141: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 146: astore 7\n 148: aload 7\n 150: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 155: ifeq 201\n 158: aload 7\n 160: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 165: astore 8\n 167: aload 5\n 169: aload 8\n 171: checkcast #26 // class Day4$CardData\n 174: astore 9\n 176: astore 12\n 178: iconst_0\n 179: istore 10\n 181: aload 9\n 183: invokevirtual #75 // Method Day4$CardData.score:()I\n 186: invokestatic #81 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 189: aload 12\n 191: swap\n 192: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 197: pop\n 198: goto 148\n 201: aload 5\n 203: checkcast #71 // class java/util/List\n 206: nop\n 207: checkcast #24 // class java/lang/Iterable\n 210: invokestatic #85 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 213: invokestatic #88 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 216: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: checkcast #24 // class java/lang/Iterable\n 11: astore_2\n 12: getstatic #30 // Field Day4$CardData.Companion:LDay4$CardData$Companion;\n 15: astore_3\n 16: astore 12\n 18: iconst_0\n 19: istore 4\n 21: aload_2\n 22: astore 5\n 24: new #32 // class java/util/ArrayList\n 27: dup\n 28: aload_2\n 29: bipush 10\n 31: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 34: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 37: checkcast #43 // class java/util/Collection\n 40: astore 6\n 42: iconst_0\n 43: istore 7\n 45: aload 5\n 47: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 8\n 54: aload 8\n 56: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 105\n 64: aload 8\n 66: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 9\n 73: aload 6\n 75: aload 9\n 77: checkcast #59 // class java/lang/String\n 80: astore 10\n 82: astore 13\n 84: iconst_0\n 85: istore 11\n 87: aload_3\n 88: aload 10\n 90: invokevirtual #65 // Method Day4$CardData$Companion.parseCardData:(Ljava/lang/String;)LDay4$CardData;\n 93: aload 13\n 95: swap\n 96: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 101: pop\n 102: goto 54\n 105: aload 6\n 107: checkcast #71 // class java/util/List\n 110: nop\n 111: aload 12\n 113: swap\n 114: invokespecial #109 // Method findTotalCards:(Ljava/util/List;)I\n 117: invokestatic #88 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 120: areturn\n\n private final int findTotalCards(java.util.List<Day4$CardData>);\n Code:\n 0: new #113 // class java/util/LinkedHashMap\n 3: dup\n 4: invokespecial #114 // Method java/util/LinkedHashMap.\"<init>\":()V\n 7: checkcast #116 // class java/util/Map\n 10: astore_2\n 11: aload_1\n 12: checkcast #24 // class java/lang/Iterable\n 15: astore_3\n 16: iconst_0\n 17: istore 4\n 19: aload_3\n 20: astore 5\n 22: new #32 // class java/util/ArrayList\n 25: dup\n 26: aload_3\n 27: bipush 10\n 29: invokestatic #38 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 32: invokespecial #41 // Method java/util/ArrayList.\"<init>\":(I)V\n 35: checkcast #43 // class java/util/Collection\n 38: astore 6\n 40: iconst_0\n 41: istore 7\n 43: aload 5\n 45: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 50: astore 8\n 52: aload 8\n 54: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 59: ifeq 217\n 62: aload 8\n 64: invokeinterface #57, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 69: astore 9\n 71: aload 6\n 73: aload 9\n 75: checkcast #26 // class Day4$CardData\n 78: astore 10\n 80: astore 19\n 82: iconst_0\n 83: istore 11\n 85: aload_2\n 86: aload 10\n 88: invokevirtual #119 // Method Day4$CardData.getCardIndex:()I\n 91: invokestatic #81 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 94: invokeinterface #123, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 99: checkcast #77 // class java/lang/Integer\n 102: dup\n 103: ifnull 112\n 106: invokevirtual #126 // Method java/lang/Integer.intValue:()I\n 109: goto 114\n 112: pop\n 113: iconst_0\n 114: iconst_1\n 115: iadd\n 116: istore 12\n 118: aload 10\n 120: invokevirtual #130 // Method Day4$CardData.cardIndexesToCopy:()Lkotlin/ranges/IntRange;\n 123: checkcast #24 // class java/lang/Iterable\n 126: astore 13\n 128: iconst_0\n 129: istore 14\n 131: aload 13\n 133: invokeinterface #47, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 138: astore 15\n 140: aload 15\n 142: invokeinterface #53, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 147: ifeq 199\n 150: aload 15\n 152: checkcast #132 // class kotlin/collections/IntIterator\n 155: invokevirtual #135 // Method kotlin/collections/IntIterator.nextInt:()I\n 158: istore 16\n 160: iload 16\n 162: istore 17\n 164: iconst_0\n 165: istore 18\n 167: aload_2\n 168: iload 17\n 170: invokestatic #81 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 173: iload 12\n 175: invokestatic #81 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 178: invokedynamic #154, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;\n 183: invokedynamic #165, 0 // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiFunction;\n 188: invokeinterface #169, 4 // InterfaceMethod java/util/Map.merge:(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;\n 193: pop\n 194: nop\n 195: nop\n 196: goto 140\n 199: nop\n 200: iload 12\n 202: invokestatic #81 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 205: aload 19\n 207: swap\n 208: invokeinterface #69, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 213: pop\n 214: goto 52\n 217: aload 6\n 219: checkcast #71 // class java/util/List\n 222: nop\n 223: checkcast #24 // class java/lang/Iterable\n 226: invokestatic #85 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 229: ireturn\n\n private static final java.lang.Integer findTotalCards$lambda$5$lambda$4$lambda$2(java.lang.Integer, java.lang.Integer);\n Code:\n 0: aload_0\n 1: ldc #181 // String a\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #183 // String b\n 9: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: invokevirtual #126 // Method java/lang/Integer.intValue:()I\n 16: aload_1\n 17: invokevirtual #126 // Method java/lang/Integer.intValue:()I\n 20: iadd\n 21: invokestatic #81 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 24: areturn\n\n private static final java.lang.Integer findTotalCards$lambda$5$lambda$4$lambda$3(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: aload_2\n 3: invokeinterface #188, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 8: checkcast #77 // class java/lang/Integer\n 11: areturn\n\n static {};\n Code:\n 0: new #2 // class Day4\n 3: dup\n 4: invokespecial #193 // Method \"<init>\":()V\n 7: putstatic #196 // Field INSTANCE:LDay4;\n 10: return\n}\n", "javap_err": "" }, { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day4$CardData.class", "javap": "Compiled from \"Day4.kt\"\npublic final class Day4$CardData {\n public static final Day4$CardData$Companion Companion;\n\n private final int cardIndex;\n\n private final int winningNumberCount;\n\n public Day4$CardData(int, int);\n Code:\n 0: aload_0\n 1: invokespecial #9 // Method java/lang/Object.\"<init>\":()V\n 4: aload_0\n 5: iload_1\n 6: putfield #13 // Field cardIndex:I\n 9: aload_0\n 10: iload_2\n 11: putfield #16 // Field winningNumberCount:I\n 14: return\n\n public final int getCardIndex();\n Code:\n 0: aload_0\n 1: getfield #13 // Field cardIndex:I\n 4: ireturn\n\n public final int getWinningNumberCount();\n Code:\n 0: aload_0\n 1: getfield #16 // Field winningNumberCount:I\n 4: ireturn\n\n public final int score();\n Code:\n 0: aload_0\n 1: getfield #16 // Field winningNumberCount:I\n 4: iconst_1\n 5: isub\n 6: istore_1\n 7: ldc2_w #23 // double 2.0d\n 10: iload_1\n 11: i2d\n 12: invokestatic #30 // Method java/lang/Math.pow:(DD)D\n 15: d2i\n 16: ireturn\n\n public final kotlin.ranges.IntRange cardIndexesToCopy();\n Code:\n 0: new #36 // class kotlin/ranges/IntRange\n 3: dup\n 4: aload_0\n 5: getfield #13 // Field cardIndex:I\n 8: iconst_1\n 9: iadd\n 10: aload_0\n 11: getfield #13 // Field cardIndex:I\n 14: aload_0\n 15: getfield #16 // Field winningNumberCount:I\n 18: iadd\n 19: invokespecial #38 // Method kotlin/ranges/IntRange.\"<init>\":(II)V\n 22: areturn\n\n public final int component1();\n Code:\n 0: aload_0\n 1: getfield #13 // Field cardIndex:I\n 4: ireturn\n\n public final int component2();\n Code:\n 0: aload_0\n 1: getfield #16 // Field winningNumberCount:I\n 4: ireturn\n\n public final Day4$CardData copy(int, int);\n Code:\n 0: new #2 // class Day4$CardData\n 3: dup\n 4: iload_1\n 5: iload_2\n 6: invokespecial #43 // Method \"<init>\":(II)V\n 9: areturn\n\n public static Day4$CardData copy$default(Day4$CardData, int, int, int, java.lang.Object);\n Code:\n 0: iload_3\n 1: iconst_1\n 2: iand\n 3: ifeq 11\n 6: aload_0\n 7: getfield #13 // Field cardIndex:I\n 10: istore_1\n 11: iload_3\n 12: iconst_2\n 13: iand\n 14: ifeq 22\n 17: aload_0\n 18: getfield #16 // Field winningNumberCount:I\n 21: istore_2\n 22: aload_0\n 23: iload_1\n 24: iload_2\n 25: invokevirtual #47 // Method copy:(II)LDay4$CardData;\n 28: areturn\n\n public java.lang.String toString();\n Code:\n 0: new #51 // class java/lang/StringBuilder\n 3: dup\n 4: invokespecial #52 // Method java/lang/StringBuilder.\"<init>\":()V\n 7: ldc #54 // String CardData(cardIndex=\n 9: invokevirtual #58 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 12: aload_0\n 13: getfield #13 // Field cardIndex:I\n 16: invokevirtual #61 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 19: ldc #63 // String , winningNumberCount=\n 21: invokevirtual #58 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 24: aload_0\n 25: getfield #16 // Field winningNumberCount:I\n 28: invokevirtual #61 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 31: bipush 41\n 33: invokevirtual #66 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 36: invokevirtual #68 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 39: areturn\n\n public int hashCode();\n Code:\n 0: aload_0\n 1: getfield #13 // Field cardIndex:I\n 4: invokestatic #74 // Method java/lang/Integer.hashCode:(I)I\n 7: istore_1\n 8: iload_1\n 9: bipush 31\n 11: imul\n 12: aload_0\n 13: getfield #16 // Field winningNumberCount:I\n 16: invokestatic #74 // Method java/lang/Integer.hashCode:(I)I\n 19: iadd\n 20: istore_1\n 21: iload_1\n 22: ireturn\n\n public boolean equals(java.lang.Object);\n Code:\n 0: aload_0\n 1: aload_1\n 2: if_acmpne 7\n 5: iconst_1\n 6: ireturn\n 7: aload_1\n 8: instanceof #2 // class Day4$CardData\n 11: ifne 16\n 14: iconst_0\n 15: ireturn\n 16: aload_1\n 17: checkcast #2 // class Day4$CardData\n 20: astore_2\n 21: aload_0\n 22: getfield #13 // Field cardIndex:I\n 25: aload_2\n 26: getfield #13 // Field cardIndex:I\n 29: if_icmpeq 34\n 32: iconst_0\n 33: ireturn\n 34: aload_0\n 35: getfield #16 // Field winningNumberCount:I\n 38: aload_2\n 39: getfield #16 // Field winningNumberCount:I\n 42: if_icmpeq 47\n 45: iconst_0\n 46: ireturn\n 47: iconst_1\n 48: ireturn\n\n static {};\n Code:\n 0: new #83 // class Day4$CardData$Companion\n 3: dup\n 4: aconst_null\n 5: invokespecial #86 // Method Day4$CardData$Companion.\"<init>\":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V\n 8: putstatic #90 // Field Companion:LDay4$CardData$Companion;\n 11: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day14.kt
import Day13.transpose import kotlin.String import kotlin.collections.List object Day14 { private const val ROUNDED = 'O' fun part1(input: List<String>): String { val transposedDish = transpose(input) return transposedDish.sumOf { row -> val rolled = roll(row) rolled.reversed().withIndex().filter { (_, char) -> char == ROUNDED }.sumOf { (idx, _) -> idx + 1 } }.toString() } private fun roll(row: String): String { if (row.isBlank()) { return row } if (row[0] == ROUNDED) { return row[0] + roll(row.substring(1)) } val indexToSwap = row.withIndex().dropWhile { (_, char) -> char == '.' }.firstOrNull() if (indexToSwap == null) { return row } val (idx, _) = indexToSwap return if (row[idx] == ROUNDED) { ROUNDED.toString() + roll(row.substring(1, idx) + "." + row.substring(idx + 1)) } else { row.substring(0, idx + 1) + roll(row.substring(idx + 1)) } } fun part2(input: List<String>): String { val cycled = cycleUntil(transpose(input), 1_000_000_000) return cycled .sumOf { row -> val rowSum = row.reversed().withIndex().filter { (_, char) -> char == ROUNDED }.sumOf { (idx, _) -> idx + 1 } rowSum } .toString() } private fun cycleUntil(grid: List<String>, targetCycles: Int): List<String> { val seenMap = mutableMapOf<List<String>, Long>() var cycles = 0L var cycled = cycle(grid) while (cycles < targetCycles) { cycled = cycle(cycled) cycles++ if (seenMap.containsKey(cycled)) { val firstSeen = seenMap[cycled]!! val cyclesSince = cycles - firstSeen var remainingCycles = (targetCycles - cycles) % cyclesSince - 1 while (remainingCycles > 0) { cycled = cycle(cycled) remainingCycles-- } break } else { seenMap[cycled] = cycles } } return cycled } private fun cycle(grid: List<String>): List<String> { val northRoll = grid.map { roll(it) } val west = transpose(northRoll) val westRoll = west.map { roll(it) } val south = transpose(westRoll).map { it.reversed() } val southRoll = south.map { roll(it) } val east = transpose(southRoll.map { it.reversed() }).map { it.reversed() } val eastRoll = east.map { roll(it) } val backNorth = transpose(eastRoll.map { it.reversed() }) return backNorth } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day14.class", "javap": "Compiled from \"Day14.kt\"\npublic final class Day14 {\n public static final Day14 INSTANCE;\n\n private static final char ROUNDED;\n\n private Day14();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: getstatic #28 // Field Day13.INSTANCE:LDay13;\n 9: aload_1\n 10: invokevirtual #32 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;\n 13: astore_2\n 14: aload_2\n 15: checkcast #34 // class java/lang/Iterable\n 18: astore_3\n 19: iconst_0\n 20: istore 4\n 22: aload_3\n 23: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 28: astore 5\n 30: aload 5\n 32: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 37: ifeq 287\n 40: aload 5\n 42: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 47: astore 6\n 49: iload 4\n 51: aload 6\n 53: checkcast #50 // class java/lang/String\n 56: astore 7\n 58: istore 22\n 60: iconst_0\n 61: istore 8\n 63: getstatic #52 // Field INSTANCE:LDay14;\n 66: aload 7\n 68: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 71: astore 9\n 73: aload 9\n 75: checkcast #58 // class java/lang/CharSequence\n 78: invokestatic #64 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 81: invokevirtual #68 // Method java/lang/Object.toString:()Ljava/lang/String;\n 84: checkcast #58 // class java/lang/CharSequence\n 87: invokestatic #72 // Method kotlin/text/StringsKt.withIndex:(Ljava/lang/CharSequence;)Ljava/lang/Iterable;\n 90: astore 10\n 92: iconst_0\n 93: istore 11\n 95: aload 10\n 97: astore 12\n 99: new #74 // class java/util/ArrayList\n 102: dup\n 103: invokespecial #75 // Method java/util/ArrayList.\"<init>\":()V\n 106: checkcast #77 // class java/util/Collection\n 109: astore 13\n 111: iconst_0\n 112: istore 14\n 114: aload 12\n 116: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 121: astore 15\n 123: aload 15\n 125: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 130: ifeq 193\n 133: aload 15\n 135: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 140: astore 16\n 142: aload 16\n 144: checkcast #79 // class kotlin/collections/IndexedValue\n 147: astore 17\n 149: iconst_0\n 150: istore 18\n 152: aload 17\n 154: invokevirtual #82 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 157: checkcast #84 // class java/lang/Character\n 160: invokevirtual #88 // Method java/lang/Character.charValue:()C\n 163: istore 19\n 165: iload 19\n 167: bipush 79\n 169: if_icmpne 176\n 172: iconst_1\n 173: goto 177\n 176: iconst_0\n 177: ifeq 123\n 180: aload 13\n 182: aload 16\n 184: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 189: pop\n 190: goto 123\n 193: aload 13\n 195: checkcast #94 // class java/util/List\n 198: nop\n 199: checkcast #34 // class java/lang/Iterable\n 202: astore 10\n 204: iconst_0\n 205: istore 11\n 207: aload 10\n 209: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 214: astore 12\n 216: aload 12\n 218: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 223: ifeq 272\n 226: aload 12\n 228: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 233: astore 13\n 235: iload 11\n 237: aload 13\n 239: checkcast #79 // class kotlin/collections/IndexedValue\n 242: astore 14\n 244: istore 20\n 246: iconst_0\n 247: istore 15\n 249: aload 14\n 251: invokevirtual #98 // Method kotlin/collections/IndexedValue.component1:()I\n 254: istore 16\n 256: iload 16\n 258: iconst_1\n 259: iadd\n 260: istore 21\n 262: iload 20\n 264: iload 21\n 266: iadd\n 267: istore 11\n 269: goto 216\n 272: iload 11\n 274: nop\n 275: istore 23\n 277: iload 22\n 279: iload 23\n 281: iadd\n 282: istore 4\n 284: goto 30\n 287: iload 4\n 289: invokestatic #102 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 292: areturn\n\n private final java.lang.String roll(java.lang.String);\n Code:\n 0: aload_1\n 1: checkcast #58 // class java/lang/CharSequence\n 4: invokestatic #127 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z\n 7: ifeq 12\n 10: aload_1\n 11: areturn\n 12: aload_1\n 13: iconst_0\n 14: invokevirtual #131 // Method java/lang/String.charAt:(I)C\n 17: bipush 79\n 19: if_icmpne 63\n 22: aload_1\n 23: iconst_0\n 24: invokevirtual #131 // Method java/lang/String.charAt:(I)C\n 27: istore_2\n 28: aload_0\n 29: aload_1\n 30: iconst_1\n 31: invokevirtual #134 // Method java/lang/String.substring:(I)Ljava/lang/String;\n 34: dup\n 35: ldc #136 // String substring(...)\n 37: invokestatic #139 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 40: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 43: astore_3\n 44: new #141 // class java/lang/StringBuilder\n 47: dup\n 48: invokespecial #142 // Method java/lang/StringBuilder.\"<init>\":()V\n 51: iload_2\n 52: invokevirtual #146 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 55: aload_3\n 56: invokevirtual #149 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 59: invokevirtual #150 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 62: areturn\n 63: aload_1\n 64: checkcast #58 // class java/lang/CharSequence\n 67: invokestatic #72 // Method kotlin/text/StringsKt.withIndex:(Ljava/lang/CharSequence;)Ljava/lang/Iterable;\n 70: astore_3\n 71: iconst_0\n 72: istore 4\n 74: iconst_0\n 75: istore 5\n 77: new #74 // class java/util/ArrayList\n 80: dup\n 81: invokespecial #75 // Method java/util/ArrayList.\"<init>\":()V\n 84: astore 6\n 86: aload_3\n 87: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 92: astore 7\n 94: aload 7\n 96: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 101: ifeq 181\n 104: aload 7\n 106: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 111: astore 8\n 113: iload 5\n 115: ifeq 129\n 118: aload 6\n 120: aload 8\n 122: invokevirtual #151 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 125: pop\n 126: goto 94\n 129: aload 8\n 131: checkcast #79 // class kotlin/collections/IndexedValue\n 134: astore 9\n 136: iconst_0\n 137: istore 10\n 139: aload 9\n 141: invokevirtual #82 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 144: checkcast #84 // class java/lang/Character\n 147: invokevirtual #88 // Method java/lang/Character.charValue:()C\n 150: istore 11\n 152: iload 11\n 154: bipush 46\n 156: if_icmpne 163\n 159: iconst_1\n 160: goto 164\n 163: iconst_0\n 164: ifne 94\n 167: aload 6\n 169: aload 8\n 171: invokevirtual #151 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z\n 174: pop\n 175: iconst_1\n 176: istore 5\n 178: goto 94\n 181: aload 6\n 183: checkcast #94 // class java/util/List\n 186: invokestatic #157 // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;\n 189: checkcast #79 // class kotlin/collections/IndexedValue\n 192: astore_2\n 193: aload_2\n 194: ifnonnull 199\n 197: aload_1\n 198: areturn\n 199: aload_2\n 200: invokevirtual #98 // Method kotlin/collections/IndexedValue.component1:()I\n 203: istore_3\n 204: aload_1\n 205: iload_3\n 206: invokevirtual #131 // Method java/lang/String.charAt:(I)C\n 209: bipush 79\n 211: if_icmpne 285\n 214: new #141 // class java/lang/StringBuilder\n 217: dup\n 218: invokespecial #142 // Method java/lang/StringBuilder.\"<init>\":()V\n 221: bipush 79\n 223: invokevirtual #146 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 226: aload_0\n 227: new #141 // class java/lang/StringBuilder\n 230: dup\n 231: invokespecial #142 // Method java/lang/StringBuilder.\"<init>\":()V\n 234: aload_1\n 235: iconst_1\n 236: iload_3\n 237: invokevirtual #160 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 240: dup\n 241: ldc #136 // String substring(...)\n 243: invokestatic #139 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 246: invokevirtual #149 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 249: bipush 46\n 251: invokevirtual #146 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 254: aload_1\n 255: iload_3\n 256: iconst_1\n 257: iadd\n 258: invokevirtual #134 // Method java/lang/String.substring:(I)Ljava/lang/String;\n 261: dup\n 262: ldc #136 // String substring(...)\n 264: invokestatic #139 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 267: invokevirtual #149 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 270: invokevirtual #150 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 273: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 276: invokevirtual #149 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 279: invokevirtual #150 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 282: goto 332\n 285: new #141 // class java/lang/StringBuilder\n 288: dup\n 289: invokespecial #142 // Method java/lang/StringBuilder.\"<init>\":()V\n 292: aload_1\n 293: iconst_0\n 294: iload_3\n 295: iconst_1\n 296: iadd\n 297: invokevirtual #160 // Method java/lang/String.substring:(II)Ljava/lang/String;\n 300: dup\n 301: ldc #136 // String substring(...)\n 303: invokestatic #139 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 306: invokevirtual #149 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 309: aload_0\n 310: aload_1\n 311: iload_3\n 312: iconst_1\n 313: iadd\n 314: invokevirtual #134 // Method java/lang/String.substring:(I)Ljava/lang/String;\n 317: dup\n 318: ldc #136 // String substring(...)\n 320: invokestatic #139 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V\n 323: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 326: invokevirtual #149 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 329: invokevirtual #150 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 332: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: getstatic #28 // Field Day13.INSTANCE:LDay13;\n 10: aload_1\n 11: invokevirtual #32 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;\n 14: ldc #172 // int 1000000000\n 16: invokespecial #176 // Method cycleUntil:(Ljava/util/List;I)Ljava/util/List;\n 19: astore_2\n 20: aload_2\n 21: checkcast #34 // class java/lang/Iterable\n 24: astore_3\n 25: iconst_0\n 26: istore 4\n 28: aload_3\n 29: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 34: astore 5\n 36: aload 5\n 38: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 43: ifeq 286\n 46: aload 5\n 48: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 53: astore 6\n 55: iload 4\n 57: aload 6\n 59: checkcast #50 // class java/lang/String\n 62: astore 7\n 64: istore 22\n 66: iconst_0\n 67: istore 8\n 69: aload 7\n 71: checkcast #58 // class java/lang/CharSequence\n 74: invokestatic #64 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 77: invokevirtual #68 // Method java/lang/Object.toString:()Ljava/lang/String;\n 80: checkcast #58 // class java/lang/CharSequence\n 83: invokestatic #72 // Method kotlin/text/StringsKt.withIndex:(Ljava/lang/CharSequence;)Ljava/lang/Iterable;\n 86: astore 9\n 88: iconst_0\n 89: istore 10\n 91: aload 9\n 93: astore 11\n 95: new #74 // class java/util/ArrayList\n 98: dup\n 99: invokespecial #75 // Method java/util/ArrayList.\"<init>\":()V\n 102: checkcast #77 // class java/util/Collection\n 105: astore 12\n 107: iconst_0\n 108: istore 13\n 110: aload 11\n 112: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 117: astore 14\n 119: aload 14\n 121: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 126: ifeq 189\n 129: aload 14\n 131: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 136: astore 15\n 138: aload 15\n 140: checkcast #79 // class kotlin/collections/IndexedValue\n 143: astore 16\n 145: iconst_0\n 146: istore 17\n 148: aload 16\n 150: invokevirtual #82 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;\n 153: checkcast #84 // class java/lang/Character\n 156: invokevirtual #88 // Method java/lang/Character.charValue:()C\n 159: istore 18\n 161: iload 18\n 163: bipush 79\n 165: if_icmpne 172\n 168: iconst_1\n 169: goto 173\n 172: iconst_0\n 173: ifeq 119\n 176: aload 12\n 178: aload 15\n 180: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 185: pop\n 186: goto 119\n 189: aload 12\n 191: checkcast #94 // class java/util/List\n 194: nop\n 195: checkcast #34 // class java/lang/Iterable\n 198: astore 9\n 200: iconst_0\n 201: istore 10\n 203: aload 9\n 205: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 210: astore 11\n 212: aload 11\n 214: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 219: ifeq 268\n 222: aload 11\n 224: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 229: astore 12\n 231: iload 10\n 233: aload 12\n 235: checkcast #79 // class kotlin/collections/IndexedValue\n 238: astore 13\n 240: istore 19\n 242: iconst_0\n 243: istore 14\n 245: aload 13\n 247: invokevirtual #98 // Method kotlin/collections/IndexedValue.component1:()I\n 250: istore 15\n 252: iload 15\n 254: iconst_1\n 255: iadd\n 256: istore 20\n 258: iload 19\n 260: iload 20\n 262: iadd\n 263: istore 10\n 265: goto 212\n 268: iload 10\n 270: istore 21\n 272: iload 21\n 274: istore 23\n 276: iload 22\n 278: iload 23\n 280: iadd\n 281: istore 4\n 283: goto 36\n 286: iload 4\n 288: invokestatic #102 // Method java/lang/String.valueOf:(I)Ljava/lang/String;\n 291: areturn\n\n private final java.util.List<java.lang.String> cycleUntil(java.util.List<java.lang.String>, int);\n Code:\n 0: new #184 // class java/util/LinkedHashMap\n 3: dup\n 4: invokespecial #185 // Method java/util/LinkedHashMap.\"<init>\":()V\n 7: checkcast #187 // class java/util/Map\n 10: astore_3\n 11: lconst_0\n 12: lstore 4\n 14: aload_0\n 15: aload_1\n 16: invokespecial #190 // Method cycle:(Ljava/util/List;)Ljava/util/List;\n 19: astore 6\n 21: lload 4\n 23: iload_2\n 24: i2l\n 25: lcmp\n 26: ifge 151\n 29: aload_0\n 30: aload 6\n 32: invokespecial #190 // Method cycle:(Ljava/util/List;)Ljava/util/List;\n 35: astore 6\n 37: lload 4\n 39: lstore 7\n 41: lload 7\n 43: lconst_1\n 44: ladd\n 45: lstore 4\n 47: aload_3\n 48: aload 6\n 50: invokeinterface #193, 2 // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z\n 55: ifeq 130\n 58: aload_3\n 59: aload 6\n 61: invokeinterface #197, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 66: dup\n 67: invokestatic #201 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 70: checkcast #203 // class java/lang/Number\n 73: invokevirtual #207 // Method java/lang/Number.longValue:()J\n 76: lstore 7\n 78: lload 4\n 80: lload 7\n 82: lsub\n 83: lstore 9\n 85: iload_2\n 86: i2l\n 87: lload 4\n 89: lsub\n 90: lload 9\n 92: lrem\n 93: lconst_1\n 94: lsub\n 95: lstore 11\n 97: lload 11\n 99: lconst_0\n 100: lcmp\n 101: ifle 127\n 104: aload_0\n 105: aload 6\n 107: invokespecial #190 // Method cycle:(Ljava/util/List;)Ljava/util/List;\n 110: astore 6\n 112: lload 11\n 114: lstore 13\n 116: lload 13\n 118: ldc2_w #208 // long -1l\n 121: ladd\n 122: lstore 11\n 124: goto 97\n 127: goto 151\n 130: lload 4\n 132: invokestatic #214 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 135: astore 8\n 137: aload_3\n 138: aload 6\n 140: aload 8\n 142: invokeinterface #218, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 147: pop\n 148: goto 21\n 151: aload 6\n 153: areturn\n\n private final java.util.List<java.lang.String> cycle(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #34 // class java/lang/Iterable\n 4: astore_3\n 5: iconst_0\n 6: istore 4\n 8: aload_3\n 9: astore 5\n 11: new #74 // class java/util/ArrayList\n 14: dup\n 15: aload_3\n 16: bipush 10\n 18: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 21: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 24: checkcast #77 // class java/util/Collection\n 27: astore 6\n 29: iconst_0\n 30: istore 7\n 32: aload 5\n 34: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 39: astore 8\n 41: aload 8\n 43: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 48: ifeq 94\n 51: aload 8\n 53: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 58: astore 9\n 60: aload 6\n 62: aload 9\n 64: checkcast #50 // class java/lang/String\n 67: astore 10\n 69: astore 19\n 71: iconst_0\n 72: istore 11\n 74: getstatic #52 // Field INSTANCE:LDay14;\n 77: aload 10\n 79: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 82: aload 19\n 84: swap\n 85: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 90: pop\n 91: goto 41\n 94: aload 6\n 96: checkcast #94 // class java/util/List\n 99: nop\n 100: astore_2\n 101: getstatic #28 // Field Day13.INSTANCE:LDay13;\n 104: aload_2\n 105: invokevirtual #32 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;\n 108: astore_3\n 109: aload_3\n 110: checkcast #34 // class java/lang/Iterable\n 113: astore 5\n 115: iconst_0\n 116: istore 6\n 118: aload 5\n 120: astore 7\n 122: new #74 // class java/util/ArrayList\n 125: dup\n 126: aload 5\n 128: bipush 10\n 130: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 133: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 136: checkcast #77 // class java/util/Collection\n 139: astore 8\n 141: iconst_0\n 142: istore 9\n 144: aload 7\n 146: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 151: astore 10\n 153: aload 10\n 155: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 160: ifeq 206\n 163: aload 10\n 165: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 170: astore 11\n 172: aload 8\n 174: aload 11\n 176: checkcast #50 // class java/lang/String\n 179: astore 12\n 181: astore 19\n 183: iconst_0\n 184: istore 13\n 186: getstatic #52 // Field INSTANCE:LDay14;\n 189: aload 12\n 191: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 194: aload 19\n 196: swap\n 197: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 202: pop\n 203: goto 153\n 206: aload 8\n 208: checkcast #94 // class java/util/List\n 211: nop\n 212: astore 4\n 214: getstatic #28 // Field Day13.INSTANCE:LDay13;\n 217: aload 4\n 219: invokevirtual #32 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;\n 222: checkcast #34 // class java/lang/Iterable\n 225: astore 6\n 227: iconst_0\n 228: istore 7\n 230: aload 6\n 232: astore 8\n 234: new #74 // class java/util/ArrayList\n 237: dup\n 238: aload 6\n 240: bipush 10\n 242: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 245: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 248: checkcast #77 // class java/util/Collection\n 251: astore 9\n 253: iconst_0\n 254: istore 10\n 256: aload 8\n 258: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 263: astore 11\n 265: aload 11\n 267: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 272: ifeq 322\n 275: aload 11\n 277: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 282: astore 12\n 284: aload 9\n 286: aload 12\n 288: checkcast #50 // class java/lang/String\n 291: astore 13\n 293: astore 19\n 295: iconst_0\n 296: istore 14\n 298: aload 13\n 300: checkcast #58 // class java/lang/CharSequence\n 303: invokestatic #64 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 306: invokevirtual #68 // Method java/lang/Object.toString:()Ljava/lang/String;\n 309: nop\n 310: aload 19\n 312: swap\n 313: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 318: pop\n 319: goto 265\n 322: aload 9\n 324: checkcast #94 // class java/util/List\n 327: nop\n 328: astore 5\n 330: aload 5\n 332: checkcast #34 // class java/lang/Iterable\n 335: astore 7\n 337: iconst_0\n 338: istore 8\n 340: aload 7\n 342: astore 9\n 344: new #74 // class java/util/ArrayList\n 347: dup\n 348: aload 7\n 350: bipush 10\n 352: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 355: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 358: checkcast #77 // class java/util/Collection\n 361: astore 10\n 363: iconst_0\n 364: istore 11\n 366: aload 9\n 368: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 373: astore 12\n 375: aload 12\n 377: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 382: ifeq 428\n 385: aload 12\n 387: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 392: astore 13\n 394: aload 10\n 396: aload 13\n 398: checkcast #50 // class java/lang/String\n 401: astore 14\n 403: astore 19\n 405: iconst_0\n 406: istore 15\n 408: getstatic #52 // Field INSTANCE:LDay14;\n 411: aload 14\n 413: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 416: aload 19\n 418: swap\n 419: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 424: pop\n 425: goto 375\n 428: aload 10\n 430: checkcast #94 // class java/util/List\n 433: nop\n 434: astore 6\n 436: getstatic #28 // Field Day13.INSTANCE:LDay13;\n 439: aload 6\n 441: checkcast #34 // class java/lang/Iterable\n 444: astore 8\n 446: astore 19\n 448: iconst_0\n 449: istore 9\n 451: aload 8\n 453: astore 10\n 455: new #74 // class java/util/ArrayList\n 458: dup\n 459: aload 8\n 461: bipush 10\n 463: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 466: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 469: checkcast #77 // class java/util/Collection\n 472: astore 11\n 474: iconst_0\n 475: istore 12\n 477: aload 10\n 479: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 484: astore 13\n 486: aload 13\n 488: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 493: ifeq 543\n 496: aload 13\n 498: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 503: astore 14\n 505: aload 11\n 507: aload 14\n 509: checkcast #50 // class java/lang/String\n 512: astore 15\n 514: astore 20\n 516: iconst_0\n 517: istore 16\n 519: aload 15\n 521: checkcast #58 // class java/lang/CharSequence\n 524: invokestatic #64 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 527: invokevirtual #68 // Method java/lang/Object.toString:()Ljava/lang/String;\n 530: nop\n 531: aload 20\n 533: swap\n 534: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 539: pop\n 540: goto 486\n 543: aload 11\n 545: checkcast #94 // class java/util/List\n 548: nop\n 549: aload 19\n 551: swap\n 552: invokevirtual #32 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;\n 555: checkcast #34 // class java/lang/Iterable\n 558: astore 8\n 560: iconst_0\n 561: istore 9\n 563: aload 8\n 565: astore 10\n 567: new #74 // class java/util/ArrayList\n 570: dup\n 571: aload 8\n 573: bipush 10\n 575: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 578: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 581: checkcast #77 // class java/util/Collection\n 584: astore 11\n 586: iconst_0\n 587: istore 12\n 589: aload 10\n 591: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 596: astore 13\n 598: aload 13\n 600: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 605: ifeq 655\n 608: aload 13\n 610: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 615: astore 14\n 617: aload 11\n 619: aload 14\n 621: checkcast #50 // class java/lang/String\n 624: astore 15\n 626: astore 19\n 628: iconst_0\n 629: istore 16\n 631: aload 15\n 633: checkcast #58 // class java/lang/CharSequence\n 636: invokestatic #64 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 639: invokevirtual #68 // Method java/lang/Object.toString:()Ljava/lang/String;\n 642: nop\n 643: aload 19\n 645: swap\n 646: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 651: pop\n 652: goto 598\n 655: aload 11\n 657: checkcast #94 // class java/util/List\n 660: nop\n 661: astore 7\n 663: aload 7\n 665: checkcast #34 // class java/lang/Iterable\n 668: astore 9\n 670: iconst_0\n 671: istore 10\n 673: aload 9\n 675: astore 11\n 677: new #74 // class java/util/ArrayList\n 680: dup\n 681: aload 9\n 683: bipush 10\n 685: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 688: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 691: checkcast #77 // class java/util/Collection\n 694: astore 12\n 696: iconst_0\n 697: istore 13\n 699: aload 11\n 701: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 706: astore 14\n 708: aload 14\n 710: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 715: ifeq 761\n 718: aload 14\n 720: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 725: astore 15\n 727: aload 12\n 729: aload 15\n 731: checkcast #50 // class java/lang/String\n 734: astore 16\n 736: astore 19\n 738: iconst_0\n 739: istore 17\n 741: getstatic #52 // Field INSTANCE:LDay14;\n 744: aload 16\n 746: invokespecial #56 // Method roll:(Ljava/lang/String;)Ljava/lang/String;\n 749: aload 19\n 751: swap\n 752: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 757: pop\n 758: goto 708\n 761: aload 12\n 763: checkcast #94 // class java/util/List\n 766: nop\n 767: astore 8\n 769: getstatic #28 // Field Day13.INSTANCE:LDay13;\n 772: aload 8\n 774: checkcast #34 // class java/lang/Iterable\n 777: astore 10\n 779: astore 19\n 781: iconst_0\n 782: istore 11\n 784: aload 10\n 786: astore 12\n 788: new #74 // class java/util/ArrayList\n 791: dup\n 792: aload 10\n 794: bipush 10\n 796: invokestatic #232 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 799: invokespecial #235 // Method java/util/ArrayList.\"<init>\":(I)V\n 802: checkcast #77 // class java/util/Collection\n 805: astore 13\n 807: iconst_0\n 808: istore 14\n 810: aload 12\n 812: invokeinterface #38, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 817: astore 15\n 819: aload 15\n 821: invokeinterface #44, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 826: ifeq 876\n 829: aload 15\n 831: invokeinterface #48, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 836: astore 16\n 838: aload 13\n 840: aload 16\n 842: checkcast #50 // class java/lang/String\n 845: astore 17\n 847: astore 20\n 849: iconst_0\n 850: istore 18\n 852: aload 17\n 854: checkcast #58 // class java/lang/CharSequence\n 857: invokestatic #64 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 860: invokevirtual #68 // Method java/lang/Object.toString:()Ljava/lang/String;\n 863: nop\n 864: aload 20\n 866: swap\n 867: invokeinterface #92, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 872: pop\n 873: goto 819\n 876: aload 13\n 878: checkcast #94 // class java/util/List\n 881: nop\n 882: aload 19\n 884: swap\n 885: invokevirtual #32 // Method Day13.transpose:(Ljava/util/List;)Ljava/util/List;\n 888: astore 9\n 890: aload 9\n 892: areturn\n\n static {};\n Code:\n 0: new #2 // class Day14\n 3: dup\n 4: invokespecial #259 // Method \"<init>\":()V\n 7: putstatic #52 // Field INSTANCE:LDay14;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day6.kt
import kotlin.String import kotlin.collections.List import kotlin.math.* object Day6 { fun part1(input: List<String>): String { val parseNumbers: (String, String) -> List<Int> = { str: String, prefix: String -> str.replace(prefix, "") .trim() .split("\\s+".toRegex()) .map { it.toInt() } } val times = parseNumbers(input.first(), "Time:") val distances = parseNumbers(input.last(), "Distance:") return times.zip(distances) .map { (time, distance) -> val (maxTime, minTime) = maxAndMinTimes(time.toLong(), distance.toLong()) maxTime - minTime + 1 }.reduce { a, b -> a * b }.toString() } fun part2(input: List<String>): String { val parseNumber: (String, String) -> Long = { str: String, prefix: String -> str.replace(prefix, "") .trim() .replace(" ", "") .toLong() } val time = parseNumber(input.first(), "Time:") val distance = parseNumber(input.last(), "Distance:") val (maxTime, minTime) = maxAndMinTimes(time, distance) // Add 1 to count the upper as inclusive return (maxTime - minTime + 1).toString() } /** * If we look at the equation for distance, we get: * distance = holdTime * (time - holdTime) * Turning this into a quadratic equation, we get: * 0 = -holdTime^2 + time * holdTime - distance * * We can then use the quadratic formula to find the holdTime: * holdTime = (-time +- sqrt(time^2 - 4 * -(distance + 1))) / -2 * * Note, we set distance + 1 because we have to exceed the target distance */ private fun maxAndMinTimes(time: Long, distance: Long): Pair<Long, Long> { val squareRoot = sqrt(time.toDouble().pow(2) - 4 * (distance + 1)) val upper = (-time - squareRoot) / -2 val lower = (-time + squareRoot) / -2 // We have to floor the upper because we cannot hold fractional seconds, and have to ceil the lower return floor(upper).toLong() to ceil(lower).toLong() } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day6.class", "javap": "Compiled from \"Day6.kt\"\npublic final class Day6 {\n public static final Day6 INSTANCE;\n\n private Day6();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: invokedynamic #41, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;\n 11: astore_2\n 12: aload_2\n 13: aload_1\n 14: invokestatic #47 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 17: ldc #49 // String Time:\n 19: invokeinterface #53, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 24: checkcast #55 // class java/util/List\n 27: astore_3\n 28: aload_2\n 29: aload_1\n 30: invokestatic #58 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 33: ldc #60 // String Distance:\n 35: invokeinterface #53, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 40: checkcast #55 // class java/util/List\n 43: astore 4\n 45: aload_3\n 46: checkcast #62 // class java/lang/Iterable\n 49: aload 4\n 51: checkcast #62 // class java/lang/Iterable\n 54: invokestatic #66 // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;\n 57: checkcast #62 // class java/lang/Iterable\n 60: astore 5\n 62: nop\n 63: iconst_0\n 64: istore 6\n 66: aload 5\n 68: astore 7\n 70: new #68 // class java/util/ArrayList\n 73: dup\n 74: aload 5\n 76: bipush 10\n 78: invokestatic #72 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 81: invokespecial #75 // Method java/util/ArrayList.\"<init>\":(I)V\n 84: checkcast #77 // class java/util/Collection\n 87: astore 8\n 89: iconst_0\n 90: istore 9\n 92: aload 7\n 94: invokeinterface #81, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 99: astore 10\n 101: aload 10\n 103: invokeinterface #87, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 108: ifeq 222\n 111: aload 10\n 113: invokeinterface #91, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 118: astore 11\n 120: aload 8\n 122: aload 11\n 124: checkcast #93 // class kotlin/Pair\n 127: astore 12\n 129: astore 21\n 131: iconst_0\n 132: istore 13\n 134: aload 12\n 136: invokevirtual #96 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 139: checkcast #98 // class java/lang/Number\n 142: invokevirtual #102 // Method java/lang/Number.intValue:()I\n 145: istore 14\n 147: aload 12\n 149: invokevirtual #105 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 152: checkcast #98 // class java/lang/Number\n 155: invokevirtual #102 // Method java/lang/Number.intValue:()I\n 158: istore 15\n 160: getstatic #108 // Field INSTANCE:LDay6;\n 163: iload 14\n 165: i2l\n 166: iload 15\n 168: i2l\n 169: invokespecial #112 // Method maxAndMinTimes:(JJ)Lkotlin/Pair;\n 172: astore 16\n 174: aload 16\n 176: invokevirtual #96 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 179: checkcast #98 // class java/lang/Number\n 182: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 185: lstore 17\n 187: aload 16\n 189: invokevirtual #105 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 192: checkcast #98 // class java/lang/Number\n 195: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 198: lstore 19\n 200: lload 17\n 202: lload 19\n 204: lsub\n 205: lconst_1\n 206: ladd\n 207: invokestatic #122 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 210: aload 21\n 212: swap\n 213: invokeinterface #126, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 218: pop\n 219: goto 101\n 222: aload 8\n 224: checkcast #55 // class java/util/List\n 227: nop\n 228: checkcast #62 // class java/lang/Iterable\n 231: astore 5\n 233: nop\n 234: iconst_0\n 235: istore 6\n 237: aload 5\n 239: invokeinterface #81, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 244: astore 7\n 246: aload 7\n 248: invokeinterface #87, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 253: ifne 266\n 256: new #128 // class java/lang/UnsupportedOperationException\n 259: dup\n 260: ldc #130 // String Empty collection can\\'t be reduced.\n 262: invokespecial #133 // Method java/lang/UnsupportedOperationException.\"<init>\":(Ljava/lang/String;)V\n 265: athrow\n 266: aload 7\n 268: invokeinterface #91, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 273: astore 8\n 275: aload 7\n 277: invokeinterface #87, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 282: ifeq 326\n 285: aload 8\n 287: aload 7\n 289: invokeinterface #91, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 294: checkcast #98 // class java/lang/Number\n 297: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 300: lstore 9\n 302: checkcast #98 // class java/lang/Number\n 305: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 308: lstore 11\n 310: iconst_0\n 311: istore 13\n 313: lload 11\n 315: lload 9\n 317: lmul\n 318: invokestatic #122 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 321: astore 8\n 323: goto 275\n 326: aload 8\n 328: checkcast #98 // class java/lang/Number\n 331: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 334: invokestatic #138 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 337: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: invokedynamic #176, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function2;\n 11: astore_2\n 12: aload_2\n 13: aload_1\n 14: invokestatic #47 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 17: ldc #49 // String Time:\n 19: invokeinterface #53, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 24: checkcast #98 // class java/lang/Number\n 27: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 30: lstore_3\n 31: aload_2\n 32: aload_1\n 33: invokestatic #58 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 36: ldc #60 // String Distance:\n 38: invokeinterface #53, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 43: checkcast #98 // class java/lang/Number\n 46: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 49: lstore 5\n 51: aload_0\n 52: lload_3\n 53: lload 5\n 55: invokespecial #112 // Method maxAndMinTimes:(JJ)Lkotlin/Pair;\n 58: astore 7\n 60: aload 7\n 62: invokevirtual #96 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 65: checkcast #98 // class java/lang/Number\n 68: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 71: lstore 8\n 73: aload 7\n 75: invokevirtual #105 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 78: checkcast #98 // class java/lang/Number\n 81: invokevirtual #116 // Method java/lang/Number.longValue:()J\n 84: lstore 10\n 86: lload 8\n 88: lload 10\n 90: lsub\n 91: lconst_1\n 92: ladd\n 93: invokestatic #138 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 96: areturn\n\n private final kotlin.Pair<java.lang.Long, java.lang.Long> maxAndMinTimes(long, long);\n Code:\n 0: lload_1\n 1: l2d\n 2: iconst_2\n 3: i2d\n 4: invokestatic #184 // Method java/lang/Math.pow:(DD)D\n 7: iconst_4\n 8: i2l\n 9: lload_3\n 10: lconst_1\n 11: ladd\n 12: lmul\n 13: l2d\n 14: dsub\n 15: invokestatic #188 // Method java/lang/Math.sqrt:(D)D\n 18: dstore 5\n 20: lload_1\n 21: lneg\n 22: l2d\n 23: dload 5\n 25: dsub\n 26: bipush -2\n 28: i2d\n 29: ddiv\n 30: dstore 7\n 32: lload_1\n 33: lneg\n 34: l2d\n 35: dload 5\n 37: dadd\n 38: bipush -2\n 40: i2d\n 41: ddiv\n 42: dstore 9\n 44: dload 7\n 46: invokestatic #191 // Method java/lang/Math.floor:(D)D\n 49: d2l\n 50: invokestatic #122 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 53: dload 9\n 55: invokestatic #194 // Method java/lang/Math.ceil:(D)D\n 58: d2l\n 59: invokestatic #122 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 62: invokestatic #200 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 65: areturn\n\n private static final java.util.List part1$lambda$1(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #206 // String str\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #208 // String prefix\n 9: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: nop\n 13: aload_0\n 14: aload_1\n 15: ldc #210 // String\n 17: iconst_0\n 18: iconst_4\n 19: aconst_null\n 20: invokestatic #216 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 23: checkcast #218 // class java/lang/CharSequence\n 26: invokestatic #222 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 29: invokevirtual #226 // Method java/lang/Object.toString:()Ljava/lang/String;\n 32: checkcast #218 // class java/lang/CharSequence\n 35: astore_2\n 36: new #228 // class kotlin/text/Regex\n 39: dup\n 40: ldc #230 // String \\\\s+\n 42: invokespecial #231 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 45: astore_3\n 46: iconst_0\n 47: istore 4\n 49: aload_3\n 50: aload_2\n 51: iload 4\n 53: invokevirtual #235 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;\n 56: checkcast #62 // class java/lang/Iterable\n 59: astore_2\n 60: nop\n 61: iconst_0\n 62: istore_3\n 63: aload_2\n 64: astore 4\n 66: new #68 // class java/util/ArrayList\n 69: dup\n 70: aload_2\n 71: bipush 10\n 73: invokestatic #72 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 76: invokespecial #75 // Method java/util/ArrayList.\"<init>\":(I)V\n 79: checkcast #77 // class java/util/Collection\n 82: astore 5\n 84: iconst_0\n 85: istore 6\n 87: aload 4\n 89: invokeinterface #81, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 94: astore 7\n 96: aload 7\n 98: invokeinterface #87, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 103: ifeq 150\n 106: aload 7\n 108: invokeinterface #91, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 113: astore 8\n 115: aload 5\n 117: aload 8\n 119: checkcast #135 // class java/lang/String\n 122: astore 9\n 124: astore 11\n 126: iconst_0\n 127: istore 10\n 129: aload 9\n 131: invokestatic #241 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 134: nop\n 135: invokestatic #244 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 138: aload 11\n 140: swap\n 141: invokeinterface #126, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 146: pop\n 147: goto 96\n 150: aload 5\n 152: checkcast #55 // class java/util/List\n 155: nop\n 156: areturn\n\n private static final long part2$lambda$4(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #206 // String str\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #208 // String prefix\n 9: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: nop\n 13: nop\n 14: aload_0\n 15: aload_1\n 16: ldc #210 // String\n 18: iconst_0\n 19: iconst_4\n 20: aconst_null\n 21: invokestatic #216 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 24: checkcast #218 // class java/lang/CharSequence\n 27: invokestatic #222 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 30: invokevirtual #226 // Method java/lang/Object.toString:()Ljava/lang/String;\n 33: ldc #249 // String\n 35: ldc #210 // String\n 37: iconst_0\n 38: iconst_4\n 39: aconst_null\n 40: invokestatic #216 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;\n 43: invokestatic #253 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 46: lreturn\n\n static {};\n Code:\n 0: new #2 // class Day6\n 3: dup\n 4: invokespecial #255 // Method \"<init>\":()V\n 7: putstatic #108 // Field INSTANCE:LDay6;\n 10: return\n}\n", "javap_err": "" } ]
cbrentharris__kotlin-kringle__f689f8b/src/main/kotlin/Day9.kt
import kotlin.String import kotlin.collections.List object Day9 { fun part1(input: List<String>): String { return parse(input) .sumOf { extrapolate(it) { deltas, ret -> deltas.last() + ret } }.toString() } fun part2(input: List<String>): String { return parse(input) .sumOf { extrapolate(it) { deltas, ret -> deltas.first() - ret } }.toString() } private fun parse(input: List<String>): List<List<Long>> { return input.map { it.split("\\s+".toRegex()).map { it.toLong() } } } private fun extrapolate(input: List<Long>, extrapolator: (List<Long>, Long) -> Long): Long { val deltas = input.zipWithNext().map { (a, b) -> b - a } if (deltas.all { it == 0L }) { return extrapolator(input, 0) } return extrapolator(input, extrapolate(deltas, extrapolator)) } }
[ { "class_path": "cbrentharris__kotlin-kringle__f689f8b/Day9.class", "javap": "Compiled from \"Day9.kt\"\npublic final class Day9 {\n public static final Day9 INSTANCE;\n\n private Day9();\n Code:\n 0: aload_0\n 1: invokespecial #8 // Method java/lang/Object.\"<init>\":()V\n 4: return\n\n public final java.lang.String part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method parse:(Ljava/util/List;)Ljava/util/List;\n 11: checkcast #28 // class java/lang/Iterable\n 14: astore_2\n 15: lconst_0\n 16: lstore_3\n 17: aload_2\n 18: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 23: astore 5\n 25: aload 5\n 27: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 32: ifeq 81\n 35: aload 5\n 37: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 42: astore 6\n 44: lload_3\n 45: aload 6\n 47: checkcast #44 // class java/util/List\n 50: astore 7\n 52: lstore 9\n 54: iconst_0\n 55: istore 8\n 57: getstatic #47 // Field INSTANCE:LDay9;\n 60: aload 7\n 62: invokedynamic #67, 0 // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;\n 67: invokespecial #71 // Method extrapolate:(Ljava/util/List;Lkotlin/jvm/functions/Function2;)J\n 70: lstore 11\n 72: lload 9\n 74: lload 11\n 76: ladd\n 77: lstore_3\n 78: goto 25\n 81: lload_3\n 82: invokestatic #77 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 85: areturn\n\n public final java.lang.String part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: ldc #16 // String input\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: aload_1\n 8: invokespecial #26 // Method parse:(Ljava/util/List;)Ljava/util/List;\n 11: checkcast #28 // class java/lang/Iterable\n 14: astore_2\n 15: lconst_0\n 16: lstore_3\n 17: aload_2\n 18: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 23: astore 5\n 25: aload 5\n 27: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 32: ifeq 81\n 35: aload 5\n 37: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 42: astore 6\n 44: lload_3\n 45: aload 6\n 47: checkcast #44 // class java/util/List\n 50: astore 7\n 52: lstore 9\n 54: iconst_0\n 55: istore 8\n 57: getstatic #47 // Field INSTANCE:LDay9;\n 60: aload 7\n 62: invokedynamic #87, 0 // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function2;\n 67: invokespecial #71 // Method extrapolate:(Ljava/util/List;Lkotlin/jvm/functions/Function2;)J\n 70: lstore 11\n 72: lload 9\n 74: lload 11\n 76: ladd\n 77: lstore_3\n 78: goto 25\n 81: lload_3\n 82: invokestatic #77 // Method java/lang/String.valueOf:(J)Ljava/lang/String;\n 85: areturn\n\n private final java.util.List<java.util.List<java.lang.Long>> parse(java.util.List<java.lang.String>);\n Code:\n 0: aload_1\n 1: checkcast #28 // class java/lang/Iterable\n 4: astore_2\n 5: iconst_0\n 6: istore_3\n 7: aload_2\n 8: astore 4\n 10: new #91 // class java/util/ArrayList\n 13: dup\n 14: aload_2\n 15: bipush 10\n 17: invokestatic #97 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 20: invokespecial #100 // Method java/util/ArrayList.\"<init>\":(I)V\n 23: checkcast #102 // class java/util/Collection\n 26: astore 5\n 28: iconst_0\n 29: istore 6\n 31: aload 4\n 33: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 38: astore 7\n 40: aload 7\n 42: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 47: ifeq 220\n 50: aload 7\n 52: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 57: astore 8\n 59: aload 5\n 61: aload 8\n 63: checkcast #73 // class java/lang/String\n 66: astore 9\n 68: astore 21\n 70: iconst_0\n 71: istore 10\n 73: aload 9\n 75: checkcast #104 // class java/lang/CharSequence\n 78: astore 11\n 80: new #106 // class kotlin/text/Regex\n 83: dup\n 84: ldc #108 // String \\\\s+\n 86: invokespecial #111 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 89: astore 12\n 91: iconst_0\n 92: istore 13\n 94: aload 12\n 96: aload 11\n 98: iload 13\n 100: invokevirtual #115 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;\n 103: checkcast #28 // class java/lang/Iterable\n 106: astore 11\n 108: nop\n 109: iconst_0\n 110: istore 12\n 112: aload 11\n 114: astore 13\n 116: new #91 // class java/util/ArrayList\n 119: dup\n 120: aload 11\n 122: bipush 10\n 124: invokestatic #97 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 127: invokespecial #100 // Method java/util/ArrayList.\"<init>\":(I)V\n 130: checkcast #102 // class java/util/Collection\n 133: astore 14\n 135: iconst_0\n 136: istore 15\n 138: aload 13\n 140: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 145: astore 16\n 147: aload 16\n 149: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 154: ifeq 201\n 157: aload 16\n 159: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 164: astore 17\n 166: aload 14\n 168: aload 17\n 170: checkcast #73 // class java/lang/String\n 173: astore 18\n 175: astore 19\n 177: iconst_0\n 178: istore 20\n 180: aload 18\n 182: invokestatic #121 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J\n 185: nop\n 186: invokestatic #124 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 189: aload 19\n 191: swap\n 192: invokeinterface #128, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 197: pop\n 198: goto 147\n 201: aload 14\n 203: checkcast #44 // class java/util/List\n 206: nop\n 207: nop\n 208: aload 21\n 210: swap\n 211: invokeinterface #128, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 216: pop\n 217: goto 40\n 220: aload 5\n 222: checkcast #44 // class java/util/List\n 225: nop\n 226: areturn\n\n private final long extrapolate(java.util.List<java.lang.Long>, kotlin.jvm.functions.Function2<? super java.util.List<java.lang.Long>, ? super java.lang.Long, java.lang.Long>);\n Code:\n 0: aload_1\n 1: checkcast #28 // class java/lang/Iterable\n 4: invokestatic #145 // Method kotlin/collections/CollectionsKt.zipWithNext:(Ljava/lang/Iterable;)Ljava/util/List;\n 7: checkcast #28 // class java/lang/Iterable\n 10: astore 4\n 12: iconst_0\n 13: istore 5\n 15: aload 4\n 17: astore 6\n 19: new #91 // class java/util/ArrayList\n 22: dup\n 23: aload 4\n 25: bipush 10\n 27: invokestatic #97 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 30: invokespecial #100 // Method java/util/ArrayList.\"<init>\":(I)V\n 33: checkcast #102 // class java/util/Collection\n 36: astore 7\n 38: iconst_0\n 39: istore 8\n 41: aload 6\n 43: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 48: astore 9\n 50: aload 9\n 52: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 57: ifeq 129\n 60: aload 9\n 62: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 67: astore 10\n 69: aload 7\n 71: aload 10\n 73: checkcast #147 // class kotlin/Pair\n 76: astore 11\n 78: astore 17\n 80: iconst_0\n 81: istore 12\n 83: aload 11\n 85: invokevirtual #150 // Method kotlin/Pair.component1:()Ljava/lang/Object;\n 88: checkcast #152 // class java/lang/Number\n 91: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 94: lstore 13\n 96: aload 11\n 98: invokevirtual #159 // Method kotlin/Pair.component2:()Ljava/lang/Object;\n 101: checkcast #152 // class java/lang/Number\n 104: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 107: lstore 15\n 109: lload 15\n 111: lload 13\n 113: lsub\n 114: invokestatic #124 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 117: aload 17\n 119: swap\n 120: invokeinterface #128, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 125: pop\n 126: goto 50\n 129: aload 7\n 131: checkcast #44 // class java/util/List\n 134: nop\n 135: astore_3\n 136: aload_3\n 137: checkcast #28 // class java/lang/Iterable\n 140: astore 4\n 142: iconst_0\n 143: istore 5\n 145: aload 4\n 147: instanceof #102 // class java/util/Collection\n 150: ifeq 170\n 153: aload 4\n 155: checkcast #102 // class java/util/Collection\n 158: invokeinterface #162, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 163: ifeq 170\n 166: iconst_1\n 167: goto 231\n 170: aload 4\n 172: invokeinterface #32, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 177: astore 6\n 179: aload 6\n 181: invokeinterface #38, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 186: ifeq 230\n 189: aload 6\n 191: invokeinterface #42, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 196: astore 7\n 198: aload 7\n 200: checkcast #152 // class java/lang/Number\n 203: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 206: lstore 8\n 208: iconst_0\n 209: istore 10\n 211: lload 8\n 213: lconst_0\n 214: lcmp\n 215: ifne 222\n 218: iconst_1\n 219: goto 223\n 222: iconst_0\n 223: ifne 179\n 226: iconst_0\n 227: goto 231\n 230: iconst_1\n 231: ifeq 252\n 234: aload_2\n 235: aload_1\n 236: lconst_0\n 237: invokestatic #124 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 240: invokeinterface #166, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 245: checkcast #152 // class java/lang/Number\n 248: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 251: lreturn\n 252: aload_2\n 253: aload_1\n 254: aload_0\n 255: aload_3\n 256: aload_2\n 257: invokespecial #71 // Method extrapolate:(Ljava/util/List;Lkotlin/jvm/functions/Function2;)J\n 260: invokestatic #124 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;\n 263: invokeinterface #166, 3 // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n 268: checkcast #152 // class java/lang/Number\n 271: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 274: lreturn\n\n private static final long part1$lambda$1$lambda$0(java.util.List, long);\n Code:\n 0: aload_0\n 1: ldc #178 // String deltas\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #182 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #152 // class java/lang/Number\n 13: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 16: lload_1\n 17: ladd\n 18: lreturn\n\n private static final long part2$lambda$3$lambda$2(java.util.List, long);\n Code:\n 0: aload_0\n 1: ldc #178 // String deltas\n 3: invokestatic #22 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokestatic #186 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;\n 10: checkcast #152 // class java/lang/Number\n 13: invokevirtual #156 // Method java/lang/Number.longValue:()J\n 16: lload_1\n 17: lsub\n 18: lreturn\n\n static {};\n Code:\n 0: new #2 // class Day9\n 3: dup\n 4: invokespecial #188 // Method \"<init>\":()V\n 7: putstatic #47 // Field INSTANCE:LDay9;\n 10: return\n}\n", "javap_err": "" } ]
skarlman__AdventOfCode2022_kotlin__ef15752/src/Day03.kt
import java.io.File // Problem: // https://adventofcode.com/2022/day/3 // More solutions: // https://www.competitivecoders.com/ProgrammingCompetitions/advent-of-code/advent-of-code/2022/day-3/ fun main() { fun part1(input: List<String>): Int { return input.map { row -> val parts = row.chunked(row.length / 2) for (c in parts[0]) { if (parts[1].contains(c)) { return@map if (c.code > 96) c.code - 96 else c.code - 64 + 26 } } return@map 0 }.sum() } fun part2(input: List<String>): Int { return input.chunked(3).map { for (c in it[0]) { if (it[1].contains(c) && it[2].contains(c)){ return@map if (c.code > 96) c.code - 96 else c.code - 64 + 26 } } return@map 0 }.sum() } val input = readInput("Day03") println("Part 1: ${part1(input)}") println("Part 2: ${part2(input)}") } private fun readInput(name: String) = File("src", "$name.txt") .readLines()
[ { "class_path": "skarlman__AdventOfCode2022_kotlin__ef15752/Day03Kt.class", "javap": "Compiled from \"Day03.kt\"\npublic final class Day03Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String Day03\n 2: invokestatic #12 // Method readInput:(Ljava/lang/String;)Ljava/util/List;\n 5: astore_0\n 6: new #14 // class java/lang/StringBuilder\n 9: dup\n 10: invokespecial #17 // Method java/lang/StringBuilder.\"<init>\":()V\n 13: ldc #19 // String Part 1:\n 15: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 18: aload_0\n 19: invokestatic #27 // Method main$part1:(Ljava/util/List;)I\n 22: invokevirtual #30 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 25: invokevirtual #34 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 28: getstatic #40 // Field java/lang/System.out:Ljava/io/PrintStream;\n 31: swap\n 32: invokevirtual #46 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 35: new #14 // class java/lang/StringBuilder\n 38: dup\n 39: invokespecial #17 // Method java/lang/StringBuilder.\"<init>\":()V\n 42: ldc #48 // String Part 2:\n 44: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 47: aload_0\n 48: invokestatic #51 // Method main$part2:(Ljava/util/List;)I\n 51: invokevirtual #30 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 54: invokevirtual #34 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 57: getstatic #40 // Field java/lang/System.out:Ljava/io/PrintStream;\n 60: swap\n 61: invokevirtual #46 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 64: return\n\n private static final java.util.List<java.lang.String> readInput(java.lang.String);\n Code:\n 0: new #56 // class java/io/File\n 3: dup\n 4: ldc #58 // String src\n 6: new #14 // class java/lang/StringBuilder\n 9: dup\n 10: invokespecial #17 // Method java/lang/StringBuilder.\"<init>\":()V\n 13: aload_0\n 14: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 17: ldc #60 // String .txt\n 19: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: invokevirtual #34 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 25: invokespecial #63 // Method java/io/File.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 28: aconst_null\n 29: iconst_1\n 30: aconst_null\n 31: invokestatic #69 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 34: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #74 // Method main:()V\n 3: return\n\n private static final int main$part1(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: checkcast #79 // class java/lang/Iterable\n 4: astore_1\n 5: iconst_0\n 6: istore_2\n 7: aload_1\n 8: astore_3\n 9: new #81 // class java/util/ArrayList\n 12: dup\n 13: aload_1\n 14: bipush 10\n 16: invokestatic #87 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 19: invokespecial #90 // Method java/util/ArrayList.\"<init>\":(I)V\n 22: checkcast #92 // class java/util/Collection\n 25: astore 4\n 27: iconst_0\n 28: istore 5\n 30: aload_3\n 31: invokeinterface #96, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 36: astore 6\n 38: aload 6\n 40: invokeinterface #102, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 45: ifeq 197\n 48: aload 6\n 50: invokeinterface #106, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 55: astore 7\n 57: aload 4\n 59: aload 7\n 61: checkcast #108 // class java/lang/String\n 64: astore 8\n 66: astore 15\n 68: iconst_0\n 69: istore 9\n 71: aload 8\n 73: checkcast #110 // class java/lang/CharSequence\n 76: aload 8\n 78: invokevirtual #114 // Method java/lang/String.length:()I\n 81: iconst_2\n 82: idiv\n 83: invokestatic #120 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;\n 86: astore 10\n 88: aload 10\n 90: iconst_0\n 91: invokeinterface #126, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 96: checkcast #108 // class java/lang/String\n 99: astore 11\n 101: iconst_0\n 102: istore 12\n 104: aload 11\n 106: invokevirtual #114 // Method java/lang/String.length:()I\n 109: istore 13\n 111: iload 12\n 113: iload 13\n 115: if_icmpge 181\n 118: aload 11\n 120: iload 12\n 122: invokevirtual #130 // Method java/lang/String.charAt:(I)C\n 125: istore 14\n 127: aload 10\n 129: iconst_1\n 130: invokeinterface #126, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 135: checkcast #110 // class java/lang/CharSequence\n 138: iload 14\n 140: iconst_0\n 141: iconst_2\n 142: aconst_null\n 143: invokestatic #134 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z\n 146: ifeq 175\n 149: iload 14\n 151: bipush 96\n 153: if_icmple 164\n 156: iload 14\n 158: bipush 96\n 160: isub\n 161: goto 182\n 164: iload 14\n 166: bipush 64\n 168: isub\n 169: bipush 26\n 171: iadd\n 172: goto 182\n 175: iinc 12, 1\n 178: goto 111\n 181: iconst_0\n 182: invokestatic #140 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 185: aload 15\n 187: swap\n 188: invokeinterface #144, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 193: pop\n 194: goto 38\n 197: aload 4\n 199: checkcast #122 // class java/util/List\n 202: nop\n 203: checkcast #79 // class java/lang/Iterable\n 206: invokestatic #148 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 209: ireturn\n\n private static final int main$part2(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: checkcast #79 // class java/lang/Iterable\n 4: iconst_3\n 5: invokestatic #166 // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;\n 8: checkcast #79 // class java/lang/Iterable\n 11: astore_1\n 12: iconst_0\n 13: istore_2\n 14: aload_1\n 15: astore_3\n 16: new #81 // class java/util/ArrayList\n 19: dup\n 20: aload_1\n 21: bipush 10\n 23: invokestatic #87 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 26: invokespecial #90 // Method java/util/ArrayList.\"<init>\":(I)V\n 29: checkcast #92 // class java/util/Collection\n 32: astore 4\n 34: iconst_0\n 35: istore 5\n 37: aload_3\n 38: invokeinterface #96, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 6\n 45: aload 6\n 47: invokeinterface #102, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 209\n 55: aload 6\n 57: invokeinterface #106, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 7\n 64: aload 4\n 66: aload 7\n 68: checkcast #122 // class java/util/List\n 71: astore 8\n 73: astore 14\n 75: iconst_0\n 76: istore 9\n 78: aload 8\n 80: iconst_0\n 81: invokeinterface #126, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 86: checkcast #108 // class java/lang/String\n 89: astore 10\n 91: iconst_0\n 92: istore 11\n 94: aload 10\n 96: invokevirtual #114 // Method java/lang/String.length:()I\n 99: istore 12\n 101: iload 11\n 103: iload 12\n 105: if_icmpge 193\n 108: aload 10\n 110: iload 11\n 112: invokevirtual #130 // Method java/lang/String.charAt:(I)C\n 115: istore 13\n 117: aload 8\n 119: iconst_1\n 120: invokeinterface #126, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 125: checkcast #110 // class java/lang/CharSequence\n 128: iload 13\n 130: iconst_0\n 131: iconst_2\n 132: aconst_null\n 133: invokestatic #134 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z\n 136: ifeq 187\n 139: aload 8\n 141: iconst_2\n 142: invokeinterface #126, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 147: checkcast #110 // class java/lang/CharSequence\n 150: iload 13\n 152: iconst_0\n 153: iconst_2\n 154: aconst_null\n 155: invokestatic #134 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z\n 158: ifeq 187\n 161: iload 13\n 163: bipush 96\n 165: if_icmple 176\n 168: iload 13\n 170: bipush 96\n 172: isub\n 173: goto 194\n 176: iload 13\n 178: bipush 64\n 180: isub\n 181: bipush 26\n 183: iadd\n 184: goto 194\n 187: iinc 11, 1\n 190: goto 101\n 193: iconst_0\n 194: invokestatic #140 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 197: aload 14\n 199: swap\n 200: invokeinterface #144, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 205: pop\n 206: goto 45\n 209: aload 4\n 211: checkcast #122 // class java/util/List\n 214: nop\n 215: checkcast #79 // class java/lang/Iterable\n 218: invokestatic #148 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 221: ireturn\n}\n", "javap_err": "" } ]
skarlman__AdventOfCode2022_kotlin__ef15752/src/Day02.kt
import java.io.File // Problem: // https://adventofcode.com/2022/day/2 // More solutions: // https://www.competitivecoders.com/ProgrammingCompetitions/advent-of-code/advent-of-code/2022/day-2/ fun main() { fun part1(input: List<String>): Int { val scores = mapOf( Pair("A", "X") to 1 + 3, Pair("A", "Y") to 2 + 6, Pair("A", "Z") to 3 + 0, Pair("B", "X") to 1 + 0, Pair("B", "Y") to 2 + 3, Pair("B", "Z") to 3 + 6, Pair("C", "X") to 1 + 6, Pair("C", "Y") to 2 + 0, Pair("C", "Z") to 3 + 3, ) return input.map { row -> row.split(" ") .let { scores.getValue(Pair(it[0], it[1])) } }.sum() } fun part2(input: List<String>): Int { val scores = mapOf( Pair("A", "X") to 3 + 0, Pair("A", "Y") to 1 + 3, Pair("A", "Z") to 2 + 6, Pair("B", "X") to 1 + 0, Pair("B", "Y") to 2 + 3, Pair("B", "Z") to 3 + 6, Pair("C", "X") to 2 + 0, Pair("C", "Y") to 3 + 3, Pair("C", "Z") to 1 + 6, ) return input.map { row -> row.split(" ") .let { scores.getValue(Pair(it[0], it[1])) } }.sum() } val input = readInput("Day02") println("Part 1: ${part1(input)}") println("Part 2: ${part2(input)}") } private fun readInput(name: String) = File("src", "$name.txt") .readLines()
[ { "class_path": "skarlman__AdventOfCode2022_kotlin__ef15752/Day02Kt.class", "javap": "Compiled from \"Day02.kt\"\npublic final class Day02Kt {\n public static final void main();\n Code:\n 0: ldc #8 // String Day02\n 2: invokestatic #12 // Method readInput:(Ljava/lang/String;)Ljava/util/List;\n 5: astore_0\n 6: new #14 // class java/lang/StringBuilder\n 9: dup\n 10: invokespecial #17 // Method java/lang/StringBuilder.\"<init>\":()V\n 13: ldc #19 // String Part 1:\n 15: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 18: aload_0\n 19: invokestatic #27 // Method main$part1:(Ljava/util/List;)I\n 22: invokevirtual #30 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 25: invokevirtual #34 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 28: getstatic #40 // Field java/lang/System.out:Ljava/io/PrintStream;\n 31: swap\n 32: invokevirtual #46 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 35: new #14 // class java/lang/StringBuilder\n 38: dup\n 39: invokespecial #17 // Method java/lang/StringBuilder.\"<init>\":()V\n 42: ldc #48 // String Part 2:\n 44: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 47: aload_0\n 48: invokestatic #51 // Method main$part2:(Ljava/util/List;)I\n 51: invokevirtual #30 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 54: invokevirtual #34 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 57: getstatic #40 // Field java/lang/System.out:Ljava/io/PrintStream;\n 60: swap\n 61: invokevirtual #46 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 64: return\n\n private static final java.util.List<java.lang.String> readInput(java.lang.String);\n Code:\n 0: new #56 // class java/io/File\n 3: dup\n 4: ldc #58 // String src\n 6: new #14 // class java/lang/StringBuilder\n 9: dup\n 10: invokespecial #17 // Method java/lang/StringBuilder.\"<init>\":()V\n 13: aload_0\n 14: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 17: ldc #60 // String .txt\n 19: invokevirtual #23 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: invokevirtual #34 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 25: invokespecial #63 // Method java/io/File.\"<init>\":(Ljava/lang/String;Ljava/lang/String;)V\n 28: aconst_null\n 29: iconst_1\n 30: aconst_null\n 31: invokestatic #69 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;\n 34: areturn\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #74 // Method main:()V\n 3: return\n\n private static final int main$part1(java.util.List<java.lang.String>);\n Code:\n 0: bipush 9\n 2: anewarray #79 // class kotlin/Pair\n 5: astore_2\n 6: aload_2\n 7: iconst_0\n 8: new #79 // class kotlin/Pair\n 11: dup\n 12: ldc #81 // String A\n 14: ldc #83 // String X\n 16: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 19: iconst_4\n 20: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 23: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 26: aastore\n 27: aload_2\n 28: iconst_1\n 29: new #79 // class kotlin/Pair\n 32: dup\n 33: ldc #81 // String A\n 35: ldc #100 // String Y\n 37: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 40: bipush 8\n 42: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 45: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 48: aastore\n 49: aload_2\n 50: iconst_2\n 51: new #79 // class kotlin/Pair\n 54: dup\n 55: ldc #81 // String A\n 57: ldc #102 // String Z\n 59: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 62: iconst_3\n 63: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 66: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 69: aastore\n 70: aload_2\n 71: iconst_3\n 72: new #79 // class kotlin/Pair\n 75: dup\n 76: ldc #104 // String B\n 78: ldc #83 // String X\n 80: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 83: iconst_1\n 84: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 87: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 90: aastore\n 91: aload_2\n 92: iconst_4\n 93: new #79 // class kotlin/Pair\n 96: dup\n 97: ldc #104 // String B\n 99: ldc #100 // String Y\n 101: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 104: iconst_5\n 105: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 108: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 111: aastore\n 112: aload_2\n 113: iconst_5\n 114: new #79 // class kotlin/Pair\n 117: dup\n 118: ldc #104 // String B\n 120: ldc #102 // String Z\n 122: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 125: bipush 9\n 127: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 130: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 133: aastore\n 134: aload_2\n 135: bipush 6\n 137: new #79 // class kotlin/Pair\n 140: dup\n 141: ldc #106 // String C\n 143: ldc #83 // String X\n 145: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 148: bipush 7\n 150: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 153: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 156: aastore\n 157: aload_2\n 158: bipush 7\n 160: new #79 // class kotlin/Pair\n 163: dup\n 164: ldc #106 // String C\n 166: ldc #100 // String Y\n 168: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 171: iconst_2\n 172: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 175: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 178: aastore\n 179: aload_2\n 180: bipush 8\n 182: new #79 // class kotlin/Pair\n 185: dup\n 186: ldc #106 // String C\n 188: ldc #102 // String Z\n 190: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 193: bipush 6\n 195: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 198: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 201: aastore\n 202: aload_2\n 203: invokestatic #112 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 206: astore_1\n 207: aload_0\n 208: checkcast #114 // class java/lang/Iterable\n 211: astore_2\n 212: iconst_0\n 213: istore_3\n 214: aload_2\n 215: astore 4\n 217: new #116 // class java/util/ArrayList\n 220: dup\n 221: aload_2\n 222: bipush 10\n 224: invokestatic #122 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 227: invokespecial #125 // Method java/util/ArrayList.\"<init>\":(I)V\n 230: checkcast #127 // class java/util/Collection\n 233: astore 5\n 235: iconst_0\n 236: istore 6\n 238: aload 4\n 240: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 245: astore 7\n 247: aload 7\n 249: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 254: ifeq 362\n 257: aload 7\n 259: invokeinterface #141, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 264: astore 8\n 266: aload 5\n 268: aload 8\n 270: checkcast #143 // class java/lang/String\n 273: astore 9\n 275: astore 14\n 277: iconst_0\n 278: istore 10\n 280: aload 9\n 282: checkcast #145 // class java/lang/CharSequence\n 285: iconst_1\n 286: anewarray #143 // class java/lang/String\n 289: astore 11\n 291: aload 11\n 293: iconst_0\n 294: ldc #147 // String\n 296: aastore\n 297: aload 11\n 299: iconst_0\n 300: iconst_0\n 301: bipush 6\n 303: aconst_null\n 304: invokestatic #153 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 307: astore 12\n 309: iconst_0\n 310: istore 13\n 312: aload_1\n 313: new #79 // class kotlin/Pair\n 316: dup\n 317: aload 12\n 319: iconst_0\n 320: invokeinterface #159, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 325: aload 12\n 327: iconst_1\n 328: invokeinterface #159, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 333: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 336: invokestatic #163 // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;\n 339: checkcast #165 // class java/lang/Number\n 342: invokevirtual #169 // Method java/lang/Number.intValue:()I\n 345: nop\n 346: nop\n 347: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 350: aload 14\n 352: swap\n 353: invokeinterface #173, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 358: pop\n 359: goto 247\n 362: aload 5\n 364: checkcast #155 // class java/util/List\n 367: nop\n 368: checkcast #114 // class java/lang/Iterable\n 371: invokestatic #177 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 374: ireturn\n\n private static final int main$part2(java.util.List<java.lang.String>);\n Code:\n 0: bipush 9\n 2: anewarray #79 // class kotlin/Pair\n 5: astore_2\n 6: aload_2\n 7: iconst_0\n 8: new #79 // class kotlin/Pair\n 11: dup\n 12: ldc #81 // String A\n 14: ldc #83 // String X\n 16: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 19: iconst_3\n 20: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 23: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 26: aastore\n 27: aload_2\n 28: iconst_1\n 29: new #79 // class kotlin/Pair\n 32: dup\n 33: ldc #81 // String A\n 35: ldc #100 // String Y\n 37: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 40: iconst_4\n 41: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 44: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 47: aastore\n 48: aload_2\n 49: iconst_2\n 50: new #79 // class kotlin/Pair\n 53: dup\n 54: ldc #81 // String A\n 56: ldc #102 // String Z\n 58: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 61: bipush 8\n 63: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 66: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 69: aastore\n 70: aload_2\n 71: iconst_3\n 72: new #79 // class kotlin/Pair\n 75: dup\n 76: ldc #104 // String B\n 78: ldc #83 // String X\n 80: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 83: iconst_1\n 84: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 87: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 90: aastore\n 91: aload_2\n 92: iconst_4\n 93: new #79 // class kotlin/Pair\n 96: dup\n 97: ldc #104 // String B\n 99: ldc #100 // String Y\n 101: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 104: iconst_5\n 105: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 108: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 111: aastore\n 112: aload_2\n 113: iconst_5\n 114: new #79 // class kotlin/Pair\n 117: dup\n 118: ldc #104 // String B\n 120: ldc #102 // String Z\n 122: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 125: bipush 9\n 127: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 130: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 133: aastore\n 134: aload_2\n 135: bipush 6\n 137: new #79 // class kotlin/Pair\n 140: dup\n 141: ldc #106 // String C\n 143: ldc #83 // String X\n 145: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 148: iconst_2\n 149: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 152: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 155: aastore\n 156: aload_2\n 157: bipush 7\n 159: new #79 // class kotlin/Pair\n 162: dup\n 163: ldc #106 // String C\n 165: ldc #100 // String Y\n 167: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 170: bipush 6\n 172: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 175: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 178: aastore\n 179: aload_2\n 180: bipush 8\n 182: new #79 // class kotlin/Pair\n 185: dup\n 186: ldc #106 // String C\n 188: ldc #102 // String Z\n 190: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 193: bipush 7\n 195: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 198: invokestatic #98 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 201: aastore\n 202: aload_2\n 203: invokestatic #112 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 206: astore_1\n 207: aload_0\n 208: checkcast #114 // class java/lang/Iterable\n 211: astore_2\n 212: iconst_0\n 213: istore_3\n 214: aload_2\n 215: astore 4\n 217: new #116 // class java/util/ArrayList\n 220: dup\n 221: aload_2\n 222: bipush 10\n 224: invokestatic #122 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 227: invokespecial #125 // Method java/util/ArrayList.\"<init>\":(I)V\n 230: checkcast #127 // class java/util/Collection\n 233: astore 5\n 235: iconst_0\n 236: istore 6\n 238: aload 4\n 240: invokeinterface #131, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 245: astore 7\n 247: aload 7\n 249: invokeinterface #137, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 254: ifeq 362\n 257: aload 7\n 259: invokeinterface #141, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 264: astore 8\n 266: aload 5\n 268: aload 8\n 270: checkcast #143 // class java/lang/String\n 273: astore 9\n 275: astore 14\n 277: iconst_0\n 278: istore 10\n 280: aload 9\n 282: checkcast #145 // class java/lang/CharSequence\n 285: iconst_1\n 286: anewarray #143 // class java/lang/String\n 289: astore 11\n 291: aload 11\n 293: iconst_0\n 294: ldc #147 // String\n 296: aastore\n 297: aload 11\n 299: iconst_0\n 300: iconst_0\n 301: bipush 6\n 303: aconst_null\n 304: invokestatic #153 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 307: astore 12\n 309: iconst_0\n 310: istore 13\n 312: aload_1\n 313: new #79 // class kotlin/Pair\n 316: dup\n 317: aload 12\n 319: iconst_0\n 320: invokeinterface #159, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 325: aload 12\n 327: iconst_1\n 328: invokeinterface #159, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 333: invokespecial #86 // Method kotlin/Pair.\"<init>\":(Ljava/lang/Object;Ljava/lang/Object;)V\n 336: invokestatic #163 // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;\n 339: checkcast #165 // class java/lang/Number\n 342: invokevirtual #169 // Method java/lang/Number.intValue:()I\n 345: nop\n 346: nop\n 347: invokestatic #92 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 350: aload 14\n 352: swap\n 353: invokeinterface #173, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 358: pop\n 359: goto 247\n 362: aload 5\n 364: checkcast #155 // class java/util/List\n 367: nop\n 368: checkcast #114 // class java/lang/Iterable\n 371: invokestatic #177 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 374: ireturn\n}\n", "javap_err": "" } ]
wenvelope__OnlineJudge__4a5b258/src/main/kotlin/QuickSort.kt
import java.util.* fun main() { val mutableList = arrayListOf(3,23,5435,2323,43,32,43) println(mutableList) println( mutableList.quickSort().let { mutableList }) } /** *快排 * 思想:分治 * 1.从大到小每一层都一分为二 分到不能再分为止 * 2.对于每一个小部分 都选定一个和标志位 使得标志位的左边都小于右边 */ fun MutableList<Int>.quickSort() { if (this.isEmpty()) { return } val stack = Stack<Int>() stack.push(0) stack.push(this.size - 1) while (stack.isNotEmpty()) { val highIndex = stack.pop() val lowIndex = stack.pop() if (lowIndex < highIndex) { val flagIndex = partition(mList = this, lowIndex = lowIndex, highIndex = highIndex) stack.push(lowIndex) stack.push(flagIndex - 1) stack.push(flagIndex + 1) stack.push(highIndex) } } } /** * 选取一个标志位 让列表中的左边小于标志位右边大于标志位 * * @return 标志位的索引 */ fun partition(mList: MutableList<Int>, lowIndex: Int, highIndex: Int): Int { val flag = mList[highIndex] //最后一个小于flag的元素的位置 初始为lowIndex-1 var theLowIndex = lowIndex - 1 for (index in lowIndex until highIndex){ if (mList[index]<flag){ mList.swap(theLowIndex+1,index) theLowIndex++ } } mList.swap(theLowIndex + 1, highIndex) return theLowIndex + 1 } /** * 交换两个索引对应元素的位置 */ fun MutableList<Int>.swap(index1: Int, index2: Int) { val temp = this[index1] set(index = index1, element = this[index2]) set(index = index2, element = temp) }
[ { "class_path": "wenvelope__OnlineJudge__4a5b258/QuickSortKt.class", "javap": "Compiled from \"QuickSort.kt\"\npublic final class QuickSortKt {\n public static final void main();\n Code:\n 0: bipush 7\n 2: anewarray #8 // class java/lang/Integer\n 5: astore_1\n 6: aload_1\n 7: iconst_0\n 8: iconst_3\n 9: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 12: aastore\n 13: aload_1\n 14: iconst_1\n 15: bipush 23\n 17: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 20: aastore\n 21: aload_1\n 22: iconst_2\n 23: sipush 5435\n 26: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 29: aastore\n 30: aload_1\n 31: iconst_3\n 32: sipush 2323\n 35: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 38: aastore\n 39: aload_1\n 40: iconst_4\n 41: bipush 43\n 43: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 46: aastore\n 47: aload_1\n 48: iconst_5\n 49: bipush 32\n 51: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 54: aastore\n 55: aload_1\n 56: bipush 6\n 58: bipush 43\n 60: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 63: aastore\n 64: aload_1\n 65: invokestatic #18 // Method kotlin/collections/CollectionsKt.arrayListOf:([Ljava/lang/Object;)Ljava/util/ArrayList;\n 68: astore_0\n 69: getstatic #24 // Field java/lang/System.out:Ljava/io/PrintStream;\n 72: aload_0\n 73: invokevirtual #30 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 76: aload_0\n 77: checkcast #32 // class java/util/List\n 80: invokestatic #36 // Method quickSort:(Ljava/util/List;)V\n 83: getstatic #42 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;\n 86: astore_2\n 87: iconst_0\n 88: istore_3\n 89: aload_0\n 90: astore_1\n 91: getstatic #24 // Field java/lang/System.out:Ljava/io/PrintStream;\n 94: aload_1\n 95: invokevirtual #30 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 98: return\n\n public static final void quickSort(java.util.List<java.lang.Integer>);\n Code:\n 0: aload_0\n 1: ldc #51 // String <this>\n 3: invokestatic #57 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: invokeinterface #61, 1 // InterfaceMethod java/util/List.isEmpty:()Z\n 12: ifeq 16\n 15: return\n 16: new #63 // class java/util/Stack\n 19: dup\n 20: invokespecial #66 // Method java/util/Stack.\"<init>\":()V\n 23: astore_1\n 24: aload_1\n 25: iconst_0\n 26: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 29: invokevirtual #70 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;\n 32: pop\n 33: aload_1\n 34: aload_0\n 35: invokeinterface #74, 1 // InterfaceMethod java/util/List.size:()I\n 40: iconst_1\n 41: isub\n 42: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 45: invokevirtual #70 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;\n 48: pop\n 49: aload_1\n 50: checkcast #76 // class java/util/Collection\n 53: invokeinterface #77, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 58: ifne 65\n 61: iconst_1\n 62: goto 66\n 65: iconst_0\n 66: ifeq 157\n 69: aload_1\n 70: invokevirtual #81 // Method java/util/Stack.pop:()Ljava/lang/Object;\n 73: checkcast #8 // class java/lang/Integer\n 76: astore_2\n 77: aload_1\n 78: invokevirtual #81 // Method java/util/Stack.pop:()Ljava/lang/Object;\n 81: checkcast #8 // class java/lang/Integer\n 84: astore_3\n 85: aload_3\n 86: invokevirtual #84 // Method java/lang/Integer.intValue:()I\n 89: aload_2\n 90: invokevirtual #84 // Method java/lang/Integer.intValue:()I\n 93: if_icmpge 49\n 96: aload_0\n 97: aload_3\n 98: invokestatic #87 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 101: aload_3\n 102: invokevirtual #84 // Method java/lang/Integer.intValue:()I\n 105: aload_2\n 106: invokestatic #87 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 109: aload_2\n 110: invokevirtual #84 // Method java/lang/Integer.intValue:()I\n 113: invokestatic #91 // Method partition:(Ljava/util/List;II)I\n 116: istore 4\n 118: aload_1\n 119: aload_3\n 120: invokevirtual #70 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;\n 123: pop\n 124: aload_1\n 125: iload 4\n 127: iconst_1\n 128: isub\n 129: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 132: invokevirtual #70 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;\n 135: pop\n 136: aload_1\n 137: iload 4\n 139: iconst_1\n 140: iadd\n 141: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 144: invokevirtual #70 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;\n 147: pop\n 148: aload_1\n 149: aload_2\n 150: invokevirtual #70 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;\n 153: pop\n 154: goto 49\n 157: return\n\n public static final int partition(java.util.List<java.lang.Integer>, int, int);\n Code:\n 0: aload_0\n 1: ldc #102 // String mList\n 3: invokestatic #57 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_2\n 8: invokeinterface #106, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #108 // class java/lang/Number\n 16: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 19: istore_3\n 20: iload_1\n 21: iconst_1\n 22: isub\n 23: istore 4\n 25: iload_1\n 26: istore 5\n 28: iload 5\n 30: iload_2\n 31: if_icmpge 71\n 34: aload_0\n 35: iload 5\n 37: invokeinterface #106, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 42: checkcast #108 // class java/lang/Number\n 45: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 48: iload_3\n 49: if_icmpge 65\n 52: aload_0\n 53: iload 4\n 55: iconst_1\n 56: iadd\n 57: iload 5\n 59: invokestatic #113 // Method swap:(Ljava/util/List;II)V\n 62: iinc 4, 1\n 65: iinc 5, 1\n 68: goto 28\n 71: aload_0\n 72: iload 4\n 74: iconst_1\n 75: iadd\n 76: iload_2\n 77: invokestatic #113 // Method swap:(Ljava/util/List;II)V\n 80: iload 4\n 82: iconst_1\n 83: iadd\n 84: ireturn\n\n public static final void swap(java.util.List<java.lang.Integer>, int, int);\n Code:\n 0: aload_0\n 1: ldc #51 // String <this>\n 3: invokestatic #57 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iload_1\n 8: invokeinterface #106, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #108 // class java/lang/Number\n 16: invokevirtual #109 // Method java/lang/Number.intValue:()I\n 19: istore_3\n 20: aload_0\n 21: iload_1\n 22: aload_0\n 23: iload_2\n 24: invokeinterface #106, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 29: invokeinterface #121, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 34: pop\n 35: aload_0\n 36: iload_2\n 37: iload_3\n 38: invokestatic #12 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 41: invokeinterface #121, 3 // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;\n 46: pop\n 47: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #128 // Method main:()V\n 3: return\n}\n", "javap_err": "" } ]
20Koen02__AdventOfCode__e260249/2021/08-kt/main.kt
import java.io.File import kotlin.collections.listOf typealias Entry = List<List<String>> val DIGS = listOf("abcdeg", "ab", "acdfg", "abcdf", "abef", "bcdef", "bcdefg", "abd", "abcdefg", "abcdef") fun readLines(): List<Entry> { return File("in.txt").bufferedReader().readLines().map { l -> l.split(" | ").map { it.split(" ") } } } fun String.permute(result: String = ""): List<String> = if (isEmpty()) listOf(result) else flatMapIndexed { i, c -> removeRange(i, i + 1).permute(result + c) } fun partOne(entry: Entry): Int { return entry[1].filter { x -> listOf(2, 3, 4, 7).contains(x.length) }.count() } fun getValidDigit(perm: String, dig: String): Int { // Check if the digit is valid var decoded = dig.map { perm[it - 'a'] }.sorted().joinToString("") return DIGS.indexOf(decoded) } fun tryPerm(perm: String, entry: Entry): Boolean { // Check if all signal patterns are valid digits var invalid = entry[0].map { getValidDigit(perm, it) }.any { it == -1 } return !invalid } fun partTwo(entry: Entry): Int { // Find correct permutation val perm = "abcdefg".permute().find { tryPerm(it, entry) } // Concat each digit return entry[1].map { getValidDigit(perm!!, it) }.joinToString(separator = "").toInt() } fun main() { println("Running...\n") val lines = readLines() val partOne = lines.map { partOne(it) }.sum() println("Day 8 part one: $partOne") val partTwo = lines.map { partTwo(it) }.sum() println("Day 8 part two: $partTwo") }
[ { "class_path": "20Koen02__AdventOfCode__e260249/MainKt.class", "javap": "Compiled from \"main.kt\"\npublic final class MainKt {\n private static final java.util.List<java.lang.String> DIGS;\n\n public static final java.util.List<java.lang.String> getDIGS();\n Code:\n 0: getstatic #12 // Field DIGS:Ljava/util/List;\n 3: areturn\n\n public static final java.util.List<java.util.List<java.util.List<java.lang.String>>> readLines();\n Code:\n 0: new #16 // class java/io/File\n 3: dup\n 4: ldc #18 // String in.txt\n 6: invokespecial #22 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 9: astore_0\n 10: getstatic #28 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 13: astore_1\n 14: sipush 8192\n 17: istore_2\n 18: aload_0\n 19: astore_3\n 20: new #30 // class java/io/InputStreamReader\n 23: dup\n 24: new #32 // class java/io/FileInputStream\n 27: dup\n 28: aload_3\n 29: invokespecial #35 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 32: checkcast #37 // class java/io/InputStream\n 35: aload_1\n 36: invokespecial #40 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 39: checkcast #42 // class java/io/Reader\n 42: astore_3\n 43: aload_3\n 44: instanceof #44 // class java/io/BufferedReader\n 47: ifeq 57\n 50: aload_3\n 51: checkcast #44 // class java/io/BufferedReader\n 54: goto 66\n 57: new #44 // class java/io/BufferedReader\n 60: dup\n 61: aload_3\n 62: iload_2\n 63: invokespecial #47 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 66: checkcast #42 // class java/io/Reader\n 69: invokestatic #52 // Method kotlin/io/TextStreamsKt.readLines:(Ljava/io/Reader;)Ljava/util/List;\n 72: checkcast #54 // class java/lang/Iterable\n 75: astore_0\n 76: iconst_0\n 77: istore_1\n 78: aload_0\n 79: astore_2\n 80: new #56 // class java/util/ArrayList\n 83: dup\n 84: aload_0\n 85: bipush 10\n 87: invokestatic #62 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 90: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 93: checkcast #67 // class java/util/Collection\n 96: astore_3\n 97: iconst_0\n 98: istore 4\n 100: aload_2\n 101: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 106: astore 5\n 108: aload 5\n 110: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 115: ifeq 301\n 118: aload 5\n 120: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 125: astore 6\n 127: aload_3\n 128: aload 6\n 130: checkcast #83 // class java/lang/String\n 133: astore 7\n 135: astore 20\n 137: iconst_0\n 138: istore 8\n 140: aload 7\n 142: checkcast #85 // class java/lang/CharSequence\n 145: iconst_1\n 146: anewarray #83 // class java/lang/String\n 149: astore 9\n 151: aload 9\n 153: iconst_0\n 154: ldc #87 // String |\n 156: aastore\n 157: aload 9\n 159: iconst_0\n 160: iconst_0\n 161: bipush 6\n 163: aconst_null\n 164: invokestatic #93 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 167: checkcast #54 // class java/lang/Iterable\n 170: astore 9\n 172: iconst_0\n 173: istore 10\n 175: aload 9\n 177: astore 11\n 179: new #56 // class java/util/ArrayList\n 182: dup\n 183: aload 9\n 185: bipush 10\n 187: invokestatic #62 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 190: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 193: checkcast #67 // class java/util/Collection\n 196: astore 12\n 198: iconst_0\n 199: istore 13\n 201: aload 11\n 203: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 208: astore 14\n 210: aload 14\n 212: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 217: ifeq 282\n 220: aload 14\n 222: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 227: astore 15\n 229: aload 12\n 231: aload 15\n 233: checkcast #83 // class java/lang/String\n 236: astore 16\n 238: astore 17\n 240: iconst_0\n 241: istore 18\n 243: aload 16\n 245: checkcast #85 // class java/lang/CharSequence\n 248: iconst_1\n 249: anewarray #83 // class java/lang/String\n 252: astore 19\n 254: aload 19\n 256: iconst_0\n 257: ldc #95 // String\n 259: aastore\n 260: aload 19\n 262: iconst_0\n 263: iconst_0\n 264: bipush 6\n 266: aconst_null\n 267: invokestatic #93 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;\n 270: aload 17\n 272: swap\n 273: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 278: pop\n 279: goto 210\n 282: aload 12\n 284: checkcast #101 // class java/util/List\n 287: nop\n 288: nop\n 289: aload 20\n 291: swap\n 292: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 297: pop\n 298: goto 108\n 301: aload_3\n 302: checkcast #101 // class java/util/List\n 305: nop\n 306: areturn\n\n public static final java.util.List<java.lang.String> permute(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #123 // String <this>\n 3: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #131 // String result\n 9: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_0\n 13: checkcast #85 // class java/lang/CharSequence\n 16: invokeinterface #135, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 21: ifne 28\n 24: iconst_1\n 25: goto 29\n 28: iconst_0\n 29: ifeq 39\n 32: aload_1\n 33: invokestatic #139 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;\n 36: goto 161\n 39: aload_0\n 40: checkcast #85 // class java/lang/CharSequence\n 43: astore_2\n 44: new #56 // class java/util/ArrayList\n 47: dup\n 48: invokespecial #142 // Method java/util/ArrayList.\"<init>\":()V\n 51: checkcast #67 // class java/util/Collection\n 54: astore_3\n 55: iconst_0\n 56: istore 4\n 58: iconst_0\n 59: istore 5\n 61: iload 5\n 63: aload_2\n 64: invokeinterface #135, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 69: if_icmpge 157\n 72: aload_2\n 73: iload 5\n 75: invokeinterface #146, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 80: istore 6\n 82: iload 4\n 84: iinc 4, 1\n 87: iload 6\n 89: istore 7\n 91: istore 8\n 93: iconst_0\n 94: istore 9\n 96: aload_0\n 97: astore 10\n 99: iload 8\n 101: iconst_1\n 102: iadd\n 103: istore 11\n 105: aload 10\n 107: checkcast #85 // class java/lang/CharSequence\n 110: iload 8\n 112: iload 11\n 114: invokestatic #150 // Method kotlin/text/StringsKt.removeRange:(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;\n 117: invokevirtual #154 // Method java/lang/Object.toString:()Ljava/lang/String;\n 120: new #156 // class java/lang/StringBuilder\n 123: dup\n 124: invokespecial #157 // Method java/lang/StringBuilder.\"<init>\":()V\n 127: aload_1\n 128: invokevirtual #161 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 131: iload 7\n 133: invokevirtual #164 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 136: invokevirtual #165 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 139: invokestatic #167 // Method permute:(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;\n 142: checkcast #54 // class java/lang/Iterable\n 145: aload_3\n 146: swap\n 147: invokestatic #171 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z\n 150: pop\n 151: iinc 5, 1\n 154: goto 61\n 157: aload_3\n 158: checkcast #101 // class java/util/List\n 161: areturn\n\n public static java.util.List permute$default(java.lang.String, java.lang.String, int, java.lang.Object);\n Code:\n 0: iload_2\n 1: iconst_1\n 2: iand\n 3: ifeq 9\n 6: ldc #180 // String\n 8: astore_1\n 9: aload_0\n 10: aload_1\n 11: invokestatic #167 // Method permute:(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;\n 14: areturn\n\n public static final int partOne(java.util.List<? extends java.util.List<java.lang.String>>);\n Code:\n 0: aload_0\n 1: ldc #185 // String entry\n 3: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: iconst_1\n 8: invokeinterface #189, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 13: checkcast #54 // class java/lang/Iterable\n 16: astore_1\n 17: iconst_0\n 18: istore_2\n 19: aload_1\n 20: astore_3\n 21: new #56 // class java/util/ArrayList\n 24: dup\n 25: invokespecial #142 // Method java/util/ArrayList.\"<init>\":()V\n 28: checkcast #67 // class java/util/Collection\n 31: astore 4\n 33: iconst_0\n 34: istore 5\n 36: aload_3\n 37: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 42: astore 6\n 44: aload 6\n 46: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 51: ifeq 146\n 54: aload 6\n 56: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 61: astore 7\n 63: aload 7\n 65: checkcast #83 // class java/lang/String\n 68: astore 8\n 70: iconst_0\n 71: istore 9\n 73: iconst_4\n 74: anewarray #191 // class java/lang/Integer\n 77: astore 10\n 79: aload 10\n 81: iconst_0\n 82: iconst_2\n 83: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 86: aastore\n 87: aload 10\n 89: iconst_1\n 90: iconst_3\n 91: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 94: aastore\n 95: aload 10\n 97: iconst_2\n 98: iconst_4\n 99: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 102: aastore\n 103: aload 10\n 105: iconst_3\n 106: bipush 7\n 108: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 111: aastore\n 112: aload 10\n 114: invokestatic #198 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 117: aload 8\n 119: invokevirtual #199 // Method java/lang/String.length:()I\n 122: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 125: invokeinterface #202, 2 // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z\n 130: ifeq 44\n 133: aload 4\n 135: aload 7\n 137: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 142: pop\n 143: goto 44\n 146: aload 4\n 148: checkcast #101 // class java/util/List\n 151: nop\n 152: checkcast #67 // class java/util/Collection\n 155: invokeinterface #205, 1 // InterfaceMethod java/util/Collection.size:()I\n 160: ireturn\n\n public static final int getValidDigit(java.lang.String, java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #216 // String perm\n 3: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #218 // String dig\n 9: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_1\n 13: checkcast #85 // class java/lang/CharSequence\n 16: astore_3\n 17: iconst_0\n 18: istore 4\n 20: aload_3\n 21: astore 5\n 23: new #56 // class java/util/ArrayList\n 26: dup\n 27: aload_3\n 28: invokeinterface #135, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 33: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 36: checkcast #67 // class java/util/Collection\n 39: astore 6\n 41: iconst_0\n 42: istore 7\n 44: iconst_0\n 45: istore 8\n 47: iload 8\n 49: aload 5\n 51: invokeinterface #135, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 56: if_icmpge 108\n 59: aload 5\n 61: iload 8\n 63: invokeinterface #146, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 68: istore 9\n 70: aload 6\n 72: iload 9\n 74: istore 10\n 76: astore 12\n 78: iconst_0\n 79: istore 11\n 81: aload_0\n 82: iload 10\n 84: bipush 97\n 86: isub\n 87: invokevirtual #219 // Method java/lang/String.charAt:(I)C\n 90: invokestatic #224 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;\n 93: aload 12\n 95: swap\n 96: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 101: pop\n 102: iinc 8, 1\n 105: goto 47\n 108: aload 6\n 110: checkcast #101 // class java/util/List\n 113: nop\n 114: checkcast #54 // class java/lang/Iterable\n 117: invokestatic #228 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;\n 120: checkcast #54 // class java/lang/Iterable\n 123: ldc #180 // String\n 125: checkcast #85 // class java/lang/CharSequence\n 128: aconst_null\n 129: aconst_null\n 130: iconst_0\n 131: aconst_null\n 132: aconst_null\n 133: bipush 62\n 135: aconst_null\n 136: invokestatic #232 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 139: astore_2\n 140: getstatic #12 // Field DIGS:Ljava/util/List;\n 143: aload_2\n 144: invokeinterface #236, 2 // InterfaceMethod java/util/List.indexOf:(Ljava/lang/Object;)I\n 149: ireturn\n\n public static final boolean tryPerm(java.lang.String, java.util.List<? extends java.util.List<java.lang.String>>);\n Code:\n 0: aload_0\n 1: ldc #216 // String perm\n 3: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_1\n 7: ldc #185 // String entry\n 9: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 12: aload_1\n 13: iconst_0\n 14: invokeinterface #189, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 19: checkcast #54 // class java/lang/Iterable\n 22: astore_3\n 23: iconst_0\n 24: istore 4\n 26: aload_3\n 27: astore 5\n 29: new #56 // class java/util/ArrayList\n 32: dup\n 33: aload_3\n 34: bipush 10\n 36: invokestatic #62 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 39: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 42: checkcast #67 // class java/util/Collection\n 45: astore 6\n 47: iconst_0\n 48: istore 7\n 50: aload 5\n 52: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 57: astore 8\n 59: aload 8\n 61: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 66: ifeq 113\n 69: aload 8\n 71: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 76: astore 9\n 78: aload 6\n 80: aload 9\n 82: checkcast #83 // class java/lang/String\n 85: astore 10\n 87: astore 12\n 89: iconst_0\n 90: istore 11\n 92: aload_0\n 93: aload 10\n 95: invokestatic #244 // Method getValidDigit:(Ljava/lang/String;Ljava/lang/String;)I\n 98: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 101: aload 12\n 103: swap\n 104: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 109: pop\n 110: goto 59\n 113: aload 6\n 115: checkcast #101 // class java/util/List\n 118: nop\n 119: checkcast #54 // class java/lang/Iterable\n 122: astore_3\n 123: nop\n 124: iconst_0\n 125: istore 4\n 127: aload_3\n 128: instanceof #67 // class java/util/Collection\n 131: ifeq 150\n 134: aload_3\n 135: checkcast #67 // class java/util/Collection\n 138: invokeinterface #247, 1 // InterfaceMethod java/util/Collection.isEmpty:()Z\n 143: ifeq 150\n 146: iconst_0\n 147: goto 209\n 150: aload_3\n 151: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 156: astore 5\n 158: aload 5\n 160: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 165: ifeq 208\n 168: aload 5\n 170: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 175: astore 6\n 177: aload 6\n 179: checkcast #249 // class java/lang/Number\n 182: invokevirtual #252 // Method java/lang/Number.intValue:()I\n 185: istore 7\n 187: iconst_0\n 188: istore 8\n 190: iload 7\n 192: iconst_m1\n 193: if_icmpne 200\n 196: iconst_1\n 197: goto 201\n 200: iconst_0\n 201: ifeq 158\n 204: iconst_1\n 205: goto 209\n 208: iconst_0\n 209: istore_2\n 210: iload_2\n 211: ifne 218\n 214: iconst_1\n 215: goto 219\n 218: iconst_0\n 219: ireturn\n\n public static final int partTwo(java.util.List<? extends java.util.List<java.lang.String>>);\n Code:\n 0: aload_0\n 1: ldc #185 // String entry\n 3: invokestatic #129 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: ldc_w #262 // String abcdefg\n 9: aconst_null\n 10: iconst_1\n 11: aconst_null\n 12: invokestatic #264 // Method permute$default:(Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/util/List;\n 15: checkcast #54 // class java/lang/Iterable\n 18: astore_3\n 19: aload_3\n 20: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 25: astore 4\n 27: aload 4\n 29: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 34: ifeq 70\n 37: aload 4\n 39: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 44: astore 5\n 46: aload 5\n 48: checkcast #83 // class java/lang/String\n 51: astore 6\n 53: iconst_0\n 54: istore 7\n 56: aload 6\n 58: aload_0\n 59: invokestatic #266 // Method tryPerm:(Ljava/lang/String;Ljava/util/List;)Z\n 62: ifeq 27\n 65: aload 5\n 67: goto 71\n 70: aconst_null\n 71: checkcast #83 // class java/lang/String\n 74: astore_1\n 75: aload_0\n 76: iconst_1\n 77: invokeinterface #189, 2 // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;\n 82: checkcast #54 // class java/lang/Iterable\n 85: astore_2\n 86: iconst_0\n 87: istore_3\n 88: aload_2\n 89: astore 4\n 91: new #56 // class java/util/ArrayList\n 94: dup\n 95: aload_2\n 96: bipush 10\n 98: invokestatic #62 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 101: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 104: checkcast #67 // class java/util/Collection\n 107: astore 5\n 109: iconst_0\n 110: istore 6\n 112: aload 4\n 114: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 119: astore 7\n 121: aload 7\n 123: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 128: ifeq 179\n 131: aload 7\n 133: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 138: astore 8\n 140: aload 5\n 142: aload 8\n 144: checkcast #83 // class java/lang/String\n 147: astore 9\n 149: astore 11\n 151: iconst_0\n 152: istore 10\n 154: aload_1\n 155: dup\n 156: invokestatic #270 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V\n 159: aload 9\n 161: invokestatic #244 // Method getValidDigit:(Ljava/lang/String;Ljava/lang/String;)I\n 164: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 167: aload 11\n 169: swap\n 170: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 175: pop\n 176: goto 121\n 179: aload 5\n 181: checkcast #101 // class java/util/List\n 184: nop\n 185: checkcast #54 // class java/lang/Iterable\n 188: ldc #180 // String\n 190: checkcast #85 // class java/lang/CharSequence\n 193: aconst_null\n 194: aconst_null\n 195: iconst_0\n 196: aconst_null\n 197: aconst_null\n 198: bipush 62\n 200: aconst_null\n 201: invokestatic #232 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;\n 204: invokestatic #274 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 207: ireturn\n\n public static final void main();\n Code:\n 0: ldc_w #279 // String Running...\\n\n 3: getstatic #285 // Field java/lang/System.out:Ljava/io/PrintStream;\n 6: swap\n 7: invokevirtual #290 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 10: invokestatic #292 // Method readLines:()Ljava/util/List;\n 13: astore_0\n 14: aload_0\n 15: checkcast #54 // class java/lang/Iterable\n 18: astore_2\n 19: iconst_0\n 20: istore_3\n 21: aload_2\n 22: astore 4\n 24: new #56 // class java/util/ArrayList\n 27: dup\n 28: aload_2\n 29: bipush 10\n 31: invokestatic #62 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 34: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 37: checkcast #67 // class java/util/Collection\n 40: astore 5\n 42: iconst_0\n 43: istore 6\n 45: aload 4\n 47: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 52: astore 7\n 54: aload 7\n 56: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 61: ifeq 107\n 64: aload 7\n 66: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 71: astore 8\n 73: aload 5\n 75: aload 8\n 77: checkcast #101 // class java/util/List\n 80: astore 9\n 82: astore 12\n 84: iconst_0\n 85: istore 10\n 87: aload 9\n 89: invokestatic #294 // Method partOne:(Ljava/util/List;)I\n 92: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 95: aload 12\n 97: swap\n 98: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 103: pop\n 104: goto 54\n 107: aload 5\n 109: checkcast #101 // class java/util/List\n 112: nop\n 113: checkcast #54 // class java/lang/Iterable\n 116: invokestatic #298 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 119: istore_1\n 120: new #156 // class java/lang/StringBuilder\n 123: dup\n 124: invokespecial #157 // Method java/lang/StringBuilder.\"<init>\":()V\n 127: ldc_w #300 // String Day 8 part one:\n 130: invokevirtual #161 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 133: iload_1\n 134: invokevirtual #303 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 137: invokevirtual #165 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 140: getstatic #285 // Field java/lang/System.out:Ljava/io/PrintStream;\n 143: swap\n 144: invokevirtual #290 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 147: aload_0\n 148: checkcast #54 // class java/lang/Iterable\n 151: astore_3\n 152: iconst_0\n 153: istore 4\n 155: aload_3\n 156: astore 5\n 158: new #56 // class java/util/ArrayList\n 161: dup\n 162: aload_3\n 163: bipush 10\n 165: invokestatic #62 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I\n 168: invokespecial #65 // Method java/util/ArrayList.\"<init>\":(I)V\n 171: checkcast #67 // class java/util/Collection\n 174: astore 6\n 176: iconst_0\n 177: istore 7\n 179: aload 5\n 181: invokeinterface #71, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 186: astore 8\n 188: aload 8\n 190: invokeinterface #77, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 195: ifeq 241\n 198: aload 8\n 200: invokeinterface #81, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 205: astore 9\n 207: aload 6\n 209: aload 9\n 211: checkcast #101 // class java/util/List\n 214: astore 10\n 216: astore 12\n 218: iconst_0\n 219: istore 11\n 221: aload 10\n 223: invokestatic #305 // Method partTwo:(Ljava/util/List;)I\n 226: invokestatic #195 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 229: aload 12\n 231: swap\n 232: invokeinterface #99, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 237: pop\n 238: goto 188\n 241: aload 6\n 243: checkcast #101 // class java/util/List\n 246: nop\n 247: checkcast #54 // class java/lang/Iterable\n 250: invokestatic #298 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 253: istore_2\n 254: new #156 // class java/lang/StringBuilder\n 257: dup\n 258: invokespecial #157 // Method java/lang/StringBuilder.\"<init>\":()V\n 261: ldc_w #307 // String Day 8 part two:\n 264: invokevirtual #161 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 267: iload_2\n 268: invokevirtual #303 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 271: invokevirtual #165 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 274: getstatic #285 // Field java/lang/System.out:Ljava/io/PrintStream;\n 277: swap\n 278: invokevirtual #290 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 281: return\n\n public static void main(java.lang.String[]);\n Code:\n 0: invokestatic #313 // Method main:()V\n 3: return\n\n static {};\n Code:\n 0: bipush 10\n 2: anewarray #83 // class java/lang/String\n 5: astore_0\n 6: aload_0\n 7: iconst_0\n 8: ldc_w #318 // String abcdeg\n 11: aastore\n 12: aload_0\n 13: iconst_1\n 14: ldc_w #320 // String ab\n 17: aastore\n 18: aload_0\n 19: iconst_2\n 20: ldc_w #322 // String acdfg\n 23: aastore\n 24: aload_0\n 25: iconst_3\n 26: ldc_w #324 // String abcdf\n 29: aastore\n 30: aload_0\n 31: iconst_4\n 32: ldc_w #326 // String abef\n 35: aastore\n 36: aload_0\n 37: iconst_5\n 38: ldc_w #328 // String bcdef\n 41: aastore\n 42: aload_0\n 43: bipush 6\n 45: ldc_w #330 // String bcdefg\n 48: aastore\n 49: aload_0\n 50: bipush 7\n 52: ldc_w #332 // String abd\n 55: aastore\n 56: aload_0\n 57: bipush 8\n 59: ldc_w #262 // String abcdefg\n 62: aastore\n 63: aload_0\n 64: bipush 9\n 66: ldc_w #334 // String abcdef\n 69: aastore\n 70: aload_0\n 71: invokestatic #198 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;\n 74: putstatic #12 // Field DIGS:Ljava/util/List;\n 77: return\n}\n", "javap_err": "" } ]
ummen-sherry__adventofcode2023__c91c1b6/src/main/kotlin/Day1.kt
import java.io.File private val numberRegex = Regex("""(\d|one|two|three|four|five|six|seven|eight|nine)""") private val numberReverseRegex = Regex("""(\d|enin|thgie|neves|xis|evif|ruof|eerht|owt|eno)""") private val validNumbers = mapOf( "1" to 1, "2" to 2, "3" to 3, "4" to 4, "5" to 5, "6" to 6, "7" to 7, "8" to 8, "9" to 9, "one" to 1, "two" to 2, "three" to 3, "four" to 4, "five" to 5, "six" to 6, "seven" to 7, "eight" to 8, "nine" to 9 ) fun sumOfCalibrationValues(input: List<String>): Int { return input.sumOf { "${it.first { it.isDigit() }}${it.last { it.isDigit() }}".toInt() } } fun readFile(fileName: String): List<String> { val resourceFile: File = File("src/main/resources/$fileName") // Adjust the path accordingly return resourceFile.bufferedReader().use { it.readLines() } } fun sumOfCalibrationValuesWithStringDigits(input: List<String>): Int { return input.mapNotNull { line -> validNumbers[numberRegex.find(line)?.value ?: ""] ?.let { firstDigit -> validNumbers[numberReverseRegex.find(line.reversed())?.value?.reversed() ?: ""] ?.let { secondDigit -> "$firstDigit$secondDigit".toInt() } } }.sum() } fun main(args: Array<String>) { println("Advent 2023 - Day1") // Part 1 // val input = readFile("day-1-input1.txt") // val sumOfCalibrationValues = sumOfCalibrationValues(input) // println("Sum: $sumOfCalibrationValues") // Part 2 val input = readFile("day-1-input2.txt") val sumOfCalibrationValues = sumOfCalibrationValuesWithStringDigits(input) println("Sum: $sumOfCalibrationValues") }
[ { "class_path": "ummen-sherry__adventofcode2023__c91c1b6/Day1Kt.class", "javap": "Compiled from \"Day1.kt\"\npublic final class Day1Kt {\n private static final kotlin.text.Regex numberRegex;\n\n private static final kotlin.text.Regex numberReverseRegex;\n\n private static final java.util.Map<java.lang.String, java.lang.Integer> validNumbers;\n\n public static final int sumOfCalibrationValues(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #10 // String input\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #18 // class java/lang/Iterable\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: invokeinterface #22, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 19: astore_3\n 20: aload_3\n 21: invokeinterface #28, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 26: ifeq 252\n 29: aload_3\n 30: invokeinterface #32, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 35: astore 4\n 37: iload_2\n 38: aload 4\n 40: checkcast #34 // class java/lang/String\n 43: astore 5\n 45: istore 16\n 47: iconst_0\n 48: istore 6\n 50: new #36 // class java/lang/StringBuilder\n 53: dup\n 54: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 57: aload 5\n 59: checkcast #42 // class java/lang/CharSequence\n 62: astore 7\n 64: astore 8\n 66: iconst_0\n 67: istore 9\n 69: iconst_0\n 70: istore 10\n 72: iload 10\n 74: aload 7\n 76: invokeinterface #46, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 81: if_icmpge 122\n 84: aload 7\n 86: iload 10\n 88: invokeinterface #50, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 93: istore 11\n 95: iload 11\n 97: istore 12\n 99: iconst_0\n 100: istore 13\n 102: iload 12\n 104: invokestatic #56 // Method java/lang/Character.isDigit:(C)Z\n 107: nop\n 108: ifeq 116\n 111: iload 11\n 113: goto 132\n 116: iinc 10, 1\n 119: goto 72\n 122: new #58 // class java/util/NoSuchElementException\n 125: dup\n 126: ldc #60 // String Char sequence contains no character matching the predicate.\n 128: invokespecial #63 // Method java/util/NoSuchElementException.\"<init>\":(Ljava/lang/String;)V\n 131: athrow\n 132: istore 14\n 134: aload 8\n 136: iload 14\n 138: invokevirtual #67 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 141: aload 5\n 143: checkcast #42 // class java/lang/CharSequence\n 146: astore 7\n 148: astore 8\n 150: iconst_0\n 151: istore 9\n 153: aload 7\n 155: invokeinterface #46, 1 // InterfaceMethod java/lang/CharSequence.length:()I\n 160: iconst_m1\n 161: iadd\n 162: istore 10\n 164: iconst_0\n 165: iload 10\n 167: if_icmpgt 215\n 170: iload 10\n 172: istore 11\n 174: iinc 10, -1\n 177: aload 7\n 179: iload 11\n 181: invokeinterface #50, 2 // InterfaceMethod java/lang/CharSequence.charAt:(I)C\n 186: istore 12\n 188: iload 12\n 190: istore 13\n 192: iconst_0\n 193: istore 15\n 195: iload 13\n 197: invokestatic #56 // Method java/lang/Character.isDigit:(C)Z\n 200: nop\n 201: ifeq 209\n 204: iload 12\n 206: goto 225\n 209: iconst_0\n 210: iload 10\n 212: if_icmple 170\n 215: new #58 // class java/util/NoSuchElementException\n 218: dup\n 219: ldc #60 // String Char sequence contains no character matching the predicate.\n 221: invokespecial #63 // Method java/util/NoSuchElementException.\"<init>\":(Ljava/lang/String;)V\n 224: athrow\n 225: istore 14\n 227: aload 8\n 229: iload 14\n 231: invokevirtual #67 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;\n 234: invokevirtual #71 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 237: invokestatic #77 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 240: nop\n 241: istore 17\n 243: iload 16\n 245: iload 17\n 247: iadd\n 248: istore_2\n 249: goto 20\n 252: iload_2\n 253: ireturn\n\n public static final java.util.List<java.lang.String> readFile(java.lang.String);\n Code:\n 0: aload_0\n 1: ldc #101 // String fileName\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: new #103 // class java/io/File\n 9: dup\n 10: new #36 // class java/lang/StringBuilder\n 13: dup\n 14: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 17: ldc #105 // String src/main/resources/\n 19: invokevirtual #108 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 22: aload_0\n 23: invokevirtual #108 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 26: invokevirtual #71 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 29: invokespecial #109 // Method java/io/File.\"<init>\":(Ljava/lang/String;)V\n 32: astore_1\n 33: aload_1\n 34: astore_2\n 35: getstatic #115 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;\n 38: astore_3\n 39: sipush 8192\n 42: istore 4\n 44: aload_2\n 45: astore 5\n 47: new #117 // class java/io/InputStreamReader\n 50: dup\n 51: new #119 // class java/io/FileInputStream\n 54: dup\n 55: aload 5\n 57: invokespecial #122 // Method java/io/FileInputStream.\"<init>\":(Ljava/io/File;)V\n 60: checkcast #124 // class java/io/InputStream\n 63: aload_3\n 64: invokespecial #127 // Method java/io/InputStreamReader.\"<init>\":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V\n 67: checkcast #129 // class java/io/Reader\n 70: astore 5\n 72: aload 5\n 74: instanceof #131 // class java/io/BufferedReader\n 77: ifeq 88\n 80: aload 5\n 82: checkcast #131 // class java/io/BufferedReader\n 85: goto 99\n 88: new #131 // class java/io/BufferedReader\n 91: dup\n 92: aload 5\n 94: iload 4\n 96: invokespecial #134 // Method java/io/BufferedReader.\"<init>\":(Ljava/io/Reader;I)V\n 99: checkcast #136 // class java/io/Closeable\n 102: astore_2\n 103: aconst_null\n 104: astore_3\n 105: nop\n 106: aload_2\n 107: checkcast #131 // class java/io/BufferedReader\n 110: astore 4\n 112: iconst_0\n 113: istore 5\n 115: aload 4\n 117: checkcast #129 // class java/io/Reader\n 120: invokestatic #142 // Method kotlin/io/TextStreamsKt.readLines:(Ljava/io/Reader;)Ljava/util/List;\n 123: astore 4\n 125: aload_2\n 126: aload_3\n 127: invokestatic #148 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 130: aload 4\n 132: goto 153\n 135: astore 5\n 137: aload 5\n 139: astore_3\n 140: aload 5\n 142: athrow\n 143: astore 5\n 145: aload_2\n 146: aload_3\n 147: invokestatic #148 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V\n 150: aload 5\n 152: athrow\n 153: areturn\n Exception table:\n from to target type\n 105 125 135 Class java/lang/Throwable\n 105 125 143 any\n 135 143 143 any\n 143 145 143 any\n\n public static final int sumOfCalibrationValuesWithStringDigits(java.util.List<java.lang.String>);\n Code:\n 0: aload_0\n 1: ldc #10 // String input\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: aload_0\n 7: checkcast #18 // class java/lang/Iterable\n 10: astore_1\n 11: iconst_0\n 12: istore_2\n 13: aload_1\n 14: astore_3\n 15: new #157 // class java/util/ArrayList\n 18: dup\n 19: invokespecial #158 // Method java/util/ArrayList.\"<init>\":()V\n 22: checkcast #160 // class java/util/Collection\n 25: astore 4\n 27: iconst_0\n 28: istore 5\n 30: aload_3\n 31: astore 6\n 33: iconst_0\n 34: istore 7\n 36: aload 6\n 38: invokeinterface #22, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;\n 43: astore 8\n 45: aload 8\n 47: invokeinterface #28, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z\n 52: ifeq 289\n 55: aload 8\n 57: invokeinterface #32, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;\n 62: astore 9\n 64: aload 9\n 66: astore 10\n 68: iconst_0\n 69: istore 11\n 71: aload 10\n 73: checkcast #34 // class java/lang/String\n 76: astore 12\n 78: iconst_0\n 79: istore 13\n 81: getstatic #164 // Field validNumbers:Ljava/util/Map;\n 84: getstatic #168 // Field numberRegex:Lkotlin/text/Regex;\n 87: aload 12\n 89: checkcast #42 // class java/lang/CharSequence\n 92: iconst_0\n 93: iconst_2\n 94: aconst_null\n 95: invokestatic #174 // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;\n 98: dup\n 99: ifnull 111\n 102: invokeinterface #179, 1 // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;\n 107: dup\n 108: ifnonnull 114\n 111: pop\n 112: ldc #181 // String\n 114: invokeinterface #187, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 119: checkcast #73 // class java/lang/Integer\n 122: astore 14\n 124: aload 14\n 126: ifnull 260\n 129: aload 14\n 131: checkcast #189 // class java/lang/Number\n 134: invokevirtual #192 // Method java/lang/Number.intValue:()I\n 137: istore 15\n 139: iconst_0\n 140: istore 16\n 142: getstatic #164 // Field validNumbers:Ljava/util/Map;\n 145: getstatic #195 // Field numberReverseRegex:Lkotlin/text/Regex;\n 148: aload 12\n 150: checkcast #42 // class java/lang/CharSequence\n 153: invokestatic #201 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 156: invokevirtual #202 // Method java/lang/Object.toString:()Ljava/lang/String;\n 159: checkcast #42 // class java/lang/CharSequence\n 162: iconst_0\n 163: iconst_2\n 164: aconst_null\n 165: invokestatic #174 // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;\n 168: dup\n 169: ifnull 194\n 172: invokeinterface #179, 1 // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;\n 177: dup\n 178: ifnull 194\n 181: checkcast #42 // class java/lang/CharSequence\n 184: invokestatic #201 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;\n 187: invokevirtual #202 // Method java/lang/Object.toString:()Ljava/lang/String;\n 190: dup\n 191: ifnonnull 197\n 194: pop\n 195: ldc #181 // String\n 197: invokeinterface #187, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;\n 202: checkcast #73 // class java/lang/Integer\n 205: astore 17\n 207: aload 17\n 209: ifnull 255\n 212: aload 17\n 214: checkcast #189 // class java/lang/Number\n 217: invokevirtual #192 // Method java/lang/Number.intValue:()I\n 220: istore 18\n 222: iconst_0\n 223: istore 19\n 225: new #36 // class java/lang/StringBuilder\n 228: dup\n 229: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 232: iload 15\n 234: invokevirtual #205 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 237: iload 18\n 239: invokevirtual #205 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 242: invokevirtual #71 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 245: invokestatic #77 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I\n 248: nop\n 249: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 252: goto 256\n 255: aconst_null\n 256: nop\n 257: goto 261\n 260: aconst_null\n 261: nop\n 262: dup\n 263: ifnull 284\n 266: astore 20\n 268: iconst_0\n 269: istore 21\n 271: aload 4\n 273: aload 20\n 275: invokeinterface #213, 2 // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z\n 280: pop\n 281: goto 285\n 284: pop\n 285: nop\n 286: goto 45\n 289: nop\n 290: aload 4\n 292: checkcast #94 // class java/util/List\n 295: nop\n 296: checkcast #18 // class java/lang/Iterable\n 299: invokestatic #219 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I\n 302: ireturn\n\n public static final void main(java.lang.String[]);\n Code:\n 0: aload_0\n 1: ldc #244 // String args\n 3: invokestatic #16 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V\n 6: ldc #246 // String Advent 2023 - Day1\n 8: getstatic #252 // Field java/lang/System.out:Ljava/io/PrintStream;\n 11: swap\n 12: invokevirtual #258 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 15: ldc_w #260 // String day-1-input2.txt\n 18: invokestatic #262 // Method readFile:(Ljava/lang/String;)Ljava/util/List;\n 21: astore_1\n 22: aload_1\n 23: invokestatic #264 // Method sumOfCalibrationValuesWithStringDigits:(Ljava/util/List;)I\n 26: istore_2\n 27: new #36 // class java/lang/StringBuilder\n 30: dup\n 31: invokespecial #40 // Method java/lang/StringBuilder.\"<init>\":()V\n 34: ldc_w #266 // String Sum:\n 37: invokevirtual #108 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n 40: iload_2\n 41: invokevirtual #205 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n 44: invokevirtual #71 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;\n 47: getstatic #252 // Field java/lang/System.out:Ljava/io/PrintStream;\n 50: swap\n 51: invokevirtual #258 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V\n 54: return\n\n static {};\n Code:\n 0: new #170 // class kotlin/text/Regex\n 3: dup\n 4: ldc_w #270 // String (\\\\d|one|two|three|four|five|six|seven|eight|nine)\n 7: invokespecial #271 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 10: putstatic #168 // Field numberRegex:Lkotlin/text/Regex;\n 13: new #170 // class kotlin/text/Regex\n 16: dup\n 17: ldc_w #273 // String (\\\\d|enin|thgie|neves|xis|evif|ruof|eerht|owt|eno)\n 20: invokespecial #271 // Method kotlin/text/Regex.\"<init>\":(Ljava/lang/String;)V\n 23: putstatic #195 // Field numberReverseRegex:Lkotlin/text/Regex;\n 26: bipush 18\n 28: anewarray #275 // class kotlin/Pair\n 31: astore_0\n 32: aload_0\n 33: iconst_0\n 34: ldc_w #277 // String 1\n 37: iconst_1\n 38: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 41: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 44: aastore\n 45: aload_0\n 46: iconst_1\n 47: ldc_w #285 // String 2\n 50: iconst_2\n 51: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 54: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 57: aastore\n 58: aload_0\n 59: iconst_2\n 60: ldc_w #287 // String 3\n 63: iconst_3\n 64: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 67: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 70: aastore\n 71: aload_0\n 72: iconst_3\n 73: ldc_w #289 // String 4\n 76: iconst_4\n 77: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 80: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 83: aastore\n 84: aload_0\n 85: iconst_4\n 86: ldc_w #291 // String 5\n 89: iconst_5\n 90: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 93: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 96: aastore\n 97: aload_0\n 98: iconst_5\n 99: ldc_w #293 // String 6\n 102: bipush 6\n 104: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 107: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 110: aastore\n 111: aload_0\n 112: bipush 6\n 114: ldc_w #295 // String 7\n 117: bipush 7\n 119: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 122: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 125: aastore\n 126: aload_0\n 127: bipush 7\n 129: ldc_w #297 // String 8\n 132: bipush 8\n 134: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 137: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 140: aastore\n 141: aload_0\n 142: bipush 8\n 144: ldc_w #299 // String 9\n 147: bipush 9\n 149: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 152: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 155: aastore\n 156: aload_0\n 157: bipush 9\n 159: ldc_w #301 // String one\n 162: iconst_1\n 163: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 166: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 169: aastore\n 170: aload_0\n 171: bipush 10\n 173: ldc_w #303 // String two\n 176: iconst_2\n 177: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 180: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 183: aastore\n 184: aload_0\n 185: bipush 11\n 187: ldc_w #305 // String three\n 190: iconst_3\n 191: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 194: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 197: aastore\n 198: aload_0\n 199: bipush 12\n 201: ldc_w #307 // String four\n 204: iconst_4\n 205: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 208: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 211: aastore\n 212: aload_0\n 213: bipush 13\n 215: ldc_w #309 // String five\n 218: iconst_5\n 219: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 222: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 225: aastore\n 226: aload_0\n 227: bipush 14\n 229: ldc_w #311 // String six\n 232: bipush 6\n 234: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 237: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 240: aastore\n 241: aload_0\n 242: bipush 15\n 244: ldc_w #313 // String seven\n 247: bipush 7\n 249: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 252: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 255: aastore\n 256: aload_0\n 257: bipush 16\n 259: ldc_w #315 // String eight\n 262: bipush 8\n 264: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 267: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 270: aastore\n 271: aload_0\n 272: bipush 17\n 274: ldc_w #317 // String nine\n 277: bipush 9\n 279: invokestatic #209 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;\n 282: invokestatic #283 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;\n 285: aastore\n 286: aload_0\n 287: invokestatic #323 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;\n 290: putstatic #164 // Field validNumbers:Ljava/util/Map;\n 293: return\n}\n", "javap_err": "" } ]