Recursion-Subsequences problem

import java.util.*;

import java.lang.Math;
public class Main {
public static int total(String str)
{ int n = str.length();
double c=Math.pow(2,n)-1;

int value = (int)Math.round©;
return value;
}
public static void ss(String str,String ans){
if(str.length()==0){
System.out.print(ans+"\t");
return;
}
char c=str.charAt(0);
String rr=str.substring(1);
ss(rr,ans);
ss(rr,ans+c);
}
public static void main(String args[]) {
try{
Scanner sc=new Scanner(System.in);
String n=sc.nextLine();
ss(n,"");
int g=total(n);

 System.out.println("\n"+g);}
 catch(Exception e){System.out.print(e);}

}}
i had run it answer in coming right but it howing wrong…
why so

your code is correct
just match the your output form with required output form
System.out.print(ans+"\t"); // don’t give a tab space
just give a space between different subseq.

then print a new line
and then print the no of subseq.

and pls don’t use the mathmatical fomula for calculating the no of subeq.

problem not resole yet

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.