Created
July 5, 2013 11:00
-
-
Save mgechev/5933790 to your computer and use it in GitHub Desktop.
The sum of all sub lists of given list which don't have negative values in them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sumProd :: [[Integer]]->Integer | |
| sumProd lst = sum (map product (filter (\x -> length ([y | y <- x, y < 0]) == 0) lst)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment