https://ide.codingblocks.com/s/57439
my code is only producing -1 as output in all cases. how to rectify it ?
https://ide.codingblocks.com/s/57439
my code is only producing -1 as output in all cases. how to rectify it ?
Hi Yukti, your approach is not correct. There is no need to find out the length of the linked lists. This would not only increase the complexity of the problem, it is also not needed.
You just need to find the intersection point (i.e. the point which is common in both linked lists) of the linked lists.