this is my code. Although I assigned the string as blank in the base case but it is still printing previous answer +new answer.
I feel like it does not create any difference to string upon assignment . Is that so?
Also how to correct the answer.
Printing wrong answers
@tanjuljain19
hello Tanjul,
![]()
In this line you will keep append new charater in the previous ans.
assigning null will not work becuase scope is local and for each function new copy of ans variable will be made.
to rectify 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.