diff --git a/6-a.hs b/6-a.hs new file mode 100644 index 0000000..aa03b58 --- /dev/null +++ b/6-a.hs @@ -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)..]) \ No newline at end of file diff --git a/6-b.hs b/6-b.hs new file mode 100644 index 0000000..267d7a6 --- /dev/null +++ b/6-b.hs @@ -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)..]) \ No newline at end of file