I cant pass the cases!

hello @haseebshaik00
ur insert at end function is taking o(n) for each insertion , for n such insertion it will be o(n^2) which is too much.

the idea is to keep track of tail node as well and while inserting new node ,take help of tail node and update ur tail node

check this->

I cant pass the cases!!!

print ouput for each cases in seprate line(but it will pass only one case).

to pass all u need to follow this->