i haven’t include the backtracking step yet but first i want to see the wrong output which we generate using recursion
Take look this code is not giving me permutation
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.
please check this one more time in am getting the correct output without including the backtracking step https://ide.codingblocks.com/s/582433
this happens because you are passing the string by value
so every time new copy will be created hence no need to undo the changes in backtracking
but if you pass it by reference then you will get wrong ans