diff --git a/linked_lists/intersection.py b/linked_lists/intersection.py index f07e2ae..4c38cab 100644 --- a/linked_lists/intersection.py +++ b/linked_lists/intersection.py @@ -1,6 +1,3 @@ - - - class Node: def __init__(self, value): self.val = value @@ -8,7 +5,11 @@ def __init__(self, value): def intersection_node(headA, headB): - """ Will return the node at which the two lists intersect. - If the two linked lists have no intersection at all, return None. - """ - pass \ No newline at end of file + while headA is not None: + tempB = headB + while tempB is not None: + if headA == tempB: + return headA + tempB = tempB.next + headA = headA.next +