package day06

import java.io.File
import kotlin.math.ceil
import kotlin.math.floor
import kotlin.math.sqrt

fun main() {
    val data = parse("src/day06/Day06.txt")

    println("🎄 Day 06 🎄")

    println()

    println("[Part 1]")
    println("Answer: ${part1(data)}")

    println()

    println("[Part 2]")
    println("Answer: ${part2(data)}")
}

private data class Race(
    val time: Long,
    val distance: Long,
)

private fun parse(path: String): Pair<List<String>, List<String>> =
    File(path)
        .readLines()
        .map { it.split("\\s+".toRegex()).drop(1).map(String::trim) }
        .let { (ts, ds) -> ts to ds }

private fun solve(data: List<Race>): Long =
    data.fold(1) { acc, (t, d) ->
        val x1 = floor((t - sqrt(t * t - 4.0 * d)) / 2.0 + 1.0).toInt()
        val x2 = ceil((t + sqrt(t * t - 4.0 * d)) / 2.0 - 1.0).toInt()
        acc * (x2 - x1 + 1)
    }

private fun part1(data: Pair<List<String>, List<String>>): Long =
    data.let { (ts, ds) -> ts.map(String::toLong) to ds.map(String::toLong) }
        .let { (ts, ds) -> ts.zip(ds) { t, d -> Race(t, d) } }
        .let { solve(it) }

private fun part2(data: Pair<List<String>, List<String>>): Long =
    data.let { (ts, ds) -> ts.joinToString("") to ds.joinToString("") }
        .let { (ts, ds) -> Race(ts.toLong(), ds.toLong()) }
        .let { solve(listOf(it)) }

Compiled from "Day06.kt"
public final class day06.Day06Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String src/day06/Day06.txt
       2: invokestatic  #12                 // Method parse:(Ljava/lang/String;)Lkotlin/Pair;
       5: astore_0
       6: ldc           #14                 // String 🎄 Day 06 🎄
       8: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      18: invokevirtual #28                 // Method java/io/PrintStream.println:()V
      21: ldc           #30                 // String [Part 1]
      23: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: swap
      27: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      30: new           #32                 // class java/lang/StringBuilder
      33: dup
      34: invokespecial #35                 // Method java/lang/StringBuilder."<init>":()V
      37: ldc           #37                 // String Answer:
      39: invokevirtual #41                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      42: aload_0
      43: invokestatic  #45                 // Method part1:(Lkotlin/Pair;)J
      46: invokevirtual #48                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      49: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      52: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      55: swap
      56: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      59: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      62: invokevirtual #28                 // Method java/io/PrintStream.println:()V
      65: ldc           #54                 // String [Part 2]
      67: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      70: swap
      71: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      74: new           #32                 // class java/lang/StringBuilder
      77: dup
      78: invokespecial #35                 // Method java/lang/StringBuilder."<init>":()V
      81: ldc           #37                 // String Answer:
      83: invokevirtual #41                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      86: aload_0
      87: invokestatic  #57                 // Method part2:(Lkotlin/Pair;)J
      90: invokevirtual #48                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      93: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      96: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      99: swap
     100: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     103: return

  private static final kotlin.Pair<java.util.List<java.lang.String>, java.util.List<java.lang.String>> parse(java.lang.String);
    Code:
       0: new           #62                 // class java/io/File
       3: dup
       4: aload_0
       5: invokespecial #65                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       8: aconst_null
       9: iconst_1
      10: aconst_null
      11: invokestatic  #71                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      14: checkcast     #73                 // class java/lang/Iterable
      17: astore_1
      18: nop
      19: iconst_0
      20: istore_2
      21: aload_1
      22: astore_3
      23: new           #75                 // class java/util/ArrayList
      26: dup
      27: aload_1
      28: bipush        10
      30: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      33: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      36: checkcast     #86                 // class java/util/Collection
      39: astore        4
      41: iconst_0
      42: istore        5
      44: aload_3
      45: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        6
      52: aload         6
      54: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          241
      62: aload         6
      64: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        7
      71: aload         4
      73: aload         7
      75: checkcast     #102                // class java/lang/String
      78: astore        8
      80: astore        20
      82: iconst_0
      83: istore        9
      85: aload         8
      87: checkcast     #104                // class java/lang/CharSequence
      90: astore        10
      92: new           #106                // class kotlin/text/Regex
      95: dup
      96: ldc           #108                // String \\s+
      98: invokespecial #109                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     101: astore        11
     103: iconst_0
     104: istore        12
     106: aload         11
     108: aload         10
     110: iload         12
     112: invokevirtual #113                // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
     115: checkcast     #73                 // class java/lang/Iterable
     118: iconst_1
     119: invokestatic  #117                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     122: checkcast     #73                 // class java/lang/Iterable
     125: astore        10
     127: iconst_0
     128: istore        11
     130: aload         10
     132: astore        12
     134: new           #75                 // class java/util/ArrayList
     137: dup
     138: aload         10
     140: bipush        10
     142: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     145: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     148: checkcast     #86                 // class java/util/Collection
     151: astore        13
     153: iconst_0
     154: istore        14
     156: aload         12
     158: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     163: astore        15
     165: aload         15
     167: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     172: ifeq          222
     175: aload         15
     177: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     182: astore        16
     184: aload         13
     186: aload         16
     188: checkcast     #102                // class java/lang/String
     191: astore        17
     193: astore        18
     195: iconst_0
     196: istore        19
     198: aload         17
     200: checkcast     #104                // class java/lang/CharSequence
     203: invokestatic  #123                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     206: invokevirtual #124                // Method java/lang/Object.toString:()Ljava/lang/String;
     209: nop
     210: aload         18
     212: swap
     213: invokeinterface #128,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     218: pop
     219: goto          165
     222: aload         13
     224: checkcast     #130                // class java/util/List
     227: nop
     228: nop
     229: aload         20
     231: swap
     232: invokeinterface #128,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     237: pop
     238: goto          52
     241: aload         4
     243: checkcast     #130                // class java/util/List
     246: nop
     247: astore_2
     248: iconst_0
     249: istore_3
     250: aload_2
     251: iconst_0
     252: invokeinterface #134,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     257: checkcast     #130                // class java/util/List
     260: astore        4
     262: aload_2
     263: iconst_1
     264: invokeinterface #134,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     269: checkcast     #130                // class java/util/List
     272: astore        5
     274: aload         4
     276: aload         5
     278: invokestatic  #140                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     281: nop
     282: areturn

  private static final long solve(java.util.List<day06.Race>);
    Code:
       0: aload_0
       1: checkcast     #73                 // class java/lang/Iterable
       4: astore_1
       5: lconst_1
       6: lstore_2
       7: iconst_0
       8: istore        4
      10: lload_2
      11: lstore        5
      13: aload_1
      14: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      19: astore        7
      21: aload         7
      23: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      28: ifeq          150
      31: aload         7
      33: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      38: astore        8
      40: lload         5
      42: aload         8
      44: checkcast     #165                // class day06/Race
      47: astore        9
      49: lstore        10
      51: iconst_0
      52: istore        12
      54: aload         9
      56: invokevirtual #169                // Method day06/Race.component1:()J
      59: lstore        13
      61: aload         9
      63: invokevirtual #172                // Method day06/Race.component2:()J
      66: lstore        15
      68: lload         13
      70: l2d
      71: lload         13
      73: lload         13
      75: lmul
      76: l2d
      77: ldc2_w        #173                // double 4.0d
      80: lload         15
      82: l2d
      83: dmul
      84: dsub
      85: invokestatic  #180                // Method java/lang/Math.sqrt:(D)D
      88: dsub
      89: ldc2_w        #181                // double 2.0d
      92: ddiv
      93: dconst_1
      94: dadd
      95: invokestatic  #185                // Method java/lang/Math.floor:(D)D
      98: d2i
      99: istore        17
     101: lload         13
     103: l2d
     104: lload         13
     106: lload         13
     108: lmul
     109: l2d
     110: ldc2_w        #173                // double 4.0d
     113: lload         15
     115: l2d
     116: dmul
     117: dsub
     118: invokestatic  #180                // Method java/lang/Math.sqrt:(D)D
     121: dadd
     122: ldc2_w        #181                // double 2.0d
     125: ddiv
     126: dconst_1
     127: dsub
     128: invokestatic  #188                // Method java/lang/Math.ceil:(D)D
     131: d2i
     132: istore        18
     134: lload         10
     136: iload         18
     138: iload         17
     140: isub
     141: iconst_1
     142: iadd
     143: i2l
     144: lmul
     145: lstore        5
     147: goto          21
     150: lload         5
     152: lreturn

  private static final long part1(kotlin.Pair<? extends java.util.List<java.lang.String>, ? extends java.util.List<java.lang.String>>);
    Code:
       0: aload_0
       1: astore_1
       2: iconst_0
       3: istore_2
       4: aload_1
       5: invokevirtual #205                // Method kotlin/Pair.component1:()Ljava/lang/Object;
       8: checkcast     #130                // class java/util/List
      11: astore_3
      12: aload_1
      13: invokevirtual #207                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      16: checkcast     #130                // class java/util/List
      19: astore        4
      21: aload_3
      22: checkcast     #73                 // class java/lang/Iterable
      25: astore        5
      27: iconst_0
      28: istore        6
      30: aload         5
      32: astore        7
      34: new           #75                 // class java/util/ArrayList
      37: dup
      38: aload         5
      40: bipush        10
      42: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      45: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      48: checkcast     #86                 // class java/util/Collection
      51: astore        8
      53: iconst_0
      54: istore        9
      56: aload         7
      58: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      63: astore        10
      65: aload         10
      67: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      72: ifeq          119
      75: aload         10
      77: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      82: astore        11
      84: aload         8
      86: aload         11
      88: checkcast     #102                // class java/lang/String
      91: astore        12
      93: astore        13
      95: iconst_0
      96: istore        14
      98: aload         12
     100: invokestatic  #213                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     103: nop
     104: invokestatic  #217                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     107: aload         13
     109: swap
     110: invokeinterface #128,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     115: pop
     116: goto          65
     119: aload         8
     121: checkcast     #130                // class java/util/List
     124: nop
     125: aload         4
     127: checkcast     #73                 // class java/lang/Iterable
     130: astore        5
     132: astore        13
     134: iconst_0
     135: istore        6
     137: aload         5
     139: astore        7
     141: new           #75                 // class java/util/ArrayList
     144: dup
     145: aload         5
     147: bipush        10
     149: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     152: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     155: checkcast     #86                 // class java/util/Collection
     158: astore        8
     160: iconst_0
     161: istore        9
     163: aload         7
     165: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     170: astore        10
     172: aload         10
     174: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     179: ifeq          226
     182: aload         10
     184: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     189: astore        11
     191: aload         8
     193: aload         11
     195: checkcast     #102                // class java/lang/String
     198: astore        12
     200: astore        15
     202: iconst_0
     203: istore        14
     205: aload         12
     207: invokestatic  #213                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     210: nop
     211: invokestatic  #217                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     214: aload         15
     216: swap
     217: invokeinterface #128,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     222: pop
     223: goto          172
     226: aload         8
     228: checkcast     #130                // class java/util/List
     231: nop
     232: aload         13
     234: swap
     235: invokestatic  #140                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     238: nop
     239: astore_1
     240: iconst_0
     241: istore_2
     242: aload_1
     243: invokevirtual #205                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     246: checkcast     #130                // class java/util/List
     249: astore_3
     250: aload_1
     251: invokevirtual #207                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     254: checkcast     #130                // class java/util/List
     257: astore        4
     259: aload_3
     260: checkcast     #73                 // class java/lang/Iterable
     263: astore        5
     265: iconst_0
     266: istore        6
     268: aload         5
     270: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     275: astore        7
     277: aload         4
     279: checkcast     #73                 // class java/lang/Iterable
     282: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     287: astore        8
     289: new           #75                 // class java/util/ArrayList
     292: dup
     293: aload         5
     295: bipush        10
     297: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     300: aload         4
     302: checkcast     #73                 // class java/lang/Iterable
     305: bipush        10
     307: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     310: invokestatic  #221                // Method java/lang/Math.min:(II)I
     313: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     316: astore        9
     318: aload         7
     320: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     325: ifeq          396
     328: aload         8
     330: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     335: ifeq          396
     338: aload         9
     340: aload         7
     342: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     347: aload         8
     349: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     354: checkcast     #223                // class java/lang/Number
     357: invokevirtual #226                // Method java/lang/Number.longValue:()J
     360: lstore        10
     362: checkcast     #223                // class java/lang/Number
     365: invokevirtual #226                // Method java/lang/Number.longValue:()J
     368: lstore        12
     370: astore        14
     372: iconst_0
     373: istore        15
     375: new           #165                // class day06/Race
     378: dup
     379: lload         12
     381: lload         10
     383: invokespecial #229                // Method day06/Race."<init>":(JJ)V
     386: aload         14
     388: swap
     389: invokevirtual #230                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     392: pop
     393: goto          318
     396: aload         9
     398: checkcast     #130                // class java/util/List
     401: nop
     402: nop
     403: astore_1
     404: iconst_0
     405: istore_2
     406: aload_1
     407: invokestatic  #232                // Method solve:(Ljava/util/List;)J
     410: nop
     411: lreturn

  private static final long part2(kotlin.Pair<? extends java.util.List<java.lang.String>, ? extends java.util.List<java.lang.String>>);
    Code:
       0: aload_0
       1: astore_1
       2: iconst_0
       3: istore_2
       4: aload_1
       5: invokevirtual #205                // Method kotlin/Pair.component1:()Ljava/lang/Object;
       8: checkcast     #130                // class java/util/List
      11: astore_3
      12: aload_1
      13: invokevirtual #207                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      16: checkcast     #130                // class java/util/List
      19: astore        4
      21: aload_3
      22: checkcast     #73                 // class java/lang/Iterable
      25: ldc           #247                // String
      27: checkcast     #104                // class java/lang/CharSequence
      30: aconst_null
      31: aconst_null
      32: iconst_0
      33: aconst_null
      34: aconst_null
      35: bipush        62
      37: aconst_null
      38: invokestatic  #251                // 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;
      41: aload         4
      43: checkcast     #73                 // class java/lang/Iterable
      46: ldc           #247                // String
      48: checkcast     #104                // class java/lang/CharSequence
      51: aconst_null
      52: aconst_null
      53: iconst_0
      54: aconst_null
      55: aconst_null
      56: bipush        62
      58: aconst_null
      59: invokestatic  #251                // 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;
      62: invokestatic  #140                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      65: nop
      66: astore_1
      67: iconst_0
      68: istore_2
      69: aload_1
      70: invokevirtual #205                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      73: checkcast     #102                // class java/lang/String
      76: astore_3
      77: aload_1
      78: invokevirtual #207                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      81: checkcast     #102                // class java/lang/String
      84: astore        4
      86: new           #165                // class day06/Race
      89: dup
      90: aload_3
      91: invokestatic  #213                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      94: aload         4
      96: invokestatic  #213                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      99: invokespecial #229                // Method day06/Race."<init>":(JJ)V
     102: nop
     103: astore_1
     104: iconst_0
     105: istore_2
     106: aload_1
     107: invokestatic  #255                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     110: invokestatic  #232                // Method solve:(Ljava/util/List;)J
     113: nop
     114: lreturn

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


package day01

import java.io.File

fun main() {
    val data = parse("src/day01/Day01.txt")

    println("🎄 Day 01 🎄")

    println()

    println("[Part 1]")
    println("Answer: ${part1(data)}")

    println()

    println("[Part 2]")
    println("Answer: ${part2(data)}")
}

private fun parse(path: String): List<String> =
    File(path).readLines()

private fun part1(data: List<String>): Int =
    data.map { it.mapNotNull(Char::digitToIntOrNull) }
        .sumOf { it.first() * 10 + it.last() }

private val spelledDigits = mapOf(
    "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,
)

private fun String.parseDigits(): List<Int> {
    val digits = mutableListOf<Int>()

    scan@ for ((i, c) in this.withIndex()) {
        // Ordinary digits may be parsed directly.
        if (c.isDigit()) {
            digits.add(c.digitToInt())
            continue@scan
        }

        // Spelled out digits must be matched individually.
        for ((spelling, value) in spelledDigits) {
            val endIndex = i + spelling.length
            if (this.length >= endIndex) {
                if (this.substring(i, endIndex) == spelling) {
                    digits.add(value)
                    continue@scan
                }
            }
        }
    }

    return digits
}

private fun part2(data: List<String>): Int =
    data.map { it.parseDigits() }
        .sumOf { it.first() * 10 + it.last() }

Compiled from "Day01.kt"
public final class day01.Day01Kt {
  private static final java.util.Map<java.lang.String, java.lang.Integer> spelledDigits;

  public static final void main();
    Code:
       0: ldc           #8                  // String src/day01/Day01.txt
       2: invokestatic  #12                 // Method parse:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: ldc           #14                 // String 🎄 Day 01 🎄
       8: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      18: invokevirtual #28                 // Method java/io/PrintStream.println:()V
      21: ldc           #30                 // String [Part 1]
      23: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: swap
      27: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      30: new           #32                 // class java/lang/StringBuilder
      33: dup
      34: invokespecial #35                 // Method java/lang/StringBuilder."<init>":()V
      37: ldc           #37                 // String Answer:
      39: invokevirtual #41                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      42: aload_0
      43: invokestatic  #45                 // Method part1:(Ljava/util/List;)I
      46: invokevirtual #48                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      49: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      52: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      55: swap
      56: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      59: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      62: invokevirtual #28                 // Method java/io/PrintStream.println:()V
      65: ldc           #54                 // String [Part 2]
      67: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      70: swap
      71: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      74: new           #32                 // class java/lang/StringBuilder
      77: dup
      78: invokespecial #35                 // Method java/lang/StringBuilder."<init>":()V
      81: ldc           #37                 // String Answer:
      83: invokevirtual #41                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      86: aload_0
      87: invokestatic  #57                 // Method part2:(Ljava/util/List;)I
      90: invokevirtual #48                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      93: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      96: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      99: swap
     100: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     103: return

  private static final java.util.List<java.lang.String> parse(java.lang.String);
    Code:
       0: new           #62                 // class java/io/File
       3: dup
       4: aload_0
       5: invokespecial #65                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       8: aconst_null
       9: iconst_1
      10: aconst_null
      11: invokestatic  #71                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      14: areturn

  private static final int part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #76                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #78                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #84                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #87                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #89                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #93,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          202
      48: aload         6
      50: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #105                // class java/lang/String
      64: astore        8
      66: astore        25
      68: iconst_0
      69: istore        9
      71: aload         8
      73: checkcast     #107                // class java/lang/CharSequence
      76: astore        10
      78: iconst_0
      79: istore        11
      81: aload         10
      83: astore        12
      85: new           #78                 // class java/util/ArrayList
      88: dup
      89: invokespecial #108                // Method java/util/ArrayList."<init>":()V
      92: checkcast     #89                 // class java/util/Collection
      95: astore        13
      97: iconst_0
      98: istore        14
     100: aload         12
     102: astore        15
     104: iconst_0
     105: istore        16
     107: iconst_0
     108: istore        17
     110: iload         17
     112: aload         15
     114: invokeinterface #112,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     119: if_icmpge     182
     122: aload         15
     124: iload         17
     126: invokeinterface #116,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     131: istore        18
     133: iload         18
     135: istore        19
     137: iconst_0
     138: istore        20
     140: iload         19
     142: istore        21
     144: iconst_0
     145: istore        22
     147: iload         21
     149: invokestatic  #122                // Method kotlin/text/CharsKt.digitToIntOrNull:(C)Ljava/lang/Integer;
     152: dup
     153: ifnull        174
     156: astore        23
     158: iconst_0
     159: istore        24
     161: aload         13
     163: aload         23
     165: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     170: pop
     171: goto          175
     174: pop
     175: nop
     176: iinc          17, 1
     179: goto          110
     182: nop
     183: aload         13
     185: checkcast     #128                // class java/util/List
     188: nop
     189: nop
     190: aload         25
     192: swap
     193: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     198: pop
     199: goto          38
     202: aload         4
     204: checkcast     #128                // class java/util/List
     207: nop
     208: checkcast     #76                 // class java/lang/Iterable
     211: astore_1
     212: iconst_0
     213: istore_2
     214: aload_1
     215: invokeinterface #93,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     220: astore_3
     221: aload_3
     222: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     227: ifeq          288
     230: aload_3
     231: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     236: astore        4
     238: iload_2
     239: aload         4
     241: checkcast     #128                // class java/util/List
     244: astore        5
     246: istore        25
     248: iconst_0
     249: istore        6
     251: aload         5
     253: invokestatic  #132                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     256: checkcast     #134                // class java/lang/Number
     259: invokevirtual #137                // Method java/lang/Number.intValue:()I
     262: bipush        10
     264: imul
     265: aload         5
     267: invokestatic  #140                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     270: checkcast     #134                // class java/lang/Number
     273: invokevirtual #137                // Method java/lang/Number.intValue:()I
     276: iadd
     277: istore        26
     279: iload         25
     281: iload         26
     283: iadd
     284: istore_2
     285: goto          221
     288: iload_2
     289: ireturn

  private static final java.util.List<java.lang.Integer> parseDigits(java.lang.String);
    Code:
       0: new           #78                 // class java/util/ArrayList
       3: dup
       4: invokespecial #108                // Method java/util/ArrayList."<init>":()V
       7: checkcast     #128                // class java/util/List
      10: astore_1
      11: iconst_0
      12: istore_2
      13: aload_0
      14: invokevirtual #173                // Method java/lang/String.length:()I
      17: istore_3
      18: iload_2
      19: iload_3
      20: if_icmpge     185
      23: iload_2
      24: istore        4
      26: aload_0
      27: iload_2
      28: invokevirtual #174                // Method java/lang/String.charAt:(I)C
      31: istore        5
      33: iload         5
      35: invokestatic  #180                // Method java/lang/Character.isDigit:(C)Z
      38: ifeq          59
      41: aload_1
      42: iload         5
      44: invokestatic  #184                // Method kotlin/text/CharsKt.digitToInt:(C)I
      47: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      50: invokeinterface #189,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      55: pop
      56: goto          179
      59: getstatic     #193                // Field spelledDigits:Ljava/util/Map;
      62: invokeinterface #199,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      67: invokeinterface #202,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      72: astore        6
      74: aload         6
      76: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      81: ifeq          179
      84: aload         6
      86: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      91: checkcast     #204                // class java/util/Map$Entry
      94: astore        7
      96: aload         7
      98: invokeinterface #207,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     103: checkcast     #105                // class java/lang/String
     106: astore        8
     108: aload         7
     110: invokeinterface #210,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     115: checkcast     #134                // class java/lang/Number
     118: invokevirtual #137                // Method java/lang/Number.intValue:()I
     121: istore        9
     123: iload         4
     125: aload         8
     127: invokevirtual #173                // Method java/lang/String.length:()I
     130: iadd
     131: istore        10
     133: aload_0
     134: invokevirtual #173                // Method java/lang/String.length:()I
     137: iload         10
     139: if_icmplt     74
     142: aload_0
     143: iload         4
     145: iload         10
     147: invokevirtual #214                // Method java/lang/String.substring:(II)Ljava/lang/String;
     150: dup
     151: ldc           #216                // String substring(...)
     153: invokestatic  #222                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     156: aload         8
     158: invokestatic  #226                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     161: ifeq          74
     164: aload_1
     165: iload         9
     167: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     170: invokeinterface #189,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     175: pop
     176: goto          179
     179: iinc          2, 1
     182: goto          18
     185: aload_1
     186: areturn

  private static final int part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #76                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #78                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #84                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #87                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #89                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #93,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          88
      48: aload         6
      50: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #105                // class java/lang/String
      64: astore        8
      66: astore        10
      68: iconst_0
      69: istore        9
      71: aload         8
      73: invokestatic  #235                // Method parseDigits:(Ljava/lang/String;)Ljava/util/List;
      76: aload         10
      78: swap
      79: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      84: pop
      85: goto          38
      88: aload         4
      90: checkcast     #128                // class java/util/List
      93: nop
      94: checkcast     #76                 // class java/lang/Iterable
      97: astore_1
      98: iconst_0
      99: istore_2
     100: aload_1
     101: invokeinterface #93,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     106: astore_3
     107: aload_3
     108: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     113: ifeq          174
     116: aload_3
     117: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     122: astore        4
     124: iload_2
     125: aload         4
     127: checkcast     #128                // class java/util/List
     130: astore        5
     132: istore        10
     134: iconst_0
     135: istore        6
     137: aload         5
     139: invokestatic  #132                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     142: checkcast     #134                // class java/lang/Number
     145: invokevirtual #137                // Method java/lang/Number.intValue:()I
     148: bipush        10
     150: imul
     151: aload         5
     153: invokestatic  #140                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     156: checkcast     #134                // class java/lang/Number
     159: invokevirtual #137                // Method java/lang/Number.intValue:()I
     162: iadd
     163: istore        11
     165: iload         10
     167: iload         11
     169: iadd
     170: istore_2
     171: goto          107
     174: iload_2
     175: ireturn

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

  static {};
    Code:
       0: bipush        9
       2: anewarray     #245                // class kotlin/Pair
       5: astore_0
       6: aload_0
       7: iconst_0
       8: ldc           #247                // String one
      10: iconst_1
      11: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      17: aastore
      18: aload_0
      19: iconst_1
      20: ldc           #255                // String two
      22: iconst_2
      23: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      26: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      29: aastore
      30: aload_0
      31: iconst_2
      32: ldc_w         #257                // String three
      35: iconst_3
      36: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      39: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      42: aastore
      43: aload_0
      44: iconst_3
      45: ldc_w         #259                // String four
      48: iconst_4
      49: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      52: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      55: aastore
      56: aload_0
      57: iconst_4
      58: ldc_w         #261                // String five
      61: iconst_5
      62: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      65: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      68: aastore
      69: aload_0
      70: iconst_5
      71: ldc_w         #263                // String six
      74: bipush        6
      76: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      79: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      82: aastore
      83: aload_0
      84: bipush        6
      86: ldc_w         #265                // String seven
      89: bipush        7
      91: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      94: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      97: aastore
      98: aload_0
      99: bipush        7
     101: ldc_w         #267                // String eight
     104: bipush        8
     106: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     109: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     112: aastore
     113: aload_0
     114: bipush        8
     116: ldc_w         #269                // String nine
     119: bipush        9
     121: invokestatic  #188                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     124: invokestatic  #253                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     127: aastore
     128: aload_0
     129: invokestatic  #275                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     132: putstatic     #193                // Field spelledDigits:Ljava/util/Map;
     135: return
}


package day23

import java.io.File
import kotlin.math.max

fun main() {
    val data = parse("src/day23/Day23.txt")

    println("🎄 Day 23 🎄")

    println()

    println("[Part 1]")
    println("Answer: ${part1(data)}")

    println()

    println("[Part 2]")
    println("Answer: ${part2(data)}")
}

private fun parse(path: String): List<List<Char>> =
    File(path)
        .readLines()
        .map(String::toList)

private val directions = mapOf(
    '.' to listOf((1 to 0), (-1 to 0), (0 to 1), (0 to -1)),
    '>' to listOf((1 to 0)),
    '<' to listOf((-1 to 0)),
    'v' to listOf((0 to 1)),
    '^' to listOf((0 to -1)),
)

private data class Vertex(
    val x: Int,
    val y: Int,
)

private fun dfs(
    graph: Map<Vertex,Map<Vertex, Int>>,
    source: Vertex,
    target: Vertex,
    visited: Set<Vertex> = setOf(),
): Int {
    if (source == target) {
        return 0
    }

    var distance = Int.MIN_VALUE
    for ((adjacent, weight) in graph.getValue(source)) {
        if (adjacent !in visited) {
            distance = max(distance, weight + dfs(graph, adjacent, target, visited + adjacent))
        }
    }

    return distance
}

private fun solve(grid: List<List<Char>>): Int {
    val sz = grid.size

    val source = Vertex(1, 0)
    val target = Vertex(sz - 2, sz - 1)

    val vertices = mutableListOf(source, target)
    for ((y, row) in grid.withIndex()) {
        for ((x, col) in row.withIndex()) {
            if (col == '#') {
                continue
            }

            val neighbors = listOfNotNull(
                grid.getOrNull(y)?.getOrNull(x - 1),
                grid.getOrNull(y)?.getOrNull(x + 1),
                grid.getOrNull(y - 1)?.getOrNull(x),
                grid.getOrNull(y + 1)?.getOrNull(x),
            )

            if (neighbors.count { it == '#' } <= 1) {
                vertices += Vertex(x, y)
            }
        }
    }

    val graph = vertices.associateWith { mutableMapOf<Vertex, Int>() }
    for (origin in vertices) {
        val options = ArrayDeque<Pair<Vertex, Int>>().apply { add(origin to 0) }
        val visited = mutableSetOf(origin)

        while (options.isNotEmpty()) {
            val (vertex, n) = options.removeFirst()
            val (vx, vy) = vertex

            if (n != 0 && vertex in vertices) {
                graph.getValue(origin)[vertex] = n
                continue
            }

            for ((dx, dy) in directions.getValue(grid[vy][vx])) {
                val nx = vx + dx
                val ny = vy + dy

                if (nx !in 0..<sz || ny !in 0..<sz) {
                    continue
                }
                if (grid[ny][nx] == '#') {
                    continue
                }
                if (Vertex(nx, ny) in visited) {
                    continue
                }

                options += Vertex(nx, ny) to (n + 1)
                visited += Vertex(nx, ny)
            }
        }
    }

    return dfs(graph, source, target)
}

private fun part1(data: List<List<Char>>): Int =
    solve(data)

private fun part2(data: List<List<Char>>): Int =
    solve(data.map { it.map { c -> if (c in "<^v>") '.' else c } })

Compiled from "Day23.kt"
public final class day23.Day23Kt {
  private static final java.util.Map<java.lang.Character, java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>>> directions;

  public static final void main();
    Code:
       0: ldc           #8                  // String src/day23/Day23.txt
       2: invokestatic  #12                 // Method parse:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: ldc           #14                 // String 🎄 Day 23 🎄
       8: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      18: invokevirtual #28                 // Method java/io/PrintStream.println:()V
      21: ldc           #30                 // String [Part 1]
      23: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: swap
      27: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      30: new           #32                 // class java/lang/StringBuilder
      33: dup
      34: invokespecial #35                 // Method java/lang/StringBuilder."<init>":()V
      37: ldc           #37                 // String Answer:
      39: invokevirtual #41                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      42: aload_0
      43: invokestatic  #45                 // Method part1:(Ljava/util/List;)I
      46: invokevirtual #48                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      49: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      52: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      55: swap
      56: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      59: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      62: invokevirtual #28                 // Method java/io/PrintStream.println:()V
      65: ldc           #54                 // String [Part 2]
      67: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      70: swap
      71: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      74: new           #32                 // class java/lang/StringBuilder
      77: dup
      78: invokespecial #35                 // Method java/lang/StringBuilder."<init>":()V
      81: ldc           #37                 // String Answer:
      83: invokevirtual #41                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      86: aload_0
      87: invokestatic  #57                 // Method part2:(Ljava/util/List;)I
      90: invokevirtual #48                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      93: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      96: getstatic     #20                 // Field java/lang/System.out:Ljava/io/PrintStream;
      99: swap
     100: invokevirtual #26                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     103: return

  private static final java.util.List<java.util.List<java.lang.Character>> parse(java.lang.String);
    Code:
       0: new           #62                 // class java/io/File
       3: dup
       4: aload_0
       5: invokespecial #65                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       8: aconst_null
       9: iconst_1
      10: aconst_null
      11: invokestatic  #71                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      14: checkcast     #73                 // class java/lang/Iterable
      17: astore_1
      18: nop
      19: iconst_0
      20: istore_2
      21: aload_1
      22: astore_3
      23: new           #75                 // class java/util/ArrayList
      26: dup
      27: aload_1
      28: bipush        10
      30: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      33: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      36: checkcast     #86                 // class java/util/Collection
      39: astore        4
      41: iconst_0
      42: istore        5
      44: aload_3
      45: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        6
      52: aload         6
      54: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          105
      62: aload         6
      64: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        7
      71: aload         4
      73: aload         7
      75: checkcast     #102                // class java/lang/String
      78: astore        8
      80: astore        10
      82: iconst_0
      83: istore        9
      85: aload         8
      87: checkcast     #104                // class java/lang/CharSequence
      90: invokestatic  #110                // Method kotlin/text/StringsKt.toList:(Ljava/lang/CharSequence;)Ljava/util/List;
      93: aload         10
      95: swap
      96: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     101: pop
     102: goto          52
     105: aload         4
     107: checkcast     #116                // class java/util/List
     110: nop
     111: areturn

  private static final int dfs(java.util.Map<day23.Vertex, ? extends java.util.Map<day23.Vertex, java.lang.Integer>>, day23.Vertex, day23.Vertex, java.util.Set<day23.Vertex>);
    Code:
       0: aload_1
       1: aload_2
       2: invokestatic  #139                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
       5: ifeq          10
       8: iconst_0
       9: ireturn
      10: ldc           #140                // int -2147483648
      12: istore        4
      14: aload_0
      15: aload_1
      16: invokestatic  #146                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
      19: checkcast     #148                // class java/util/Map
      22: invokeinterface #152,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      27: invokeinterface #155,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      32: astore        5
      34: aload         5
      36: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      41: ifeq          120
      44: aload         5
      46: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      51: checkcast     #157                // class java/util/Map$Entry
      54: astore        6
      56: aload         6
      58: invokeinterface #160,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
      63: checkcast     #162                // class day23/Vertex
      66: astore        7
      68: aload         6
      70: invokeinterface #164,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
      75: checkcast     #166                // class java/lang/Number
      78: invokevirtual #170                // Method java/lang/Number.intValue:()I
      81: istore        8
      83: aload_3
      84: aload         7
      86: invokeinterface #173,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      91: ifne          34
      94: iload         4
      96: iload         8
      98: aload_0
      99: aload         7
     101: aload_2
     102: aload_3
     103: aload         7
     105: invokestatic  #179                // Method kotlin/collections/SetsKt.plus:(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;
     108: invokestatic  #181                // Method dfs:(Ljava/util/Map;Lday23/Vertex;Lday23/Vertex;Ljava/util/Set;)I
     111: iadd
     112: invokestatic  #187                // Method java/lang/Math.max:(II)I
     115: istore        4
     117: goto          34
     120: iload         4
     122: ireturn

  static int dfs$default(java.util.Map, day23.Vertex, day23.Vertex, java.util.Set, int, java.lang.Object);
    Code:
       0: iload         4
       2: bipush        8
       4: iand
       5: ifeq          12
       8: invokestatic  #202                // Method kotlin/collections/SetsKt.emptySet:()Ljava/util/Set;
      11: astore_3
      12: aload_0
      13: aload_1
      14: aload_2
      15: aload_3
      16: invokestatic  #181                // Method dfs:(Ljava/util/Map;Lday23/Vertex;Lday23/Vertex;Ljava/util/Set;)I
      19: ireturn

  private static final int solve(java.util.List<? extends java.util.List<java.lang.Character>>);
    Code:
       0: aload_0
       1: invokeinterface #207,  1          // InterfaceMethod java/util/List.size:()I
       6: istore_1
       7: new           #162                // class day23/Vertex
      10: dup
      11: iconst_1
      12: iconst_0
      13: invokespecial #210                // Method day23/Vertex."<init>":(II)V
      16: astore_2
      17: new           #162                // class day23/Vertex
      20: dup
      21: iload_1
      22: iconst_2
      23: isub
      24: iload_1
      25: iconst_1
      26: isub
      27: invokespecial #210                // Method day23/Vertex."<init>":(II)V
      30: astore_3
      31: iconst_2
      32: anewarray     #162                // class day23/Vertex
      35: astore        5
      37: aload         5
      39: iconst_0
      40: aload_2
      41: aastore
      42: aload         5
      44: iconst_1
      45: aload_3
      46: aastore
      47: aload         5
      49: invokestatic  #214                // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
      52: astore        4
      54: aload_0
      55: checkcast     #73                 // class java/lang/Iterable
      58: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      63: astore        5
      65: iconst_0
      66: istore        6
      68: aload         5
      70: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      75: ifeq          440
      78: iload         6
      80: istore        7
      82: iload         6
      84: iconst_1
      85: iadd
      86: istore        6
      88: aload         5
      90: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      95: checkcast     #116                // class java/util/List
      98: astore        8
     100: aload         8
     102: checkcast     #73                 // class java/lang/Iterable
     105: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     110: astore        9
     112: iconst_0
     113: istore        10
     115: aload         9
     117: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     122: ifeq          68
     125: iload         10
     127: istore        11
     129: iload         10
     131: iconst_1
     132: iadd
     133: istore        10
     135: aload         9
     137: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     142: checkcast     #216                // class java/lang/Character
     145: invokevirtual #220                // Method java/lang/Character.charValue:()C
     148: istore        12
     150: iload         12
     152: bipush        35
     154: if_icmpne     160
     157: goto          115
     160: iconst_4
     161: anewarray     #216                // class java/lang/Character
     164: astore        14
     166: aload         14
     168: iconst_0
     169: aload_0
     170: iload         7
     172: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     175: checkcast     #116                // class java/util/List
     178: dup
     179: ifnull        195
     182: iload         11
     184: iconst_1
     185: isub
     186: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     189: checkcast     #216                // class java/lang/Character
     192: goto          197
     195: pop
     196: aconst_null
     197: aastore
     198: aload         14
     200: iconst_1
     201: aload_0
     202: iload         7
     204: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     207: checkcast     #116                // class java/util/List
     210: dup
     211: ifnull        227
     214: iload         11
     216: iconst_1
     217: iadd
     218: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     221: checkcast     #216                // class java/lang/Character
     224: goto          229
     227: pop
     228: aconst_null
     229: aastore
     230: aload         14
     232: iconst_2
     233: aload_0
     234: iload         7
     236: iconst_1
     237: isub
     238: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     241: checkcast     #116                // class java/util/List
     244: dup
     245: ifnull        259
     248: iload         11
     250: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     253: checkcast     #216                // class java/lang/Character
     256: goto          261
     259: pop
     260: aconst_null
     261: aastore
     262: aload         14
     264: iconst_3
     265: aload_0
     266: iload         7
     268: iconst_1
     269: iadd
     270: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     273: checkcast     #116                // class java/util/List
     276: dup
     277: ifnull        291
     280: iload         11
     282: invokestatic  #224                // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     285: checkcast     #216                // class java/lang/Character
     288: goto          293
     291: pop
     292: aconst_null
     293: aastore
     294: aload         14
     296: invokestatic  #227                // Method kotlin/collections/CollectionsKt.listOfNotNull:([Ljava/lang/Object;)Ljava/util/List;
     299: astore        13
     301: aload         13
     303: checkcast     #73                 // class java/lang/Iterable
     306: astore        14
     308: iconst_0
     309: istore        15
     311: aload         14
     313: instanceof    #86                 // class java/util/Collection
     316: ifeq          336
     319: aload         14
     321: checkcast     #86                 // class java/util/Collection
     324: invokeinterface #230,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     329: ifeq          336
     332: iconst_0
     333: goto          411
     336: iconst_0
     337: istore        16
     339: aload         14
     341: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     346: astore        17
     348: aload         17
     350: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     355: ifeq          409
     358: aload         17
     360: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     365: astore        18
     367: aload         18
     369: checkcast     #216                // class java/lang/Character
     372: invokevirtual #220                // Method java/lang/Character.charValue:()C
     375: istore        19
     377: iconst_0
     378: istore        20
     380: iload         19
     382: bipush        35
     384: if_icmpne     391
     387: iconst_1
     388: goto          392
     391: iconst_0
     392: ifeq          348
     395: iinc          16, 1
     398: iload         16
     400: ifge          348
     403: invokestatic  #233                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     406: goto          348
     409: iload         16
     411: iconst_1
     412: if_icmpgt     115
     415: aload         4
     417: checkcast     #86                 // class java/util/Collection
     420: new           #162                // class day23/Vertex
     423: dup
     424: iload         11
     426: iload         7
     428: invokespecial #210                // Method day23/Vertex."<init>":(II)V
     431: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     436: pop
     437: goto          115
     440: aload         4
     442: checkcast     #73                 // class java/lang/Iterable
     445: astore        6
     447: iconst_0
     448: istore        7
     450: new           #235                // class java/util/LinkedHashMap
     453: dup
     454: aload         6
     456: bipush        10
     458: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     461: invokestatic  #239                // Method kotlin/collections/MapsKt.mapCapacity:(I)I
     464: bipush        16
     466: invokestatic  #244                // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
     469: invokespecial #245                // Method java/util/LinkedHashMap."<init>":(I)V
     472: astore        8
     474: aload         6
     476: astore        9
     478: iconst_0
     479: istore        10
     481: aload         9
     483: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     488: astore        11
     490: aload         11
     492: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     497: ifeq          558
     500: aload         11
     502: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     507: astore        12
     509: aload         8
     511: checkcast     #148                // class java/util/Map
     514: aload         12
     516: aload         12
     518: checkcast     #162                // class day23/Vertex
     521: astore        13
     523: astore        22
     525: astore        21
     527: iconst_0
     528: istore        14
     530: new           #235                // class java/util/LinkedHashMap
     533: dup
     534: invokespecial #246                // Method java/util/LinkedHashMap."<init>":()V
     537: checkcast     #148                // class java/util/Map
     540: nop
     541: astore        23
     543: aload         21
     545: aload         22
     547: aload         23
     549: invokeinterface #250,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     554: pop
     555: goto          490
     558: aload         8
     560: checkcast     #148                // class java/util/Map
     563: nop
     564: astore        5
     566: aload         4
     568: invokeinterface #251,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     573: astore        6
     575: aload         6
     577: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     582: ifeq          1026
     585: aload         6
     587: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     592: checkcast     #162                // class day23/Vertex
     595: astore        7
     597: new           #253                // class kotlin/collections/ArrayDeque
     600: dup
     601: invokespecial #254                // Method kotlin/collections/ArrayDeque."<init>":()V
     604: astore        9
     606: aload         9
     608: astore        10
     610: iconst_0
     611: istore        11
     613: aload         10
     615: aload         7
     617: iconst_0
     618: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     621: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     624: invokevirtual #267                // Method kotlin/collections/ArrayDeque.add:(Ljava/lang/Object;)Z
     627: pop
     628: aload         9
     630: astore        8
     632: iconst_1
     633: anewarray     #162                // class day23/Vertex
     636: astore        10
     638: aload         10
     640: iconst_0
     641: aload         7
     643: aastore
     644: aload         10
     646: invokestatic  #271                // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;
     649: astore        9
     651: aload         8
     653: checkcast     #86                 // class java/util/Collection
     656: invokeinterface #230,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     661: ifne          668
     664: iconst_1
     665: goto          669
     668: iconst_0
     669: ifeq          575
     672: aload         8
     674: invokevirtual #274                // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;
     677: checkcast     #276                // class kotlin/Pair
     680: astore        10
     682: aload         10
     684: invokevirtual #279                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     687: checkcast     #162                // class day23/Vertex
     690: astore        11
     692: aload         10
     694: invokevirtual #282                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     697: checkcast     #166                // class java/lang/Number
     700: invokevirtual #170                // Method java/lang/Number.intValue:()I
     703: istore        12
     705: aload         11
     707: invokevirtual #284                // Method day23/Vertex.component1:()I
     710: istore        13
     712: aload         11
     714: invokevirtual #286                // Method day23/Vertex.component2:()I
     717: istore        14
     719: iload         12
     721: ifeq          766
     724: aload         4
     726: aload         11
     728: invokeinterface #287,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     733: ifeq          766
     736: iload         12
     738: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     741: astore        16
     743: aload         5
     745: aload         7
     747: invokestatic  #146                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     750: checkcast     #148                // class java/util/Map
     753: aload         11
     755: aload         16
     757: invokeinterface #250,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     762: pop
     763: goto          651
     766: getstatic     #290                // Field directions:Ljava/util/Map;
     769: aload_0
     770: iload         14
     772: invokeinterface #294,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     777: checkcast     #116                // class java/util/List
     780: iload         13
     782: invokeinterface #294,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     787: invokestatic  #146                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     790: checkcast     #116                // class java/util/List
     793: invokeinterface #251,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     798: astore        15
     800: aload         15
     802: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     807: ifeq          651
     810: aload         15
     812: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     817: checkcast     #276                // class kotlin/Pair
     820: astore        16
     822: aload         16
     824: invokevirtual #279                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     827: checkcast     #166                // class java/lang/Number
     830: invokevirtual #170                // Method java/lang/Number.intValue:()I
     833: istore        17
     835: aload         16
     837: invokevirtual #282                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     840: checkcast     #166                // class java/lang/Number
     843: invokevirtual #170                // Method java/lang/Number.intValue:()I
     846: istore        18
     848: iload         13
     850: iload         17
     852: iadd
     853: istore        19
     855: iload         14
     857: iload         18
     859: iadd
     860: istore        20
     862: iconst_0
     863: iload         19
     865: if_icmpgt     882
     868: iload         19
     870: iload_1
     871: if_icmpge     878
     874: iconst_1
     875: goto          883
     878: iconst_0
     879: goto          883
     882: iconst_0
     883: ifeq          910
     886: iconst_0
     887: iload         20
     889: if_icmpgt     906
     892: iload         20
     894: iload_1
     895: if_icmpge     902
     898: iconst_1
     899: goto          907
     902: iconst_0
     903: goto          907
     906: iconst_0
     907: ifne          913
     910: goto          800
     913: aload_0
     914: iload         20
     916: invokeinterface #294,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     921: checkcast     #116                // class java/util/List
     924: iload         19
     926: invokeinterface #294,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     931: checkcast     #216                // class java/lang/Character
     934: invokevirtual #220                // Method java/lang/Character.charValue:()C
     937: bipush        35
     939: if_icmpne     945
     942: goto          800
     945: aload         9
     947: new           #162                // class day23/Vertex
     950: dup
     951: iload         19
     953: iload         20
     955: invokespecial #210                // Method day23/Vertex."<init>":(II)V
     958: invokeinterface #173,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     963: ifeq          969
     966: goto          800
     969: aload         8
     971: checkcast     #86                 // class java/util/Collection
     974: new           #162                // class day23/Vertex
     977: dup
     978: iload         19
     980: iload         20
     982: invokespecial #210                // Method day23/Vertex."<init>":(II)V
     985: iload         12
     987: iconst_1
     988: iadd
     989: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     992: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     995: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1000: pop
    1001: aload         9
    1003: checkcast     #86                 // class java/util/Collection
    1006: new           #162                // class day23/Vertex
    1009: dup
    1010: iload         19
    1012: iload         20
    1014: invokespecial #210                // Method day23/Vertex."<init>":(II)V
    1017: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1022: pop
    1023: goto          800
    1026: aload         5
    1028: aload_2
    1029: aload_3
    1030: aconst_null
    1031: bipush        8
    1033: aconst_null
    1034: invokestatic  #296                // Method dfs$default:(Ljava/util/Map;Lday23/Vertex;Lday23/Vertex;Ljava/util/Set;ILjava/lang/Object;)I
    1037: ireturn

  private static final int part1(java.util.List<? extends java.util.List<java.lang.Character>>);
    Code:
       0: aload_0
       1: invokestatic  #336                // Method solve:(Ljava/util/List;)I
       4: ireturn

  private static final int part2(java.util.List<? extends java.util.List<java.lang.Character>>);
    Code:
       0: aload_0
       1: checkcast     #73                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #75                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #86                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          210
      48: aload         6
      50: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #116                // class java/util/List
      64: astore        8
      66: astore        20
      68: iconst_0
      69: istore        9
      71: aload         8
      73: checkcast     #73                 // class java/lang/Iterable
      76: astore        10
      78: iconst_0
      79: istore        11
      81: aload         10
      83: astore        12
      85: new           #75                 // class java/util/ArrayList
      88: dup
      89: aload         10
      91: bipush        10
      93: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      96: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      99: checkcast     #86                 // class java/util/Collection
     102: astore        13
     104: iconst_0
     105: istore        14
     107: aload         12
     109: invokeinterface #90,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     114: astore        15
     116: aload         15
     118: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     123: ifeq          191
     126: aload         15
     128: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     133: astore        16
     135: aload         13
     137: aload         16
     139: checkcast     #216                // class java/lang/Character
     142: invokevirtual #220                // Method java/lang/Character.charValue:()C
     145: istore        17
     147: astore        18
     149: iconst_0
     150: istore        19
     152: ldc_w         #338                // String <^v>
     155: checkcast     #104                // class java/lang/CharSequence
     158: iload         17
     160: iconst_0
     161: iconst_2
     162: aconst_null
     163: invokestatic  #342                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
     166: ifeq          174
     169: bipush        46
     171: goto          176
     174: iload         17
     176: invokestatic  #345                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     179: aload         18
     181: swap
     182: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     187: pop
     188: goto          116
     191: aload         13
     193: checkcast     #116                // class java/util/List
     196: nop
     197: nop
     198: aload         20
     200: swap
     201: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     206: pop
     207: goto          38
     210: aload         4
     212: checkcast     #116                // class java/util/List
     215: nop
     216: invokestatic  #336                // Method solve:(Ljava/util/List;)I
     219: ireturn

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

  static {};
    Code:
       0: iconst_5
       1: anewarray     #276                // class kotlin/Pair
       4: astore_0
       5: aload_0
       6: iconst_0
       7: bipush        46
       9: invokestatic  #345                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      12: iconst_4
      13: anewarray     #276                // class kotlin/Pair
      16: astore_1
      17: aload_1
      18: iconst_0
      19: iconst_1
      20: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      23: iconst_0
      24: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      27: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      30: aastore
      31: aload_1
      32: iconst_1
      33: iconst_m1
      34: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      37: iconst_0
      38: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      41: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      44: aastore
      45: aload_1
      46: iconst_2
      47: iconst_0
      48: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      51: iconst_1
      52: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      55: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      58: aastore
      59: aload_1
      60: iconst_3
      61: iconst_0
      62: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      65: iconst_m1
      66: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      69: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      72: aastore
      73: aload_1
      74: invokestatic  #357                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      77: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      80: aastore
      81: aload_0
      82: iconst_1
      83: bipush        62
      85: invokestatic  #345                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      88: iconst_1
      89: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      92: iconst_0
      93: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      96: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      99: invokestatic  #360                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     102: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     105: aastore
     106: aload_0
     107: iconst_2
     108: bipush        60
     110: invokestatic  #345                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     113: iconst_m1
     114: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     117: iconst_0
     118: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     121: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     124: invokestatic  #360                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     127: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     130: aastore
     131: aload_0
     132: iconst_3
     133: bipush        118
     135: invokestatic  #345                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     138: iconst_0
     139: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     142: iconst_1
     143: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     146: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     149: invokestatic  #360                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     152: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     155: aastore
     156: aload_0
     157: iconst_4
     158: bipush        94
     160: invokestatic  #345                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     163: iconst_0
     164: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     167: iconst_m1
     168: invokestatic  #260                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     171: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     174: invokestatic  #360                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     177: invokestatic  #266                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     180: aastore
     181: aload_0
     182: invokestatic  #364                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     185: putstatic     #290                // Field directions:Ljava/util/Map;
     188: return
}