DEV Community

Discussion on: Daily Coding Puzzles - Oct 29th - Nov 2nd

Collapse
 
sdicke profile image
Sebastian Martin Dicke

Haskell

countPositivesSumNegatives :: [Int] -> [Int]
countPositivesSumNegatives input =
    let positives = length $ filter (>= 0) input in
    let negatives = sum $ filter (<0) input in
    [positives, negatives]