Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 8, 2023
1 parent 4608019 commit 5c4aa81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solutions/src/2023/07.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ strength1 hand = category hand : map val hand
strength2 :: String -> [Int]
strength2 hand =
maximum
[ category (map rpl hand) : map val hand
[ category (map rpl hand)
| alt <- nub hand
, let rpl x = if x == 'J' then alt else x
]
] : map val hand
where
val x = fromJust (x `elemIndex` "J23456789TQKA")

Expand Down

0 comments on commit 5c4aa81

Please sign in to comment.