From 8a81e989da7e658867646aeb74553d28a233dfab Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 7 Dec 2023 14:00:49 -0500 Subject: [PATCH] [2023][ruby][7.x] remove unnecessary lexographic sorting --- 2023/ruby/day_07.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/2023/ruby/day_07.rb b/2023/ruby/day_07.rb index ce8eff7..ab62aa0 100644 --- a/2023/ruby/day_07.rb +++ b/2023/ruby/day_07.rb @@ -33,11 +33,10 @@ module PartTwo else counts[-1] += jokers end - strengths = [ + [ HAND_STRENGTH.fetch(counts), *cards.map { CARD_STRENGTH.fetch(_1) }, ] - strengths.map { (?a.ord + _1).chr }.join end end