From 366b3950b38e4d60b487f73aa6034728813b73cc Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Tue, 6 Dec 2022 10:02:54 +0300 Subject: [PATCH] slight day 6 cleanup --- 6-a.hs | 3 +-- 6-b.hs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/6-a.hs b/6-a.hs index aa03b58..621e38d 100644 --- a/6-a.hs +++ b/6-a.hs @@ -4,6 +4,5 @@ markerLength = 4 main = interact $ show - . (+ 1) - . (!! 0) + . (+ 1) . head . (\l -> filter (\i -> markerLength == length (nub $ map (l !!) [i - (markerLength - 1) .. i])) [(markerLength - 1)..]) \ No newline at end of file diff --git a/6-b.hs b/6-b.hs index 267d7a6..51a4b93 100644 --- a/6-b.hs +++ b/6-b.hs @@ -5,6 +5,5 @@ markerLength = 14 main = interact $ show - . (+ 1) - . (!! 0) + . (+ 1) . head . (\l -> filter (\i -> markerLength == length (nub $ map (l !!) [i - (markerLength - 1) .. i])) [(markerLength - 1)..]) \ No newline at end of file