aboutsummaryrefslogtreecommitdiff
path: root/challenge-338/deadmarshal/haskell/ch1.hs
blob: 10e5387bba8f15db929073af37f9a635f5bbc436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Ch1 where

highestRow :: Integral a => [[a]] -> a
highestRow xs = maximum $ map sum xs

main :: IO ()
main = do
  print $ highestRow [[4,4,4,4],[10,0,0,0],[2,2,2,9]]
  print $ highestRow [[1,5],[7,3],[3,5]]
  print $ highestRow [[1,2,3],[3,2,1]]
  print $ highestRow [[2,8,7],[7,1,3],[1,9,5]]
  print $ highestRow [[10,20,30],[5,5,5],[0,100,0],[25,25,25]]