Please be more descriptive about your problem. Nobody can go through a plain-code and debug.
Just try to tell what you are trying to achieve and what is going wrong… that would be helpful
i m getting runtime error so i wanted to know if i am getting it because of memory?
You can check this submission. It should be fairly easy to understand I think. If you get stuck, do drop me your doubt.
thankyou so much dude.