Day 10: More Golf
This commit is contained in:
parent
44a48767ef
commit
edc4c375ef
|
@ -1,4 +1,3 @@
|
||||||
import Control.Arrow
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.List
|
import Data.List
|
||||||
|
|
||||||
|
@ -16,6 +15,5 @@ arrangements n =
|
||||||
|
|
||||||
jolts :: [Int] -> [Int]
|
jolts :: [Int] -> [Int]
|
||||||
jolts =
|
jolts =
|
||||||
map (uncurry subtract) .
|
ap (zipWith subtract) tail .
|
||||||
ap zip tail .
|
ap (++) (flip (:) [] . (+ 3) . last) . (:) 0 . sort
|
||||||
uncurry (++) . (id &&& (flip (:) [] . (+ 3) . last)) . (:) 0 . sort
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user