Insertion point of two linked lists

can u tell me the approach for this question??
I’m not able to understand it correctly!

@mvermav19,

  • Get count of the nodes in the first list, let count be c1.
  • Get count of the nodes in the second list, let count be c2.
  • Get the difference of counts d = abs(c1 – c2)
  • Now traverse the bigger list from the first node till d nodes so that from here onwards both the lists have equal no of nodes
  • Then we can traverse both the lists in parallel till we come across a common node. (Note that getting a common node is done by comparing the address of the nodes)

(reference gfg)

is the doubt clear @mvermav19?

yeah
it’s cleared!
Thanks a lot!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.