🎄Advent of Code - tidy day7 P2

This commit is contained in:
Denis-Cosmin Nutiu 2023-12-07 23:33:31 +02:00
parent 00fd42aa67
commit 2f09827d55

View file

@ -1,7 +1,6 @@
package AdventOfCode2023.day7 package AdventOfCode2023.day7
import AdventOfCode.Puzzle import AdventOfCode.Puzzle
import kotlin.math.max
data class Card(val data: String, val bid: Int) { data class Card(val data: String, val bid: Int) {
constructor(data: List<String>) : this(data[0], data[1].toInt()) constructor(data: List<String>) : this(data[0], data[1].toInt())
@ -47,7 +46,7 @@ data class Card(val data: String, val bid: Int) {
} }
} }
fun Map<Char, Int>.keyForMaxValue(): Char { private fun Map<Char, Int>.keyForMaxValue(): Char {
var maxValue = entries.first().value var maxValue = entries.first().value
var maxKey = entries.first().key var maxKey = entries.first().key