Not getting the code given

can you please tell me the approach.

@Jainish-Patel-1007094602980100
In this question there will be one intersecting node between the two linked lists.

Here 15 is the intesecting node. So output will be 15.
The efficient way to do this problem is to use difference of node counts.

  1. Get count of the nodes in the first list, let count be c1.
  2. Get count of the nodes in the second list, let count be c2.
  3. Get the difference of counts d = abs(c1 – c2).
  4. 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.
  5. 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).

i change my code according to your approach but not getting ans. can you please give suggestion to correct my code

@Jainish-Patel-1007094602980100 refer this
(https://www.geeksforgeeks.org/write-a-function-to-get-the-intersection-point-of-two-linked-lists/)