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 at all, return null. The two lists may share a common suffix of nodes. The test harness builds list A, then builds list B's private prefix and links it to A's node at index skipA (or leaves B independent when skipA is -1). Return the value of the intersection node, or null if there is none. The linked lists must retain their original structure after the function returns.
Example 1
Input: headA = [4,1,8,4,5], skipA = 2, headB = [5,6,1]
Output: 8
Explanation: A = 4->1->8->4->5, B = 5->6->1->8->4->5; they share the suffix starting at 8.
Example 2
Input: headA = [2,6,4], skipA = -1, headB = [1,5]
Output: null
Explanation: No intersection: the lists are independent.
Example 3
Input: headA = [1,9,1,2,4], skipA = 3, headB = [3]
Output: 2
Explanation: B = 3->2->4 joins A at index 3 (value 2).
Two pointers that switch to the other list's head after reaching the end travel the same total distance, so they align at the intersection.
Run checks all cases above. Submit evaluates all test cases.