Skip to content

Commit

Permalink
simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 11, 2024
1 parent bdd4eb7 commit 8b4929e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions solutions/src/2024/11.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ blinks stones = Map.fromListWith (+) [(stone', n) | (stone, n) <- Map.assocs sto
blink :: Int -> [Int]
blink 0 = [1] -- 0 -> 1
blink n -- split in half if even length
| let str = show n
, (w, 0) <- length str `quotRem` 2
| (w, 0) <- length (show n) `quotRem` 2
, (l, r) <- n `quotRem` (10 ^ w)
= [l, r]
blink n = [n * 2024] -- otherwise multiply by 2024

0 comments on commit 8b4929e

Please sign in to comment.