runningSum :: [ Int ] -> Maybe [ Int ]
runningSum x = Just (sum' x a)
where a = 0; sum' [] a = []
sum' (x:xs) a = (a+x) : sum' xs (a+x)
main = do
putStrLn "1480. Running Sum of 1d Array"
putStrLn "https://leetcode.com/problems/running-sum-of-1d-array/"
Created
June 27, 2020 10:29
-
-
Save idhowardgj94/5fa780bb9a706629736cefef867fb561 to your computer and use it in GitHub Desktop.
haskell
Author
idhowardgj94
commented
Jun 29, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment