12 lines
244 B
Haskell
12 lines
244 B
Haskell
|
import Data.List.Split
|
||
|
import Data.List
|
||
|
|
||
|
main :: IO ()
|
||
|
main = do
|
||
|
input <- readFile "input"
|
||
|
print $ day6 4 input
|
||
|
print $ day6 14 input
|
||
|
|
||
|
day6 :: Int -> String -> Int
|
||
|
day6 n = (+n) . head . elemIndices n . map (length.nub.sort) . divvy n 1
|