though code is right according to me but test case 5 and 6 are not passing
Test cases not passing
@abhinavgoyal912
This is the updated code.
I have made changes to the else portion of the last condition. The while loop runs on the condition
while(slw>next != fst->next).
Try to draw a LL on paper and work out an example. You will be able to attain a better understanding. In case any doubts remain, please feel free to revert back.
In case my answer was able to resolve your query, please mark the doubt as resolved.
Sir still the same test cases are not passing i.e test case 5 and 6
You also need to check if the head is NULL or not. Refer to the updated code.
In case my answer was able to resolve your query, please mark the doubt as resolved.
1 Like
Thanks sir it resolved my doubt