From 622c2b5f937d448cd0a1693874cc98735535094a Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 10 Dec 2020 08:22:25 +0100 Subject: [PATCH] one line --- 10/one.icl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/10/one.icl b/10/one.icl index 32ffe8b..a71ff6d 100644 --- a/10/one.icl +++ b/10/one.icl @@ -16,10 +16,6 @@ Start w # ls = sort [0:read io] = (one ls, two ls) -one ls = uncurry (*) $ foldl jolt (0, 1) [b-a\\a<-ls & b<-tl ls] -where - jolt (j1, j3) 3 = (j1, j3+1) - jolt (j1, j3) 1 = (j1+1, j3) - jolt (j1, j3) _ = (j1, j3) +one ls = prod $ map length $ group $ sort [3:[b-a\\a<-ls & b<-tl ls]] two ls = prod [[0,1,2,4,7,12,20,33,53]!!length l\\l<-group [b-a\\a<-ls & b<-tl ls] | all ((==)1) l] -- 2.20.1