Help me in solving ATM2 problem

My issue

not clear

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t; cin>>t;
	while(t--){
	    int n,k;
	    cin>>n>>k;
	    while(n--){
	        int l;
	        cin>>l;
	        k=k-l;
	        if(k>=0) cout<<1;
	        else cout<<0;
	    }
	}

}

Problem Link: ATM Machine Practice Coding Problem

You are doing wrong if(k<l) you will not do k=k-l

You can refer to my code
https://www.codechef.com/viewsolution/1070346227