Regarding sum it up

Sir my code is producing correct output but test case is failing please tell me the logic is right or mot and please debug this

/******************************************************************************

                        Online Java Compiler.
            Code, Compile, Run and Debug java program online.

Write your code in this editor and press “Run” button to execute it.

*****************************************************************************/
import java.util.
;
public class sumitup
{
public static ArrayList ar=new ArrayList<>();
public static ArrayList at=new ArrayList<>();
public static int count=0;
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
//int n=s.nextInt();
int A[]=new int[] {10,1,2,7,6,1,5};
/

* for(int i=0;i<n;i++) { A[i]=s.nextInt(); }
*/

 per(A,0,0,8," ");



  

 
  	 
}


public static void per(int arr[],int k,int idx,int total,String ans){
    if(total==0){
       count++;
     	      System.out.println(count+" "+ans);
     
        return;
    }
    
  
   	    int ars[]=new int[6];
    for(int i=k;i<arr.length;i++){
    	int count=0;
    	  ars[count]=arr[i];
    	  count++;
       if(arr[i]<=total && arr[i]!=arr[idx]){
      if(i>=idx){
    	  
    	  
       per(arr,k+i,idx+1,total-arr[i],ans+""+arr[i]);
    // k=0;
        }
        }
      
    }
    
    
    
    
    
    
}

}
I have try it many times

Hi Saurabh, can you please mention the link of problem you are facing difficulty in or is it just the concept? Also, please share the final code that you are submitting.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.