Help me in solving P3149 problem

My issue

i keep failing a hidden test case idk what it is

please explain where did i go wrong

My code

#include <stdio.h>
int main() {
    int T; 
    scanf("%d", &T);

    while (T--) {
        int N,count = 0,sum = 0; 
        scanf("%d", &N);

        int A[N];
        for (int i = 0; i < N; i++) {
            scanf("%d", &A[i]);
            
            if (A[i] < 0){
            	A[i] = 0;
            	
            	count++;
			}
            sum = sum + A[i];
        }
        if(sum == 0){
        	printf("0\n");
		}
		else{
			printf("%d\n",count);
		}

        
    }

    return 0;
}

Problem Link: Easy Subarray Sum Practice Coding Problem

we need to consider the subarray not the complete array
let me give one example
consider -1,2,3,4,5,-1 as your array, so according to your code the answer should be 2, but the real answer is 0. Consider the subarray {2,3,4,5} to the maximum sum so you need not to change negative integers to zero everytime.