๐Ÿ“ฆ malash / codewars-solutions

๐Ÿ“„ maximum-subarray-sum.hs ยท 8 lines
1
2
3
4
5
6
7
8module MaxSequence where

import Data.List

-- Return the greatest subarray sum within the array of integers passed in.
maxSequence :: [Int] -> Int
maxSequence = maximum . map sum . concat . map inits . tails