In the question Intersection of LinkedList I have to write the function to get the node of intersection

There was a hint video before this question and i have done all the work according to that hint. but when i compile the program it says the error input mismatch. please have a look at the code below and i have just written the code in intersection function all the other code are stubbed.

error input mismatch means that the input your code was expecting is different from the one you provided.

Your logic looks good, it’s just a tiny mistake in your code at line number 47 that the final while loop should be outside the else block.

Also, we will have to use logical AND (&&) instead of logical OR(||) operation when comparing in the while loop, else the loop will not terminate until both temp11 and temp22 are null and you’ll receive a null pointer exception.

Sir please check it is still showing InputmismatchError. Code : https://ide.codingblocks.com/s/580188

Try submitting your code directly as you are not provided with the sample input.
The problem statement says that : This is not the actual input that will be provided but rather a description of it.
You just need to complete the function.

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.