what will be the base case of this problem, i m not able to solve this problem.
Converting problem on hackerearth
@anujkurmi You have 3 parameters a,b and c. You have to convert a to b and a should change on each recursive call to a x c or a-2 or a-1. So other 2 parameters b and c should remain unchanged.
So base case should be
if(a==b)
return true;
Also you should make sure that when c>1 and a>b ,then you should not make the recursive call to a x c as it would lead to an unnecessary operation and will lead to an infinite loop.
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.