blob: 84ae3cbfd0e797d46373141641d7f479b940c0aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
module Main where
import Data.List
import Input
main :: IO ()
main = do
inp <- map read <$> getInput 1
print (sum . map fromEnum . map (> (0::Int)) $ zipWith (-) (tail inp) inp)
print (sum . map fromEnum . map (> (0::Int)) . (\x -> zipWith (-) (tail x) x) . map sum . filter ((== 3) . length) . map (take 3) $ tails inp)
|