https://ide.codingblocks.com/s/140369 This is my code. I amunable to debug it
Runtime error in my code
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int t= sc.nextInt();
//use while loop to run for all the tc
while(t>0){
int n= sc.nextInt();
int []arr =new int [n];
for(int i=0;i<n;i++)
arr[i] =sc.nextInt();
boolean ans =tell(arr,0,0,0,0);
if(ans)
System.out.println("Yes");
else
System.out.println("No");
t--;
}
}
public static boolean tell(int []arr,int si,int ei,int ans,int len)
{
if(si==arr.length)
{
if(ans==0 && len>0){//we check that len should be greater than 0 because an empty set is also a subset with sum 0
return true;
}else{
return false;
}
}
return tell(arr,si+1,ei,ans,len)||tell(arr,si+1,ei,ans+arr[si],len+1);
}
}