Intersection of Two Linked Lists

Given the heads of two singly linked lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection, return null.

Intersection is defined by node identity (reference), not by node value. If the kth node of headA and the jth node of headB are the exact same node object, then the lists intersect at that node. After the intersection point, the two lists share the same sequence of nodes.

The linked lists must retain their original structure after the function returns.

Examples
Input: {"nodes":[],"roots":{"headA":null,"headB":null}}
Output:
Hints

Intersection of Two Linked Lists

Given the heads of two singly linked lists `headA` and `headB`, return the node at which the two lists intersect. If the two linked lists have no intersection, return `null`.