This commit is contained in:
Jill 2022-12-06 09:57:31 +03:00
parent 657087d6ed
commit 04830003a3
2 changed files with 19 additions and 0 deletions

9
6-a.hs Normal file
View File

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

10
6-b.hs Normal file
View File

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