heh
1
2
3
4
5
6
7
8
9
10
11
12
import Data.Foldable
import Data.List
import Data.List.Split

main :: IO ()
main = do
  contents :: String <- readFile "src/inp.txt"
  let g = sort (map read . splitOn "-" <$> lines contents) :: [[Int]]
  let x = foldl' (\acc (a : b : _) -> if acc `elem` [a .. b] then b + 1 else acc) 0 g :: Int
  print x

windows c n = (\x -> take n (drop x c)) <$> [n .. length c - n]