This is my program .
public static int countTOH(int n, String src , String dest , String helper ) {
if(n==0) {
return 1 ;
}
int count = 0 ;
count += countTOH(n-1,src,helper,dest) ;
System.out.println("move disc "+n+" to "+src+" to "+dest);
count +=countTOH(n-1,helper,dest,src);
return count ;
}
Every time count is returning 1 extra step i.e , for 3 disks my program is returning 8 , for 4 disks it is returning 16.
Can you tell me where is the mistake in my program