this is my code
It gives MLE , I don’t know how to fix it
Why my code gives memory limit exceeded?
hello @chetan_aggarwalbX1
change this->

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 