My issue
what is error in my code?
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
while(n>0){
int k=sc.nextInt();
int N=sc.nextInt();
int [] a=new int[k];
for(int i=0;i<k;i++){
a[i]=sc.nextInt();
}
int t=0;
for(int i=0;i<k;i++){
if(a[i]>N){
System.out.print("0");
}
else{
t=t+a[i];
if(t<=N){
System.out.print("1");
}
else{
System.out.print("0");
}
}
}
}
}
}
Problem Link: ATM Machine Practice Coding Problem - CodeChef