How to directly take input the head of two linked lists
hello @Mudit809
i m not getting what exaclty u want to do.
for this problem read two list
and then compare their data to determine intersection.
in the ques it is given that we have to tka einput the heads of two linked lists. so do we need to create the two linked lists. bcz in the ques it is not mentioned how we have to take the input of two linked lists.
yeah take them separately and use data to determine intersection.
but if we take two seperate linked lists as input then how will be the two intersect at a point?
they will be two seperate linked lists and we will not get ant intersection point.
that is why i m telling u to use data of node to determine they intersect or not .
if any two node of both list have same value then they are intersecting
okay I got it. Instead of comparing the pointer we will compare the data part.
Thanks a lot bhaiya.
Bhaiya i’m not getting correct output. can you please correct my code:

remove this.
also pls share problem(statement along with constraint) screenshot with me…
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.