diff --git a/day7/day7.kt b/day7/day7.kt index f454c07..33de794 100644 --- a/day7/day7.kt +++ b/day7/day7.kt @@ -17,12 +17,6 @@ fun part1(bets: List>): Int { } fun part2(bets: List>): Int { - // println( - // bets.sortedBy { handValueJoker(it.first) }.forEach { - // println("${it} - ${handValueJoker(it.first)}") - // } - // ) - return bets.sortedBy { handValueJoker(it.first) }.foldIndexed(0) { i, acc, bet -> acc + (i + 1) * bet.second } @@ -120,7 +114,6 @@ fun handValueJoker(cards: Hand): Int { // Since the tie breaker in this case is again the value of the // card, this is kind of recursive. return typeJoker(cards) + cards.fold(0) { acc, label -> acc * 13 + cardValueJoker(label) } - // 247838255 is too low } fun parseHands(input: File): List> {