the output is coming wrong please help me in finding the error:-
the link to the code is:-
Reverse stack using 1 stack
@krikhi Hello Kriti,
error was in line no 38,u were using i<s.size() .evertime stack size was decreasing by 1 and so is your s.size() thus u were not getting all element in ur output.
here is your working code- https://ide.codingblocks.com/s/173787
I have just stored s.size() in n so that it won’t change.
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.