• + 0 comments

    Simple Python code:

    def findMergeNode(head1, head2):
        A,B = head1, head2
        seen=[]
    
        while A:
                seen.append(A)
                A=A.next
        while B:
                if B in seen:
                    return B.data
                else:
                    B=B.next
    
        return None