Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 483 Bytes

(8 kyu) Count of positives - sum of negatives.md

File metadata and controls

18 lines (11 loc) · 483 Bytes

Count of positives / sum of negatives (8 kyu)

https://www.codewars.com/kata/count-of-positives-slash-sum-of-negatives

Given an array of integers.

Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers.

If the input array is empty or null, return an empty array.

The passed array should NOT be changed.

For example:

input [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]
return [10, -65].