Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Exercise
--ghc 7.10 import Data.List (transpose) generateList xs = map (\x -> case () of _ | x >= (xs !! 0) && x < (xs !! 1) -> 1 | otherwise -> 0) [9..17] calculate xs = [length [x | x <- list, x >= 2, x < 4], length $ filter (>=4) list] where list = map sum . transpose $ map generateList xs main = do print $ calculate [[9,10], [9,12]] print $ calculate [[9,10], [9,12], [13,15], [10,18]] print $ calculate [[9,11], [12,14], [13,15], [11,18], [14,18], [10,14], [15,18]] print $ calculate [[9,10], [9,12], [14,15], [16,18], [14,18], [10,13], [15,18], [10,14], [9,13]] print $ calculate [[9,14],[15,17],[12,13],[16,18],[10,15],[14,16],[9,13],[9,15]]
run
|
edit
|
history
|
help
0
Znajdz trójkąty prostokątne
Haskell Prime Factorizer
Derive type class for parameterized data type
Haskell Fibonacci Numbers
Hanoi solver
Niet
Removed input
Kleiner dan tien
Kleinste
credit card number validator