Getting time limit error

hi
u have to also made
head1=NULL and head2 =NULL after every test case

still getting time limit error after making head1 & head2 as NULL

it is getting submitted for me
check this