Please tell the error in my code why it is showing wrong answer
Please tell the error in my code
Hi @Ramitgoel
Replace in by inp because in is an internal keyword which is causing error in your code. And after doing this you will get output in reverse order. That is for input ab your code is printing ab a b but correct output should be b a ab . So in order to correct you need to take a stack and then push the string out in the stack instead of printing it and in the main function after function call print all the strings in the stack.
Here is your corrected code :
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.