What's wrong with this method
@Narasimha,
When we pass ans+ch as argument, we append a character in the string ans.
Here the value of ans loses its value after we call the function again.
When we do ans = ans+ch, we keep appending a char at the end of string ans. Now this char is appended everytime we iterate and its value goes like: a,ab,abc,abcb,abac and so on. We keep on adding chars to it.
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.