Safi K
12/08/2023, 6:11 PMComparator
a bad choice for this problem?ephemient
12/08/2023, 6:13 PMSafi K
12/08/2023, 6:15 PMSafi K
12/08/2023, 6:15 PMSafi K
12/08/2023, 6:16 PMSafi K
12/08/2023, 6:18 PMDave Leeds
12/08/2023, 6:42 PMLidonis Calhau
12/08/2023, 7:57 PMComparator
for hands with no real issueDavio
12/08/2023, 9:10 PMDavio
12/08/2023, 9:12 PMDavio
12/08/2023, 9:23 PMevgenim
12/08/2023, 10:28 PMNorbert Kiesel
12/09/2023, 12:00 AMoverride fun compareTo(other: Hand) = compareValuesBy(this, other, { it.type}, { it.value })
with class Hand(...) : Comparable<Hand>
. My Hand objects have a type (e.g. FULL_HOUSE) and a value (computed from cards), both in ascending order. See https://github.com/nkiesel/AdventOfCode_2023/blob/main/src/test/kotlin/Day07.kt for full code