i think my base conditions are wrong
please check my code
Base condition problem
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!
that is if you are doing b1-1 only when b1>0
not able to get correct answer, don’t know why
i am getting 54 in this testcase-: 369 428 797
but the answer is 56
thanks, do you generally code in java?
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.