Is modifying the Nodes within the 'boundaries' of the challenge?


  • 0
    R
    var getIntersectionNode = function(headA, headB) {
        if (!headA || !headB) return null;
        while (headA) {
            headA.flagged = true;
            headA = headA.next;
        }
        while (headB) {
            if (headB.flagged) {
                return headB;
            }
            headB = headB.next;
        }
        return null;
    };
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.