[2023][ruby][7.x] remove unnecessary lexographic sorting

main
Alpha Chen 12 months ago
parent cc41e835ac
commit 8a81e989da
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -33,11 +33,10 @@ module PartTwo
else else
counts[-1] += jokers counts[-1] += jokers
end end
strengths = [ [
HAND_STRENGTH.fetch(counts), HAND_STRENGTH.fetch(counts),
*cards.map { CARD_STRENGTH.fetch(_1) }, *cards.map { CARD_STRENGTH.fetch(_1) },
] ]
strengths.map { (?a.ord + _1).chr }.join
end end
end end

Loading…
Cancel
Save