Skip to content

Commit dfd298e

Browse files
committed
Time: 57 ms (81.96%), Space: 51.3 MB (79.66%) - LeetHub
1 parent b7ed029 commit dfd298e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ var mergeTwoLists = function (list1, list2) {
2323
}
2424
current = current.next;
2525
}
26-
if (list1) {
27-
current.next = list1;
28-
} else {
29-
current.next = list2;
30-
}
26+
current.next = list1 ? list1 : list2
3127
return dummy.next;
3228
};

0 commit comments

Comments
 (0)