A function that categorizes positive and negative numbers from a list. Returns the count of positives and the sum of negatives.
Write a Python function `count_pos_sum_neg` that takes a list of integers, comprising both positive and negative numbers, and returns a list containing two elements. The first element of the output list should indicate the number of positive integers in the input list, while the second element should represent the sum of all negative integers from the input list. If the input list is empty, the function should return an empty list. ### Parameters - `nums` List[int]: An input list of integers, which can include positive, negative, or zero. The length of the list can range from 0 to n. ### Return Value The function will return a list where the first element is the count of positive integers, and the second element is the sum of all negative integers from the `nums` list. If the `nums` list doesn't contain any elements, the function will return an empty list. ### Examples ```python # The input list has 10 positive numbers and the sum of negative numbers is -65. count_pos_sum_neg([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]) # Expected output: [10, -65] # The input list has 7 positive numbers and the sum of negative numbers is -252. count_pos_sum_neg([92, 6, 73, -77, 81, -90, 99, 8, -85, 34]) # Expected output: [7, -252] # An empty input list returns an empty output list. count_pos_sum_neg([]) # Expected output: [] ```