Min stack question

the code is showing error kindly rectify

Hey @shabadsingh, you have implemented the same approach as Prateek bhaiya did?

prateek bhaiya did it using vector i tried to impement it with stl class stack

The please add comments so that I can understand your code better and share the new code with me here.

@mr.encoder kindly tell why the error is occuring

ok brother i will add comments and share the new code

That will be helpful @shabadsingh :grinning:

@mr.encoder


this is the code after adding comments

I will let you know your mistake, till then be patient :grinning:

1 Like

hey @shabadsingh you are getting error because of the reason i have commented in this picture


in line number 15. whereas the correct code is here : https://ide.codingblocks.com/s/342175,
have a look. Hope this would have helped :smile:

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.