Count of steps in tower of hanoi

how can we count the steps and display it after the code

Hey @pulkitgupta622 You can make the return type = int and return 1 ; every time you hit a base case;
and call your method like this :
count += toh()//with all the parameters

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.