Skip to content

Commit 7812d91

Browse files
committed
refactor: 21. Merge Two Sorted Lists
1 parent 6eb0ac0 commit 7812d91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

merge-two-sorted-lists/gwbaik9717.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ var mergeTwoLists = function (list1, list2) {
2020

2121
while (list1 && list2) {
2222
if (list1.val < list2.val) {
23-
current.next = new ListNode(list1.val);
23+
current.next = list1;
2424
list1 = list1.next;
2525
} else {
26-
current.next = new ListNode(list2.val);
26+
current.next = list2;
2727
list2 = list2.next;
2828
}
2929

0 commit comments

Comments
 (0)