day7: Remove some spurious comments
This commit is contained in:
parent
b1167fe42e
commit
5674535478
|
@ -17,12 +17,6 @@ fun part1(bets: List<Pair<Hand, Int>>): Int {
|
|||
}
|
||||
|
||||
fun part2(bets: List<Pair<Hand, Int>>): 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<Pair<Hand, Int>> {
|
||||
|
|
Loading…
Reference in a new issue