Tower of hanoi recursion

what is wrong in my code
none of the test cases is passing but custom inputs are showing correct output

Your code is correct and giving correct output
can you plz check again?

if it doesn’t work
then instead of pow function use bit masking
because sometime pow function will not work as expected

instead of cout<<pow(2,n)-1; use
cout<<((1<<n)-1)<<endl;

not working with bit mask too

join this meeet i will see

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.