Pls help me to remove the segmention fault

Hey @Senjuti256
Did 2 changes :https://ide.codingblocks.com/s/332986
First on line 74 and other on line 102

Where to optimise the code to avoid tle?

Its working fine on my side,please check your input
It should be of the form
T
N1
N1 ELEMENTS
N2
N2 ELEMENTS

It is showing tle and is not getting submitted though output of the sample input is coming correct

The input format is correct

Hey @Senjuti256
Please share the link where you are trying to submit ,also share your code again :slight_smile:

I am submitting both in the assignment section and also in the hackerblocks but showing tle although the sample output is coming correct

Hey @Senjuti256
You have to add a=NULL,b=NULL after while(t–) because for each test case we have to input new list if u don’t do so then new data is added to prev data and size becomes big enough to give TLE
also, add cout<<endl after printing list for different test cases