Giving tle in all cases

How do i optimise the code:https://ide.codingblocks.com/s/267965

hi @bhaskar0_0 since there can be multiple test cases, head1 and head2 need to be initialised with NULL for every test case. So just declare them inside the while loop, so they will get started with NULL each time.
image

Please mark your doubt as resolved in case of no further queries :slight_smile: