Closed underwindfall closed 2 years ago
https://leetcode-cn.com/problems/3u1WK4/
思路
[x] 刷15mins
[x] 刷5mins
//time O(m + n) //space O(1) public ListNode getIntersectionNode(ListNode headA, ListNode headB) { ListNode node1 = headA, node2 = headB; while (node1 != node2) { if (node1.next != null) { node1 = node1.next; } else { node1 = headB; } if (node2.next != null) { node2 = node2.next; } else { node2 = headA; } } return node1; }
https://leetcode-cn.com/problems/3u1WK4/
思路
[x] 刷15mins
[x] 刷5mins