Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Intersection of Two Linked Lists

Two singly linked lists may merge into a shared tail. The input gives each list as a private prefix followed by a common tail. Print the value of the first shared node, or null if the lists do not intersect.

Constraints

0 <= a, b, c <= 3 * 10^4 1 <= value <= 10^5

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.