Getting a wrong output , i think their is a problem with the base case

@aryan_007
if(i==C.length() && b1==0 && b2==0 && carry==0)
return 1;
else if(i==C.length())
return 0;
should be the base case,
also take care of b1>0 and b2>0 individually inside while calculating result!

1 Like

thanks , it worked out !!

1 Like