This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Guide to run: | |
// + Install scala-cli: https://scala-cli.virtuslab.org/install | |
// + Run: scala-cli test d8bug.scala | |
// Guide to dev: https://scala-cli.virtuslab.org/docs/cookbooks/ide/vscode | |
//> using scala 3.3.1 | |
//> using dep org.scalameta::munit::1.0.0-M10 | |
// With input like bellow, we can NOT use LCM to solve part2 | |
val input = """LLR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dev using scala-cli and vscode https://scala-cli.virtuslab.org/docs/cookbooks/ide/vscode | |
//> using scala 3.3.1 | |
import Hand.*, Kind.* | |
import scala.math.Ordering | |
enum Kind: | |
case HighCard, OnePair, TwoPair, ThreeOfAKind, FullHouse, FourOfAKind, FiveOfAKind | |
object Hand: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sd.cb | |
import net.spy.memcached.internal.{OperationCompletionListener, OperationFuture} | |
import scala.concurrent.{Future, Promise} | |
/** | |
* @see http://stackoverflow.com/questions/11529145/how-do-i-wrap-a-java-util-concurrent-future-in-an-akka-future?rq=1 | |
* http://stackoverflow.com/questions/17215421/scala-concurrent-future-wrapper-for-java-util-concurrent-future | |
*/ | |
object CbFutureAsScala{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sd.cb | |
import net.spy.memcached.internal.{OperationCompletionListener, OperationFuture} | |
import scala.concurrent.{Future, Promise} | |
/** | |
* @see http://stackoverflow.com/questions/11529145/how-do-i-wrap-a-java-util-concurrent-future-in-an-akka-future?rq=1 | |
* http://stackoverflow.com/questions/17215421/scala-concurrent-future-wrapper-for-java-util-concurrent-future | |
*/ | |
object CbFutureAsScala{ |