Leetcode 题解 - 链表
1. 找出两个链表的交点Intersection of Two Linked Lists (Easy)public ListNode getIntersectionNode(ListNode headA, ListNode headB) { ListNode l1 = headA, l2 = headB; while (l1 != l2) { l1 = (l1 == null) ? headB : l1.next; l2 = (l2 == null)
原创
2021-04-07 16:34:08 ·
127 阅读 ·
0 评论