LeedCode
Problems
Linked List
28 remaining tasks
0206 - Reverse Linked List
Easy
0021 - Merge Two Sorted Lists
Easy
0234 - Palindrome Linked List
Easy
0203 - Remove Linked List Elements
Easy
0083 - Remove Duplicates From Sorted List
Easy
0876 - Middle of the Linked List
Easy
0160 - Intersection of Two Linked Lists
Easy
0143 - Reorder List
Easy
2130 - Maximum Twin Sum Of A Linked List
Easy
0019 - Remove Nth Node From End of List
Easy
1721 - Swapping Nodes in a Linked List
Easy
0460 - LFU Cache
Easy
0138 - Copy List With Random Pointer
Easy
0707 - Design Linked List
Easy
1472 - Design Browser History
Easy
0002 - Add Two Numbers
Easy
0141 - Linked List Cycle
Easy
0287 - Find The Duplicate Number
Easy
0024 - Swap Nodes In Pairs
Easy
0148 - Sort List
Easy
0086 - Partition List
Easy
0061 - Rotate List
Easy
0092 - Reverse Linked List II
Easy
0622 - Design Circular Queue
Easy
0147 - Insertion Sort List
Easy
0146 - LRU Cache
Easy
0023 - Merge K Sorted Lists
Easy
0025 - Reverse Nodes In K Group
Easy
0160 - Intersection of Two Linked Lists
Easy
Javascript
Code
/**
 * Definition for singly-linked list.
 * function ListNode(val) {
 *     this.val = val;
 *     this.next = null;
 * }
 */

/**
 * @param {ListNode} headA
 * @param {ListNode} headB
 * @return {ListNode}
 */
var getIntersectionNode = function (headA, headB) {
    let a = headA;
    let b = headB;
    while (a !== b) {
        a = a === null ? headB : a.next;
        b = b === null ? headA : b.next;
    }

    return a;
};
Mark as complete
Close
Shortcut: Ctrl + .
Shortcut: Ctrl + /