if i add 0 to array we are passing why it doesn’t it work and i remove the 0 from the same array it works fine
public class Coin {
static int count=0;
public static void main(String[] args){
Qc(new int[]{2,3,5,6},20," ");
}
public static void Qc(int[] box,int tq, String ans){
if(tq==0){
count++;
System.out.println(count+". "+ans );
return;
}
for(int i=0;i<box.length;i++)
{ if (tq>=box[i]){
Qc(box,tq-box[i],ans+box[i]);
}}
}
}