Max sub array it failed to pass any test case

this is my code

declare a new array for each test case

int main() {
    
    int t;
   
    int N;
    
    cin>>t;
    for(int i=0; i<t; i++){
        cin>> N;
         int a[N];

after doing that also it will not passing any test case

Now it will work
Thanks

hi @vibekmadal10 have you re-opened this doubt?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.