Why my code gives memory limit exceeded?


this is my code
It gives MLE , I don’t know how to fix it

hello @chetan_aggarwalbX1

change this->
image

n can be zero as well , in such case take input function will stuck in infinite loop.
simply use while(n–){
read and insert inside this loop only
}

Thankyou! It worked :slight_smile: