Please help me in removing the error

@ayushijaan23
You forgot to initialise vector
Add this after line 74
st.init(st.n);

Kindly close the doubt

1 Like

Can you suggest more changes to my code. It’s still giving error.

Hey @ayushijaan23
I’m sorry for replying this late. I lost track of your doubt.
Coming to the doubt your code seems fine. I must be missing something very trivial that is causing the issue. I request you to kindly cross verify your solution with this one https://ide.codingblocks.com/s/226730.

1 Like

Thank you for your reply.
Please have a look at the attached URL to my updated code.


Awaiting your kind response soon.

Hey @ayushijaan23
You need to remove line 10
You initialised arr to size N and then used push_back
Do either of these not both
Hope this helps !

Thanks a bunch!

1 Like