Why we are not removing for return false ans.?

Why we are not removing for return false ans. from String res?

Hi @Vipin_coder,
We do not have to remove variables from the string because string is not changed in parent function. The string is changed while passing it as a parameter to a recursive function hence when the recursive function will end and return false and the program will return to previous parent function the string will be restored automatically as the string value is never changed. Take it as passing a new string when calling a recursive function . This way the main string is never changed so we do not have to change it back.

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.