We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Actually we should, @sushantsagar29's logic is correct. This is because at the point of return, both pointers should be null if they are identical. If they aren't NULL, means we did not reach the end of both linked list. They are identical only if we reach the end of the two linked list
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Compare two linked lists
You are viewing a single comment's thread. Return to all comments →
Actually we should, @sushantsagar29's logic is correct. This is because at the point of return, both pointers should be null if they are identical. If they aren't NULL, means we did not reach the end of both linked list. They are identical only if we reach the end of the two linked list