Given a sorted array of integers, find the number of negative numbers.
Expected Time Complexity: O(log n)
Array: [-5, -3, -2, 3, 4, 6, 7, 8]
Answer: 3
Array: [0, 1, 2, 3, 4, 6, 7, 8]
Answer: 0
The first line contains 'T' denoting the no. of test cases.
T lines each contain a number 'n' denoting the number of elements, followed by n space-separated numbers denoting the array elements.
T lines each contain an integer denoting the number of negative numbers for that test case.
2
8 -5 -3 -2 3 4 6 7 8
8 0 1 2 3 4 6 7 8
3
0
1 <= T <= 100
1 <= n <= 104
-105 <= Ai <= 105