Can i solve it without calculating length?

can i solve it without calculating length?

hey @Vipin_coder
Use 2 nested for loops. The outer loop will be for each node of the 1st list and inner loop will be for 2nd list. In the inner loop, check if any of nodes of the 2nd list is same as the current node of the first linked list. The time complexity of this method will be O(M * N) where m and n are the numbers of nodes in two lists.
I would suggest you, if you want to do a question with a different approach, try yourself. This is a better way to learn.

can i solve it by store the value of first list and, during iteration of second list i check if it already present , return that value.?

if any of nodes of the 2nd list is same as the current node of the first linked list. that means intersection return value