algorithm icon indicating copy to clipboard operation
algorithm copied to clipboard

剑指offer52FirstCommonNode

Open dayAndnight2018 opened this issue 6 years ago • 0 comments

在对两个链表长度判断得到较长或者较短的地方,忽略了两个链表相等的问题,导致测试不通过: ListNode longListHead = len1 > len2 ? pHead1 : pHead2; ListNode shortListHead = len1 < len2 ? pHead1 : pHead2;

第二句修改为: ListNode shortListHead = len1 <= len2 ? pHead1 : pHead2;

问题解决

dayAndnight2018 avatar Jul 27 '19 06:07 dayAndnight2018