i think it’s of the order O(n)already
“here is the link”
What is the reason for time limit exceed
hello @saurabh66
a)
here use l1!=null and l2!=null (Otherwise for empty list ur code will give segmentation fault)
b)

in ur while loop add these conditions ie
temp1!=NULL && temp2!=NULL && temp1!=temp2 (note i m using temp1!=temp2 because then it will be easy to handle)
in return simply do temp1;
