Help me in solving ATM2 problem

My issue

why i getting run time error

My code

#include <stdio.h>

int main(){
    int T;
    scanf("%d", &T);
    
    while (T--){
        int N, K;
        scanf("%d %d", &N, &K);
        
         int A[N];
         for (int i = 0; i < N; i++){
             scanf("%d", &A[i]);
         }
        
         char result[N + 1];
         result[N] = '\0';
         
         int current_amount = K;
         
         for(int i = 0; i < N; i++){
             if (A[i] <= currrent_amount){
                 
                 result[i] = '1';
                 current_amount -= A[i];
                 
             }else{
                 result[i] = '0';
             }
         }
          printf("%s\n", result);
    }
    
    return 0;
}

Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300A/problems/ATM2