Intersection point is not giving output

https://ide.codingblocks.com/s/324140 pls tell my mistake . can we solve it by taking two loops ? what is the meaning of linear constraint written here pls reply soon

@shrutikatyal
Can you please tell me how you are trying to approach this question?
Linear constraint means that you need to return the answer in a single traversal of the two lists. Here is how I would approach the question. Since there can be equal elements in both the lists, the node addresses are a deciding feature for the intersecting nodes. I start traversing both the lists simultaneously. I maintain an unordered_map. Whenever I reach a node, I check whether that node has been visited before or not. If yes, I return that node as it is the answer, else I store the current nodes of both the lists in my unordered_map.

Please revert if you face any query.

https://ide.codingblocks.com/s/325079 its still not showing output pls check my code again

@shrutikatyal
This is similar to the earlier approach. Did you try doing it through the one I suggested?