Skip to content

Commit b8b3b47

Browse files
committed
fix: listnode check
1 parent e6c315a commit b8b3b47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/82/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { withTimeLog } = require("../../common/utils/withTimeLog");
2+
const {convertListNode, parseListNode} = require("../../common/structures/ListNode");
23
/**
34
* 82.删除排序链表中的重复元素 II [2024-01-15]
45
* 给定一个已排序的链表的头 head , 删除原始链表中所有重复数字的节点,只留下不同的数字 。返回 已排序的链表 。
@@ -62,8 +63,8 @@ var deleteDuplicates = function(head) {
6263
/**
6364
* Test case
6465
*/
65-
withTimeLog(() => deleteDuplicates(head = [1,2,3,3,4,4,5]),[1,2,5]);
66-
withTimeLog(() => deleteDuplicates(head = [1,1,1,2,3]),[2,3]);
66+
withTimeLog(() => parseListNode(deleteDuplicates(convertListNode(head = [1,2,3,3,4,4,5]))),[1,2,5]);
67+
withTimeLog(() => parseListNode(deleteDuplicates(convertListNode(head = [1,1,1,2,3]))),[2,3]);
6768

6869
console.log("点击跳转到题目提交:https://leetcode.cn/problems/remove-duplicates-from-sorted-list-ii/")
6970

0 commit comments

Comments
 (0)