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

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.