Day 10: More Golf

This commit is contained in:
shu 2020-12-10 08:22:40 +01:00
parent 44a48767ef
commit edc4c375ef

View File

@ -1,4 +1,3 @@
import Control.Arrow
import Control.Monad
import Data.List
@ -16,6 +15,5 @@ arrangements n =
jolts :: [Int] -> [Int]
jolts =
map (uncurry subtract) .
ap zip tail .
uncurry (++) . (id &&& (flip (:) [] . (+ 3) . last)) . (:) 0 . sort
ap (zipWith subtract) tail .
ap (++) (flip (:) [] . (+ 3) . last) . (:) 0 . sort