How to update the input part in my code?


u cannot modify any other function other than intersectionOfTwoLinkedList

Ma’am input should be like this ? so for that we have to make two build functions?

1 2 3 4 5 -1
9 8 7 4

image

ya i agrree that the function u are building is correct but then what the question demands is that u do not build the linked list
just use the 2 given linked list whose head nodes are given and
find the intersection
so u just have to write the logic for what is the intersection point

in case u are unable to code ping back i`ll help


maam maine kaafi try krne ki koshish ki mujhe schme smjh ni aarha isko kaise modify krein.

Ma’am input should be like this ? i dont know how to take input like this :frowning:
1 2 3 4 5 -1
9 8 7 4

I`ll just let u know
mera code bhi thodi dikat de rhaa h


code in intersectionOfTwoLinkedLists function adn count_list


compare the addresses and not data of node
since the input is of that form

Ma’am this code is working fine. :slight_smile :slight_smile: thank you.
mujhe hash nhi aata abhi isliye smj ni aarha pr :frowning:

brooooo
nothing to do with hash

apne intersection point of LL ka algo samjha hua h ??


method 3
same vahi use kia h

Thank you :slight_smile:

1 Like