#include <ListNode.h>
#include <stdio.h>

struct ListNode *getIntersectionNode(struct ListNode *headA, struct ListNode *headB)
{
    if (headA == NULL || headB == NULL)
        return NULL;

    struct ListNode *pA = headA, *pB = headB;

    while (pA != pB)
    {
        pA = pA == NULL ? headB : pA->next;
        pB = pB == NULL ? headA : pB->next;
    }

    return pA;
}

int main()
{
    return 0;
}
