Intersection of Two Linked Lists (LeetCode 160).
Asked in the DSA round stage. Given two linked lists, return their first shared node, or None if they do not intersect.
For this JSON-compatible task, headA and headB are arrays of node values. A shared value represents the shared node, and the output is that value. Return the first value encountered in headA that also appears in headB.
def get_intersection_node(headA, headB):