Compare commits

...

2 Commits

Author SHA1 Message Date
Jill 366b3950b3 slight day 6 cleanup 2022-12-06 10:02:54 +03:00
Jill 04830003a3 day 6 2022-12-06 09:57:31 +03:00
2 changed files with 17 additions and 0 deletions

8
6-a.hs Normal file
View File

@ -0,0 +1,8 @@
import Data.List
markerLength = 4
main = interact $
show
. (+ 1) . head
. (\l -> filter (\i -> markerLength == length (nub $ map (l !!) [i - (markerLength - 1) .. i])) [(markerLength - 1)..])

9
6-b.hs Normal file
View File

@ -0,0 +1,9 @@
import Data.List
-- literally only changes this one constant
markerLength = 14
main = interact $
show
. (+ 1) . head
. (\l -> filter (\i -> markerLength == length (nub $ map (l !!) [i - (markerLength - 1) .. i])) [(markerLength - 1)..])